Skip to content
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
wants to merge 5 commits into
base: java_benchmarks_support
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

Copy link
Collaborator

Choose a reason for hiding this comment

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

.vscode should be deleted :-)

{
"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
}
]
}

3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
Empty file.
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?

"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