-
Notifications
You must be signed in to change notification settings - Fork 89
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
base: java_benchmarks_support
Are you sure you want to change the base?
Changes from 19 commits
a9b41f1
b0e0483
f9db755
b1307e1
29e7d3f
bced306
3c53e5f
49deef7
722b447
930813e
f295e01
0fa43be
3fb661f
a14d0a0
aab419d
a80e91f
686b536
4f24bd3
c019089
a6ec3f5
fbc34a8
29e3529
1a1a647
4e997ef
fbeaa89
28b4e92
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
|
|
||
| { | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "type": "java", | ||
| "name": "Main", | ||
| "request": "launch", | ||
| "mainClass": "Main" | ||
| }, | ||
| { | ||
| "name": "Python: Debug sebs.py Command", | ||
| "type": "python", | ||
| "request": "launch", | ||
| "program": "${workspaceFolder}/sebs.py", | ||
| "args": [ | ||
| "benchmark", | ||
| "invoke", | ||
| "602.login-checker", | ||
| "test", | ||
| "--config", | ||
| "config/login-checker-config.json", | ||
| "--deployment", | ||
| "openwhisk", | ||
| "--verbose" | ||
| ], | ||
| "console": "integratedTerminal", | ||
| "cwd": "${workspaceFolder}", | ||
| "justMyCode": false | ||
| } | ||
| ] | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "java.configuration.updateBuildConfiguration": "interactive" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "timeout": 120, | ||
| "memory": 512, | ||
| "languages": ["java"] | ||
| } | ||
|
|
| 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!"); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "timeout": 60, | ||
| "memory": 24, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will check it. thanks. |
||
| "languages": ["java"] | ||
| } | ||
|
|
||
| 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 { } |
| 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> | ||
| <!-- <!– https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind –>--> | ||
| <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); | ||
|
|
||
| } |
Uh oh!
There was an error while loading. Please reload this page.