This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/sni by this push:
     new 78c3fbb  added StartClientSNI task; added default Gradle dependency on 
dev version of Geode
78c3fbb is described below

commit 78c3fbb8785a413be4e8ff162f8d28adc10ffeb4
Author: Bill Burcham <bburc...@pivotal.io>
AuthorDate: Thu May 21 15:59:03 2020 -0700

    added StartClientSNI task; added default Gradle dependency on dev version 
of Geode
---
 README.md                                          |  6 ++--
 geode-benchmarks/build.gradle                      | 17 +++++++++--
 .../apache/geode/benchmark/tasks/StartClient.java  | 29 +++++++++++++++----
 .../geode/benchmark/tasks/StartClientSNI.java      | 33 ++++++++++++++++++++++
 .../topology/ClientServerTopologyWithSNIProxy.java |  7 +++--
 harness/build.gradle                               | 17 +++++++++--
 6 files changed, 93 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index 49d0090..9e53cb6 100644
--- a/README.md
+++ b/README.md
@@ -162,14 +162,12 @@ Also we have to provide `-DwithSsl=true` for an SNI test 
even though no SNI test
 * ~~verify `StartSniProxy` runs on proxy node~~
 * ~~don't require operator to supply `-PwithSSL`/`-DwithSSL=true` when running 
SNI tests~~
 * ~~generate `haproxy.cfg` with client-visible SNI hostnames~~
-* make Geode clients use SNI proxy
-    * add `--hostname-for-clients` option in locator and server startup
-    * turn on SNI in `StartClient` task via `setPoolSocketFactory` 
+* ~~turn on SNI via `setPoolSocketFactory` in a new `StartClientSNI` task~~ 
 * make topology orthogonal to tests so all tests can run with SNI; have a 
`-Psni`/`-Dsni` flag
 * fix borken `PartitionedPutBenchmarkSNITest`: 
`DefineHostNamingsOffPlatformTask` breaks when running multiple roles on a 
single host
 
 ## TODO (General)
+* move Geode keystore/truststore setting out of `harness` module and up into 
`geode-benchmarks` i.e. set 'em in properties sent to 
`Locator.startLocatorAndDS` in `StartLocator`, `StartServer` and eliminate 
`harness` module dependency on Geode entirely
 * generate 2048-bit keys (instead of 1024-bit ones) for TLS; will slow TLS 
handshakes which may necessitate a new baseline
-* move Geode keystore/truststore setting out of `harness` module and up into 
`geode-benchmarks` i.e. set 'em in properties sent to 
`Locator.startLocatorAndDS` in `StartLocator`, `StartServer`
 * `./run_tests.sh` often seems to hang after benchmarks have completed, 
requiring operator to enter ^C to un-stick it
 * make `rsync:` Git "scheme" work in `run_tests.sh` script for benchmark repo 
(not just for geode repo)
diff --git a/geode-benchmarks/build.gradle b/geode-benchmarks/build.gradle
index 4078ada..3e58e2c 100644
--- a/geode-benchmarks/build.gradle
+++ b/geode-benchmarks/build.gradle
@@ -23,7 +23,7 @@ version '1.0-SNAPSHOT'
 sourceCompatibility = 1.8
 
 def outputDir = project.hasProperty('outputDir') ? 
