-
Notifications
You must be signed in to change notification settings - Fork 68
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
New benchmarks in java #222
Open
mahlashrifi
wants to merge
5
commits into
spcl:java_benchmarks_support
Choose a base branch
from
mahlashrifi:java_benchmarks_support
base: java_benchmarks_support
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
aab419d
making jar file is working correctly
mahlashrifi a80e91f
loginChecker running successfly on openwhisk
mahlashrifi 686b536
Update config.json
mahlashrifi 4f24bd3
Add all codes
mahlashrifi c019089
Merge branch 'java_benchmarks_support' of github.com:mahlashrifi/serv…
mahlashrifi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"java.configuration.updateBuildConfiguration": "interactive" | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
||
"languages": ["java"] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
26 changes: 26 additions & 0 deletions
26
benchmarks/600.java/602.login-checker/java/src/main/java/faas/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
benchmarks/600.java/602.login-checker/java/src/main/java/util/ConstantKeyProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
benchmarks/600.java/602.login-checker/java/src/main/java/util/IKeyProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
benchmarks/600.java/602.login-checker/java/src/main/java/util/ISecurityProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.vscode should be deleted :-)