geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyba...@apache.org
Subject [geode-benchmarks] branch develop updated: Add option to Gradle command to run benchmark with SSL enabled (#88)
Date Thu, 11 Jul 2019 23:23:14 GMT
This is an automated email from the ASF dual-hosted git repository.

heybales pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode-benchmarks.git


The following commit(s) were added to refs/heads/develop by this push:
     new 217f1cf  Add option to Gradle command to run benchmark with SSL enabled (#88)
217f1cf is described below

commit 217f1cf1da27bce636bdd1c55c1b5821afaaa19f
Author: Kamilla Aslami <kaslami@pivotal.io>
AuthorDate: Thu Jul 11 16:23:09 2019 -0700

    Add option to Gradle command to run benchmark with SSL enabled (#88)
    
    Add an option for running with SSL enabled to benchmark gradle and scripts.
---
 README.md                                          |  2 +-
 geode-benchmarks/build.gradle                      |  1 +
 .../benchmark/parameters/GeodeProperties.java      | 74 ++++++++++++++++------
 .../apache/geode/benchmark/tasks/StartClient.java  | 10 ++-
 .../apache/geode/benchmark/tasks/StartLocator.java |  8 ++-
 .../apache/geode/benchmark/tasks/StartServer.java  | 10 ++-
 .../benchmark/topology/ClientServerTopology.java   | 12 ++++
 infrastructure/scripts/aws/README.md               | 21 +++++-
 infrastructure/scripts/aws/analyze_tests.sh        |  2 +-
 infrastructure/scripts/aws/run_against_baseline.sh |  3 +-
 10 files changed, 112 insertions(+), 31 deletions(-)

diff --git a/README.md b/README.md
index 43062c1..83f9b67 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ Optionally you can control the output directory with `-PoutputDir=/tmp/results`
 ### Running in aws
 
 This project includes some scripts to automate running benchmarks in AWS. See the 
-[README.md](infrastructure/aws/README.md) in the infrastructure/aws directory.
+[README.md](infrastructure/scripts/aws/README.md) in the infrastructure/aws directory.
 
 ## Project structure
 
diff --git a/geode-benchmarks/build.gradle b/geode-benchmarks/build.gradle
index 3c167e1..d7816f4 100644
--- a/geode-benchmarks/build.gradle
+++ b/geode-benchmarks/build.gradle
@@ -73,6 +73,7 @@ task benchmark(type: Test) {
     systemProperty 'TEST_HOSTS', project.findProperty('hosts')
     systemProperty 'TEST_METADATA', project.findProperty('metadata')
     systemProperty 'OUTPUT_DIR', outputDir
+    systemProperty 'withSsl', project.hasProperty('withSsl')
     systemProperty 'benchmark.profiler.argument', project.findProperty('benchmark.profiler.argument')
 
     doFirst {
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/GeodeProperties.java
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/GeodeProperties.java
index 9f27dbe..aa4149e 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/GeodeProperties.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/parameters/GeodeProperties.java
@@ -14,30 +14,51 @@
  */
 package org.apache.geode.benchmark.parameters;
 
+import static org.apache.geode.distributed.ConfigurationProperties.ARCHIVE_DISK_SPACE_LIMIT;
+import static org.apache.geode.distributed.ConfigurationProperties.ARCHIVE_FILE_SIZE_LIMIT;
+import static org.apache.geode.distributed.ConfigurationProperties.CONSERVE_SOCKETS;
+import static org.apache.geode.distributed.ConfigurationProperties.DISTRIBUTED_SYSTEM_ID;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION;
+import static org.apache.geode.distributed.ConfigurationProperties.ENABLE_TIME_STATISTICS;
+import static org.apache.geode.distributed.ConfigurationProperties.LOCATOR_WAIT_TIME;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_DISK_SPACE_LIMIT;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_FILE_SIZE_LIMIT;
+import static org.apache.geode.distributed.ConfigurationProperties.LOG_LEVEL;
+import static org.apache.geode.distributed.ConfigurationProperties.MEMBER_TIMEOUT;
+import static org.apache.geode.distributed.ConfigurationProperties.REMOVE_UNRESPONSIVE_CLIENT;
+import static org.apache.geode.distributed.ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_ENABLED_COMPONENTS;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_KEYSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE;
+import static org.apache.geode.distributed.ConfigurationProperties.SSL_TRUSTSTORE_PASSWORD;
+import static org.apache.geode.distributed.ConfigurationProperties.STATISTIC_SAMPLING_ENABLED;
+import static org.apache.geode.distributed.ConfigurationProperties.USE_CLUSTER_CONFIGURATION;
+import static org.apache.geode.security.SecurableCommunicationChannels.ALL;
+
 import java.util.Properties;
 
-import org.apache.geode.distributed.ConfigurationProperties;
 
 public class GeodeProperties {
 
   public static Properties serverProperties() {
     Properties properties = new Properties();
 
-    properties.setProperty(ConfigurationProperties.CONSERVE_SOCKETS, "false");
-    properties.setProperty(ConfigurationProperties.ENABLE_TIME_STATISTICS, "true");
-    properties.setProperty(ConfigurationProperties.LOCATOR_WAIT_TIME, "120");
-    properties.setProperty(ConfigurationProperties.LOG_DISK_SPACE_LIMIT, "100");
-    properties.setProperty(ConfigurationProperties.LOG_FILE_SIZE_LIMIT, "10");
-    properties.setProperty(ConfigurationProperties.LOG_LEVEL, "config");
-    properties.setProperty(ConfigurationProperties.REMOVE_UNRESPONSIVE_CLIENT, "true");
-    properties.setProperty(ConfigurationProperties.STATISTIC_SAMPLING_ENABLED, "true");
-    properties.setProperty(ConfigurationProperties.ARCHIVE_DISK_SPACE_LIMIT, "150");
-    properties.setProperty(ConfigurationProperties.ARCHIVE_FILE_SIZE_LIMIT, "10");
-    properties.setProperty(ConfigurationProperties.DISTRIBUTED_SYSTEM_ID, "0");
-    properties.setProperty(ConfigurationProperties.ENABLE_CLUSTER_CONFIGURATION, "false");
-    properties.setProperty(ConfigurationProperties.USE_CLUSTER_CONFIGURATION, "false");
-    properties.setProperty(ConfigurationProperties.SERIALIZABLE_OBJECT_FILTER,
-        "benchmark.geode.data.**");
+    properties.setProperty(CONSERVE_SOCKETS, "false");
+    properties.setProperty(ENABLE_TIME_STATISTICS, "true");
+    properties.setProperty(LOCATOR_WAIT_TIME, "120");
+    properties.setProperty(LOG_DISK_SPACE_LIMIT, "100");
+    properties.setProperty(LOG_FILE_SIZE_LIMIT, "10");
+    properties.setProperty(LOG_LEVEL, "config");
+    properties.setProperty(REMOVE_UNRESPONSIVE_CLIENT, "true");
+    properties.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
+    properties.setProperty(ARCHIVE_DISK_SPACE_LIMIT, "150");
+    properties.setProperty(ARCHIVE_FILE_SIZE_LIMIT, "10");
+    properties.setProperty(DISTRIBUTED_SYSTEM_ID, "0");
+    properties.setProperty(ENABLE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(USE_CLUSTER_CONFIGURATION, "false");
+    properties.setProperty(SERIALIZABLE_OBJECT_FILTER, "benchmark.geode.data.**");
+
     return properties;
   }
 
@@ -48,13 +69,24 @@ public class GeodeProperties {
 
   public static Properties clientProperties() {
     Properties properties = new Properties();
-    properties.setProperty(ConfigurationProperties.ENABLE_TIME_STATISTICS, "true");
-    properties.setProperty(ConfigurationProperties.LOG_LEVEL, "config");
-    properties.setProperty(ConfigurationProperties.STATISTIC_SAMPLING_ENABLED, "true");
-    properties.setProperty(ConfigurationProperties.MEMBER_TIMEOUT, "8000");
-    return properties;
 
+    properties.setProperty(ENABLE_TIME_STATISTICS, "true");
+    properties.setProperty(LOG_LEVEL, "config");
+    properties.setProperty(STATISTIC_SAMPLING_ENABLED, "true");
+    properties.setProperty(MEMBER_TIMEOUT, "8000");
+
+    return properties;
   }
 
 
+  public static Properties withSsl(Properties properties) {
+    properties.setProperty(SSL_ENABLED_COMPONENTS, ALL);
+
+    properties.setProperty(SSL_KEYSTORE, "/home/geode/selfsigned.jks");
+    properties.setProperty(SSL_KEYSTORE_PASSWORD, "123456");
+    properties.setProperty(SSL_TRUSTSTORE, "/home/geode/selfsigned.jks");
+    properties.setProperty(SSL_TRUSTSTORE_PASSWORD, "123456");
+
+    return properties;
+  }
 }
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java
index 5f3fb50..c116938 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClient.java
@@ -17,10 +17,13 @@
 
 package org.apache.geode.benchmark.tasks;
 
+import static org.apache.geode.benchmark.parameters.GeodeProperties.clientProperties;
+import static org.apache.geode.benchmark.parameters.GeodeProperties.withSsl;
+
 import java.io.File;
 import java.net.InetAddress;
+import java.util.Properties;
 
-import org.apache.geode.benchmark.parameters.GeodeProperties;
 import org.apache.geode.cache.client.ClientCache;
 import org.apache.geode.cache.client.ClientCacheFactory;
 import org.apache.geode.distributed.ConfigurationProperties;
@@ -44,8 +47,11 @@ public class StartClient implements Task {
     InetAddress locator = context.getHostsForRole("locator").iterator().next();
 
     String statsFile = new File(context.getOutputDir(), "stats.gfs").getAbsolutePath();
+    String withSslArg = System.getProperty("withSsl");
+    Properties properties = (withSslArg != null)
+        ? withSsl(clientProperties()) : clientProperties();
 
-    ClientCache clientCache = new ClientCacheFactory(GeodeProperties.clientProperties())
+    ClientCache clientCache = new ClientCacheFactory(properties)
         .setPdxSerializer(new ReflectionBasedAutoSerializer("benchmark.geode.data.*"))
         .addPoolLocator(locator.getHostAddress(), locatorPort)
         .setPoolIdleTimeout(-1)
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartLocator.java
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartLocator.java
index c10dfb3..dede5c6 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartLocator.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartLocator.java
@@ -17,11 +17,13 @@
 
 package org.apache.geode.benchmark.tasks;
 
+import static org.apache.geode.benchmark.parameters.GeodeProperties.locatorProperties;
+import static org.apache.geode.benchmark.parameters.GeodeProperties.withSsl;
+
 import java.io.File;
 import java.net.InetAddress;
 import java.util.Properties;
 
-import org.apache.geode.benchmark.parameters.GeodeProperties;
 import org.apache.geode.distributed.ConfigurationProperties;
 import org.apache.geode.distributed.Locator;
 import org.apache.geode.perftest.Task;
@@ -39,7 +41,9 @@ public class StartLocator implements Task {
 
   @Override
   public void run(TestContext context) throws Exception {
-    Properties properties = GeodeProperties.locatorProperties();
+    String withSslArg = System.getProperty("withSsl");
+    Properties properties = (withSslArg != null)
+        ? withSsl(locatorProperties()) : locatorProperties();
 
     String statsFile = new File(context.getOutputDir(), "stats.gfs").getAbsolutePath();
     properties.setProperty(ConfigurationProperties.STATISTIC_ARCHIVE_FILE, statsFile);
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java
index 70437ff..cd50e88 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartServer.java
@@ -17,10 +17,13 @@
 
 package org.apache.geode.benchmark.tasks;
 
+import static org.apache.geode.benchmark.parameters.GeodeProperties.serverProperties;
+import static org.apache.geode.benchmark.parameters.GeodeProperties.withSsl;
+
 import java.io.File;
 import java.net.InetAddress;
+import java.util.Properties;
 
-import org.apache.geode.benchmark.parameters.GeodeProperties;
 import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.cache.server.CacheServer;
@@ -42,10 +45,13 @@ public class StartServer implements Task {
 
   @Override
   public void run(TestContext context) throws Exception {
+    String withSslArg = System.getProperty("withSsl");
+    Properties properties = (withSslArg != null)
+        ? withSsl(serverProperties()) : serverProperties();
 
     String locatorString = LocatorUtil.getLocatorString(context, locatorPort);
     String statsFile = new File(context.getOutputDir(), "stats.gfs").getAbsolutePath();
-    Cache cache = new CacheFactory(GeodeProperties.serverProperties())
+    Cache cache = new CacheFactory(properties)
         .setPdxSerializer(new ReflectionBasedAutoSerializer("benchmark.geode.data.*"))
         .set(ConfigurationProperties.LOCATORS, locatorString)
         .set(ConfigurationProperties.NAME,
diff --git a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java
index 3a30106..95fe97d 100644
--- a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java
+++ b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopology.java
@@ -20,6 +20,8 @@ import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.LOC
 import static org.apache.geode.benchmark.topology.ClientServerTopology.Roles.SERVER;
 
 import org.bouncycastle.util.Arrays;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import org.apache.geode.benchmark.tasks.StartClient;
 import org.apache.geode.benchmark.tasks.StartLocator;
@@ -27,6 +29,7 @@ import org.apache.geode.benchmark.tasks.StartServer;
 import org.apache.geode.perftest.TestConfig;
 
 public class ClientServerTopology {
+  private static final Logger logger = LoggerFactory.getLogger(ClientServerTopology.class);
 
   /**
    * All roles defined for the JVMs created for the benchmark
@@ -45,6 +48,7 @@ public class ClientServerTopology {
   static final int NUM_LOCATORS = 1;
   static final int NUM_SERVERS = 2;
   static final int NUM_CLIENTS = 1;
+  private static final String WITH_SSL_ARGUMENT = "-DwithSsl";
 
   public static void configure(TestConfig testConfig) {
     testConfig.role(LOCATOR, NUM_LOCATORS);
@@ -56,6 +60,14 @@ public class ClientServerTopology {
     testConfig.jvmArgs(LOCATOR, appendIfNotEmpty(JVM_ARGS, profilerArgument));
     testConfig.jvmArgs(SERVER, appendIfNotEmpty(JVM_ARGS, profilerArgument));
 
+    String withSslArg = System.getProperty("withSsl");
+    if (withSslArg != null && withSslArg.equals("true")) {
+      logger.info("Configuring JVMs to run with SSL enabled");
+      testConfig.jvmArgs(CLIENT, Arrays.append(JVM_ARGS, WITH_SSL_ARGUMENT));
+      testConfig.jvmArgs(LOCATOR, Arrays.append(JVM_ARGS, WITH_SSL_ARGUMENT));
+      testConfig.jvmArgs(SERVER, Arrays.append(JVM_ARGS, WITH_SSL_ARGUMENT));
+    }
+
     testConfig.before(new StartLocator(LOCATOR_PORT), LOCATOR);
     testConfig.before(new StartServer(LOCATOR_PORT), SERVER);
     testConfig.before(new StartClient(LOCATOR_PORT), CLIENT);
diff --git a/infrastructure/scripts/aws/README.md b/infrastructure/scripts/aws/README.md
index 48f9e5d..18106ad 100644
--- a/infrastructure/scripts/aws/README.md
+++ b/infrastructure/scripts/aws/README.md
@@ -84,6 +84,8 @@ Options:
     -V|--bgv|--baseline-version|--baseline-geode-version : Geode Baseline Version
     -B|--gbb|--baseline-branch|--baseline-geode-branch   : Geode Baseline Branch (default:
develop)
     -m|--metadata                                        : Test metadata to output to file,
comma-delimited (optional)
+    --ci                                                 : Set when the instances are being
started for use in Continuous Integration
+    --                                                   : All subsequent arguments are passed
to the benchmark tast as arguments
     -h|-?|--help                                         : Help message
 
     e.g. ./run_against_baseline.sh -t test_environment  -v <sha1 of target version>
-V <sha1 of base version>  -R <baseline repo e.g. user/geode> -B <baseline
branch name> -b <target branch name> -r <target repo e.g. user/geode>
@@ -174,4 +176,21 @@ monitor the test.
 ./copy_to_cluster.sh --tag profiling -- /Applications/YourKit-Java-Profiler-2019.1.app/Contents/Resources/bin/linux-x86-64/libyjpagent.so
.
 ./run_tests.sh --tag profiling --geode-branch develop -- -i -Pbenchmark.profiler.argument=-agentpath:/home/geode/libyjpagent.so=disablestacktelemetry,exceptions=disable,delay=60000,sessionname=JVM_ROLE-JVM_ID
 ./destroy_cluster.sh --tag profiling
-```
\ No newline at end of file
+```
+
+# Running with SSL enabled
+
+## Prerequisites
+* You must have fulfilled the prerequisites at the beginning of this doc
+* Generate a self-signed SSL certificate using the keytool command:
+  * `keytool -genkey -keyalg RSA -alias tomcat -keystore selfsigned.jks -validity 365 -keysize
2048`
+  * The keystore password must be `123456`
+* Copy the generated certificate to the AWS VMs using the following command:
+  * `./copy_to_cluster.sh -tag <clusterTag> -- <path to selfsigned.jks> /home/geode/selfsigned.jks`
+  * The destination path must be `/home/geode/selfsigned.jks`
+
+## Running in AWS
+To run benchmarks with SSL enabled, run the test using the `run_tests.sh` script, with the
additional CLI option `-PwithSsl`:
+```
+./run_tests.sh --tag <clusterTag> [other CLI options] -- -PwithSsl
+```
diff --git a/infrastructure/scripts/aws/analyze_tests.sh b/infrastructure/scripts/aws/analyze_tests.sh
index 861ff3d..de7c1af 100755
--- a/infrastructure/scripts/aws/analyze_tests.sh
+++ b/infrastructure/scripts/aws/analyze_tests.sh
@@ -36,7 +36,7 @@ while (( "$#" )); do
       CI=1
       ;;
     -h|--help|-\? )
-      echo "Usage: $(basename "$0") -t tag -c 4 [options ...] [-- arguments ...]"
+      echo "Usage: $(basename "$0") -o <output directory> [options ...] [-- arguments
...]"
       echo "Options:"
       echo "-o|--output|--outputDir : The directory containing benchmark results"
       echo "--ci : Set if starting instances for Continuous Integration"
diff --git a/infrastructure/scripts/aws/run_against_baseline.sh b/infrastructure/scripts/aws/run_against_baseline.sh
index e949d67..f4e54fa 100755
--- a/infrastructure/scripts/aws/run_against_baseline.sh
+++ b/infrastructure/scripts/aws/run_against_baseline.sh
@@ -116,7 +116,7 @@ while (( "$#" )); do
       CI=1
       ;;
     -h|--help|-\? )
-      echo "Usage: $(basename "$0") -t tag [options ...] [-- arguments ...]"
+      echo "Usage: $(basename "$0") -t [tag] [-v [version] | -b [branch]] [-V [baseline version]
| -B [baseline branch]] [--ci] <options...>"
       echo "Options:"
       echo "-t|--tag : Cluster tag"
       echo "-p|--benchmark-repo : Benchmark repo (default: ${DEFAULT_BENCHMARK_REPO})"
@@ -129,6 +129,7 @@ while (( "$#" )); do
       echo "-R|--baseline-geode-repo : Geode baseline repo (default: ${DEFAULT_BASELINE_REPO})"
       echo "-B|--baseline-geode-branch : Geode baseline branch"
       echo "-m|--metadata : Test metadata to output to file, comma-delimited"
+      echo "--ci : Set if starting instances for Continuous Integration"
       echo "-- : All subsequent arguments are passed to the benchmark task as arguments."
       echo "-h|--help|-? : This help message"
       exit 1


Mime
View raw message