project.findProperty('outputDir') : new File(project.buildDir, "benchmarks_" + 
getDate()).getAbsolutePath()
-def geodeVersion = project.hasProperty('geodeVersion') ? 
project.findProperty('geodeVersion') : '1.+'
+def geodeVersion = project.hasProperty('geodeVersion') ? 
project.findProperty('geodeVersion') : '1.13.+'
 
 def getDate() {
   new Date().format('yyyyMMddHHmmss')
@@ -31,8 +31,21 @@ def getDate() {
 
 
 repositories {
+  // in CI we want to search mavenLocal for geode
   mavenLocal()
-  mavenCentral()
+  // non-geode stuff can come from mavenCentral
+  mavenCentral() {
+    content {
+      excludeGroup 'org.apache.geode'
+    }
+  }
+  // when developing this project, use Geode develop branch snapshot
+  maven {
+    url "https://maven.apachegeode-ci.info/snapshots";
+    content {
+      includeGroup 'org.apache.geode'
+    }
+  }
 }
 
 dependencies {
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 9543f4c..d6bc687 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
@@ -49,13 +49,32 @@ public class StartClient implements Task {
     String statsFile = new File(context.getOutputDir(), 
"stats.gfs").getAbsolutePath();
     Properties properties = clientProperties();
 
-    ClientCache clientCache = new ClientCacheFactory(properties)
-        .setPdxSerializer(new 
ReflectionBasedAutoSerializer("benchmark.geode.data.*"))
-        .addPoolLocator(locator.getHostAddress(), locatorPort)
-        .setPoolIdleTimeout(-1)
-        .set(ConfigurationProperties.STATISTIC_ARCHIVE_FILE, statsFile)
+    ClientCache clientCache = createClientCacheFactory(locator, statsFile, 
properties, context)
         .create();
 
     context.setAttribute("CLIENT_CACHE", clientCache);
   }
+
+  /**
+   * Create and configure the ClientCacheFactory.
+   *
+   * Subclasses can override this. They return the result from calling super 
(or calling
+   * builder methods on the result from calling super)
+   *
+   * @param locator
+   * @param statsFile
+   * @param properties
+   * @param context
+   * @return
+   */
+  protected ClientCacheFactory createClientCacheFactory(final InetAddress 
locator,
+                                                        final String statsFile,
+                                                        final Properties 
properties,
+                                                        final TestContext 
context) {
+    return new ClientCacheFactory(properties)
+        .setPdxSerializer(new 
ReflectionBasedAutoSerializer("benchmark.geode.data.*"))
+        .addPoolLocator(locator.getHostAddress(), locatorPort)
+        .setPoolIdleTimeout(-1)
+        .set(ConfigurationProperties.STATISTIC_ARCHIVE_FILE, statsFile);
+  }
 }
diff --git 
a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClientSNI.java
 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClientSNI.java
new file mode 100644
index 0000000..4f1ab02
--- /dev/null
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/tasks/StartClientSNI.java
@@ -0,0 +1,33 @@
+package org.apache.geode.benchmark.tasks;
+
+import static org.apache.geode.benchmark.topology.Roles.PROXY;
+
+import java.net.InetAddress;
+import java.util.Properties;
+
+import org.apache.geode.cache.client.ClientCacheFactory;
+import org.apache.geode.cache.client.proxy.ProxySocketFactories;
+import org.apache.geode.perftest.TestContext;
+
+public class StartClientSNI extends StartClient {
+  public static final int SNI_PROXY_PORT = 15443;
+
+  public StartClientSNI(final int locatorPort) {
+    super(locatorPort);
+  }
+
+  @Override
+  protected ClientCacheFactory createClientCacheFactory(final InetAddress 
locator,
+                                                        final String statsFile,
+                                                        final Properties 
properties,
+                                                        final TestContext 
context) {
+
+    final InetAddress proxyAddy = 
context.getHostsForRole(PROXY.name()).iterator().next();
+
+    return super.createClientCacheFactory(locator, statsFile, properties, 
context)
+        .setPoolSocketFactory(ProxySocketFactories.sni(
+            proxyAddy.getHostName(),
+            SNI_PROXY_PORT));
+  }
+
+}
diff --git 
a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
index 4a448c8..302a44e 100644
--- 
a/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
+++ 
b/geode-benchmarks/src/main/java/org/apache/geode/benchmark/topology/ClientServerTopologyWithSNIProxy.java
@@ -33,6 +33,7 @@ import org.apache.geode.benchmark.parameters.JvmParameters;
 import org.apache.geode.benchmark.parameters.ProfilerParameters;
 import org.apache.geode.benchmark.tasks.DefineHostNamingsOffPlatformTask;
 import org.apache.geode.benchmark.tasks.StartClient;
+import org.apache.geode.benchmark.tasks.StartClientSNI;
 import org.apache.geode.benchmark.tasks.StartLocator;
 import org.apache.geode.benchmark.tasks.StartServer;
 import org.apache.geode.benchmark.tasks.StartSniProxy;
@@ -70,12 +71,12 @@ public class ClientServerTopologyWithSNIProxy {
 
     before(config, new StartServer(LOCATOR_PORT), SERVER);
 
-    before(config, new DefineHostNamingsOffPlatformTask(), CLIENT);
-    before(config, new StartClient(LOCATOR_PORT), CLIENT);
-
     before(config, new DefineHostNamingsOffPlatformTask(), PROXY);
     before(config, new StartSniProxy(LOCATOR_PORT), PROXY);
 
+    before(config, new DefineHostNamingsOffPlatformTask(), CLIENT);
+    before(config, new StartClientSNI(LOCATOR_PORT), CLIENT);
+
     after(config, new StopSniProxy(), PROXY);
   }
 
diff --git a/harness/build.gradle b/harness/build.gradle
index 7ee2951..287c24f 100644
--- a/harness/build.gradle
+++ b/harness/build.gradle
@@ -22,12 +22,25 @@ version '1.0-SNAPSHOT'
 
 sourceCompatibility = 1.8
 
-def geodeVersion = project.hasProperty('geodeVersion') ? 
project.findProperty('geodeVersion') : '1.+'
+def geodeVersion = project.hasProperty('geodeVersion') ? 
project.findProperty('geodeVersion') : '1.13.+'
 def isCI = project.hasProperty('ci') ? project.findProperty('ci') : 0
 
 repositories {
+  // in CI we want to search mavenLocal for geode
   mavenLocal()
-  mavenCentral()
+  // non-geode stuff can come from mavenCentral
+  mavenCentral() {
+    content {
+      excludeGroup 'org.apache.geode'
+    }
+  }
+  // when developing this project, use Geode develop branch snapshot
+  maven {
+    url "https://maven.apachegeode-ci.info/snapshots";
+    content {
+      includeGroup 'org.apache.geode'
+    }
+  }
 }
 
 task(analyzeRun, dependsOn: 'classes', type: JavaExec) {

Reply via email to