aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/stress_test
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tests/stress_test')
-rw-r--r--tools/run_tests/stress_test/configs/go.json96
-rw-r--r--tools/run_tests/stress_test/configs/java.json91
-rwxr-xr-xtools/run_tests/stress_test/run_on_gke.py17
3 files changed, 198 insertions, 6 deletions
diff --git a/tools/run_tests/stress_test/configs/go.json b/tools/run_tests/stress_test/configs/go.json
new file mode 100644
index 0000000000..36b465e763
--- /dev/null
+++ b/tools/run_tests/stress_test/configs/go.json
@@ -0,0 +1,96 @@
+{
+ "dockerImages": {
+ "grpc_stress_go" : {
+ "buildScript": "tools/jenkins/build_interop_stress_image.sh",
+ "dockerFileDir": "grpc_interop_stress_go"
+ }
+ },
+
+ "clientTemplates": {
+ "baseTemplates": {
+ "default": {
+ "wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_client.py",
+ "pollIntervalSecs": 60,
+ "clientArgs": {
+ "num_channels_per_server":5,
+ "num_stubs_per_channel":10,
+ "test_cases": "empty_unary:1,large_unary:1,client_streaming:1,server_streaming:1,empty_stream:1",
+ "metrics_port": 8081
+ },
+ "metricsPort": 8081,
+ "metricsArgs": {
+ "metrics_server_address": "localhost:8081",
+ "total_only": "true"
+ }
+ }
+ },
+ "templates": {
+ "go_client": {
+ "baseTemplate": "default",
+ "stressClientCmd": [
+ "go",
+ "run",
+ "/go/src/google.golang.org/grpc/stress/client/main.go"
+ ],
+ "metricsClientCmd": [
+ "go",
+ "run",
+ "/go/src/google.golang.org/grpc/stress/metrics_client/main.go"
+ ]
+ }
+ }
+ },
+
+ "serverTemplates": {
+ "baseTemplates":{
+ "default": {
+ "wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_server.py",
+ "serverPort": 8080,
+ "serverArgs": {
+ "port": 8080
+ }
+ }
+ },
+ "templates": {
+ "go_server": {
+ "baseTemplate": "default",
+ "stressServerCmd": [
+ "go",
+ "run",
+ "/go/src/google.golang.org/grpc/interop/server/server.go"
+ ]
+ }
+ }
+ },
+
+ "testMatrix": {
+ "serverPodSpecs": {
+ "go-stress-server": {
+ "serverTemplate": "go_server",
+ "dockerImage": "grpc_stress_go",
+ "numInstances": 1
+ }
+ },
+
+ "clientPodSpecs": {
+ "go-stress-client": {
+ "clientTemplate": "go_client",
+ "dockerImage": "grpc_stress_go",
+ "numInstances": 15,
+ "serverPodSpec": "go-stress-server"
+ }
+ }
+ },
+
+ "globalSettings": {
+ "buildDockerImages": true,
+ "pollIntervalSecs": 60,
+ "testDurationSecs": 7200,
+ "kubernetesProxyPort": 8007,
+ "datasetIdNamePrefix": "stress_test_go",
+ "summaryTableId": "summary",
+ "qpsTableId": "qps",
+ "podWarmupSecs": 60
+ }
+}
+
diff --git a/tools/run_tests/stress_test/configs/java.json b/tools/run_tests/stress_test/configs/java.json
new file mode 100644
index 0000000000..275384c066
--- /dev/null
+++ b/tools/run_tests/stress_test/configs/java.json
@@ -0,0 +1,91 @@
+{
+ "dockerImages": {
+ "grpc_stress_java" : {
+ "buildScript": "tools/jenkins/build_interop_stress_image.sh",
+ "dockerFileDir": "grpc_interop_stress_java"
+ }
+ },
+
+ "clientTemplates": {
+ "baseTemplates": {
+ "default": {
+ "wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_client.py",
+ "pollIntervalSecs": 60,
+ "clientArgs": {
+ "num_channels_per_server":5,
+ "num_stubs_per_channel":10,
+ "test_cases": "empty_unary:1,large_unary:1,client_streaming:1,server_streaming:1,empty_stream:1",
+ "metrics_port": 8081
+ },
+ "metricsPort": 8081,
+ "metricsArgs": {
+ "metrics_server_address": "localhost:8081",
+ "total_only": "true"
+ }
+ }
+ },
+ "templates": {
+ "java_client": {
+ "baseTemplate": "default",
+ "stressClientCmd": [
+ "/var/local/git/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/stresstest-client"
+ ],
+ "metricsClientCmd": [
+ "/var/local/git/grpc/bins/opt/metrics_client"
+ ]
+ }
+ }
+ },
+
+ "serverTemplates": {
+ "baseTemplates":{
+ "default": {
+ "wrapperScriptPath": "/var/local/git/grpc/tools/gcp/stress_test/run_server.py",
+ "serverPort": 8080,
+ "serverArgs": {
+ "port": 8080,
+ "use_tls": "false"
+ }
+ }
+ },
+ "templates": {
+ "java_server": {
+ "baseTemplate": "default",
+ "stressServerCmd": [
+ "/var/local/git/grpc-java/interop-testing/build/install/grpc-interop-testing/bin/test-server"
+ ]
+ }
+ }
+ },
+
+ "testMatrix": {
+ "serverPodSpecs": {
+ "java-stress-server": {
+ "serverTemplate": "java_server",
+ "dockerImage": "grpc_stress_java",
+ "numInstances": 1
+ }
+ },
+
+ "clientPodSpecs": {
+ "java-stress-client": {
+ "clientTemplate": "java_client",
+ "dockerImage": "grpc_stress_java",
+ "numInstances": 10,
+ "serverPodSpec": "java-stress-server"
+ }
+ }
+ },
+
+ "globalSettings": {
+ "buildDockerImages": true,
+ "pollIntervalSecs": 60,
+ "testDurationSecs": 7200,
+ "kubernetesProxyPort": 8008,
+ "datasetIdNamePrefix": "stress_test_java",
+ "summaryTableId": "summary",
+ "qpsTableId": "qps",
+ "podWarmupSecs": 60
+ }
+}
+
diff --git a/tools/run_tests/stress_test/run_on_gke.py b/tools/run_tests/stress_test/run_on_gke.py
index 916c890cbd..d4f1c4ad3d 100755
--- a/tools/run_tests/stress_test/run_on_gke.py
+++ b/tools/run_tests/stress_test/run_on_gke.py
@@ -69,7 +69,7 @@ class ClientTemplate:
def __init__(self, name, stress_client_cmd, metrics_client_cmd, metrics_port,
wrapper_script_path, poll_interval_secs, client_args_dict,
- metrics_args_dict):
+ metrics_args_dict, will_run_forever):
self.name = name
self.stress_client_cmd = stress_client_cmd
self.metrics_client_cmd = metrics_client_cmd
@@ -78,18 +78,20 @@ class ClientTemplate:
self.poll_interval_secs = poll_interval_secs
self.client_args_dict = client_args_dict
self.metrics_args_dict = metrics_args_dict
+ self.will_run_forever = will_run_forever
class ServerTemplate:
""" Contains all the common settings used by a stress server """
def __init__(self, name, server_cmd, wrapper_script_path, server_port,
- server_args_dict):
+ server_args_dict, will_run_forever):
self.name = name
self.server_cmd = server_cmd
self.wrapper_script_path = wrapper_script_path
self.server_port = server_port
self.server_args_dict = server_args_dict
+ self.will_run_forever = will_run_forever
class DockerImage:
@@ -242,7 +244,8 @@ class Gke:
'STRESS_TEST_IMAGE_TYPE': 'SERVER',
'STRESS_TEST_CMD': server_pod_spec.template.server_cmd,
'STRESS_TEST_ARGS_STR': self._args_dict_to_str(
- server_pod_spec.template.server_args_dict)
+ server_pod_spec.template.server_args_dict),
+ 'WILL_RUN_FOREVER': str(server_pod_spec.template.will_run_forever)
})
for pod_name in server_pod_spec.pod_names():
@@ -288,7 +291,8 @@ class Gke:
'METRICS_CLIENT_CMD': client_pod_spec.template.metrics_client_cmd,
'METRICS_CLIENT_ARGS_STR': self._args_dict_to_str(
client_pod_spec.template.metrics_args_dict),
- 'POLL_INTERVAL_SECS': str(client_pod_spec.template.poll_interval_secs)
+ 'POLL_INTERVAL_SECS': str(client_pod_spec.template.poll_interval_secs),
+ 'WILL_RUN_FOREVER': str(client_pod_spec.template.will_run_forever)
})
for pod_name in client_pod_spec.pod_names():
@@ -421,7 +425,7 @@ class Config:
template_name, stress_client_cmd, metrics_client_cmd,
temp_dict['metricsPort'], temp_dict['wrapperScriptPath'],
temp_dict['pollIntervalSecs'], temp_dict['clientArgs'].copy(),
- temp_dict['metricsArgs'].copy())
+ temp_dict['metricsArgs'].copy(), temp_dict.get('willRunForever', 1))
return client_templates_dict
@@ -456,7 +460,8 @@ class Config:
stress_server_cmd = ' '.join(temp_dict['stressServerCmd'])
server_templates_dict[template_name] = ServerTemplate(
template_name, stress_server_cmd, temp_dict['wrapperScriptPath'],
- temp_dict['serverPort'], temp_dict['serverArgs'].copy())
+ temp_dict['serverPort'], temp_dict['serverArgs'].copy(),
+ temp_dict.get('willRunForever', 1))
return server_templates_dict