Skip to content

New benchmarks in java #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: java_benchmarks_support
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a9b41f1
Add base image for Java benchmarks on OpenWhisk
mahlashrifi Sep 8, 2024
b0e0483
Add Dockerfile for running Java benchmarks on OpenWhisk
mahlashrifi Sep 8, 2024
f9db755
Update base image of java on OpenWhisk
mahlashrifi Sep 8, 2024
b1307e1
Add Java-based handler for OpenWhisk
mahlashrifi Sep 10, 2024
29e7d3f
Add example config file for running java benchmarks on OpenWhisk
mahlashrifi Sep 19, 2024
bced306
Add JAVA enum to list of languages
mahlashrifi Sep 19, 2024
3c53e5f
Add config of 601.hello-world (A simple java benchmark)
mahlashrifi Sep 19, 2024
49deef7
Init maven structure of 601.hello-world and add some codes for runnin…
mahlashrifi Sep 19, 2024
722b447
Sync hello-world maven paroject with the wrapper of openwhisk
mahlashrifi Sep 19, 2024
930813e
Example config file for running 601.hello-world on openwhisk
mahlashrifi Sep 23, 2024
f295e01
Correct Structure of maven project in 601.hello-world benchmark
mahlashrifi Sep 23, 2024
0fa43be
Expand add_code functions for maven java rojects
mahlashrifi Sep 23, 2024
3fb661f
Exclude Java main wrapper from Docker directory created in runtimes.
mahlashrifi Sep 23, 2024
a14d0a0
Fix a big
mahlashrifi Sep 25, 2024
aab419d
making jar file is working correctly
mahlashrifi Sep 25, 2024
a80e91f
loginChecker running successfly on openwhisk
mahlashrifi Sep 25, 2024
686b536
Update config.json
mahlashrifi Oct 6, 2024
4f24bd3
Add all codes
mahlashrifi Oct 17, 2024
c019089
Merge branch 'java_benchmarks_support' of github.com:mahlashrifi/serv…
mahlashrifi Oct 17, 2024
a6ec3f5
Remove .vscode folder from the repository and add it to .gitignore
mahlashrifi Dec 25, 2024
fbc34a8
Removed out_storage.json
mahlashrifi Dec 25, 2024
29e3529
Refactored OpenWhisk run command handling for Java functions
mahlashrifi Dec 26, 2024
1a1a647
Removed repo name from system.json file
mahlashrifi Dec 26, 2024
4e997ef
Removed config files mistakenly committed.
mahlashrifi Dec 26, 2024
fbeaa89
Reverted config file to remove unintended changes.
mahlashrifi Dec 26, 2024
28b4e92
Remove redundant benchmarks
mahlashrifi Feb 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,6 @@ cache
# IntelliJ IDEA files
.idea
*.iml

# Visual Studio Code files
.vscode/
6 changes: 6 additions & 0 deletions benchmarks/600.java/601.hello-world/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"timeout": 120,
"memory": 512,
"languages": ["java"]
}

Empty file.
38 changes: 38 additions & 0 deletions benchmarks/600.java/601.hello-world/java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<!-- Group ID and Artifact ID uniquely identify the project -->
<groupId>faas</groupId>
<artifactId>601.hello-world</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging> <!-- The packaging type for the project (jar by default) -->

<!-- Configure the Java version (set to Java 8) -->
<properties>
<maven.compiler.source>1.8</maven.compiler.source> <!-- Source compatibility (Java 8) -->
<maven.compiler.target>1.8</maven.compiler.target> <!-- Target compatibility (Java 8) -->
</properties>

<!-- Define the main class to run the JAR -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<mainClass>faas.App</mainClass> <!-- Replace with your main class -->
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package faas;

public class App {
public static void main(String[] args) {
System.out.println("Hellooooooooooooooooooo, World!");
}
}
6 changes: 6 additions & 0 deletions benchmarks/600.java/602.login-checker/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"timeout": 60,
"memory": 24,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't appear to be a correct value - is it really just 24 MB?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for asking. I wasn’t sure. Now the benchmark is running correctly without any errors, but in general, how should I find this value?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be found experimentally as it differs per each benchmark

I'm also not sure if we even set this up on OpenWhisk.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check it. thanks.

"languages": ["java"]
}

5 changes: 5 additions & 0 deletions benchmarks/600.java/602.login-checker/input.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def buckets_count():
return (0, 0)

def generate_input(data_dir, size, benchmarks_bucket, input_paths, output_paths, upload_func):
return { }
58 changes: 58 additions & 0 deletions benchmarks/600.java/602.login-checker/java/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>faas</groupId>
<artifactId>benchmark</artifactId>
<version>1</version>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.11.0</version>
</dependency>
<!-- &lt;!&ndash; https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind &ndash;&gt;-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.17.2</version>
</dependency>

</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package faas;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import util.SessionBlob;
import util.ShaSecurityProvider;

//import jakarta.ws.rs.core.Response;


public class App {
public JsonObject handler(JsonObject args) {
Gson gson = new Gson();
SessionBlob blob = gson.fromJson(args, SessionBlob.class);

ShaSecurityProvider securityProvider = new ShaSecurityProvider();
SessionBlob validatedBlob = securityProvider.validate(blob);

JsonObject jsonResult = new JsonObject();
if (validatedBlob != null)
jsonResult.addProperty("Authorization-Status", "Authorized");
else
jsonResult.addProperty("Authorization-Status", "Unauthorized");
return jsonResult;
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package util;


/**
* Class for testing. Provides a constant key. DO NOT ADOPT THIS FOR ANY REAL
* PRODUCTION WORKLOAD!
*
* @author Joakim von Kistowski
*
*/
public class ConstantKeyProvider implements IKeyProvider {

/**
* {@inheritDoc}
*/
@Override
public String getKey(SessionBlob blob) {
return "thebestsecretkey";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

package util;

/**
* Provides keys for the security provider. The key provider must ensure that
* keys accross replicated stores are consistent.
*
* @author Joakim von Kistowski
*
*/
public interface IKeyProvider {

/**
* Returns a key for a session blob. Key must be the same, regardless of the
* store instance upon which this call is made.
*
* @param blob
* The blob to secure.
* @return The key.
*/
public String getKey(SessionBlob blob);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package util;


/**
* Utilities for securing (e.g. encrypting) session blobs.
*
* @author Joakim von Kistowski
*
*/
public interface ISecurityProvider {

/**
* Get the key provider for this security provider.
*
* @return The key provider.
*/
public IKeyProvider getKeyProvider();

/**
* Secures a session blob. May encrypt or hash values within the blob.
*
* @param blob
* The blob to secure.
* @return A secure blob to be passed on to the web ui.
*/
public SessionBlob secure(SessionBlob blob);

/**
* Validates a secured session blob. Returns a valid and readable (e.g.
* decrypted) blob. Returns null for invalid blobs.
*
* @param blob
* The blob to secure.
* @return The valid and readable (e.g. decrypted) blob. Returns null for
* invalid blobs.
*/
public SessionBlob validate(SessionBlob blob);

}
Loading