aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-05-06 15:31:22 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2016-05-06 15:31:22 -0700
commit3a4b903bf0554051d4a6523d3d252773c1c80495 (patch)
tree696c23f2c4a476af1ce86a720b868681d7d83a9a /tools/run_tests
parentc916c1ce17fe273dff881e1c87e17ad991c2078a (diff)
parente6d03b828da478a7b4205c422bd95aa21f8270d4 (diff)
Merge pull request #6419 from sreecha/python_stress_test_docker
Python stress test docker config files and related changes
Diffstat (limited to 'tools/run_tests')
-rw-r--r--tools/run_tests/stress_test/configs/csharp.json2
-rw-r--r--tools/run_tests/stress_test/configs/python.json98
-rwxr-xr-xtools/run_tests/stress_test/run_on_gke.py13
3 files changed, 108 insertions, 5 deletions
diff --git a/tools/run_tests/stress_test/configs/csharp.json b/tools/run_tests/stress_test/configs/csharp.json
index 406949557d..587e1552b9 100644
--- a/tools/run_tests/stress_test/configs/csharp.json
+++ b/tools/run_tests/stress_test/configs/csharp.json
@@ -80,7 +80,7 @@
"buildDockerImages": true,
"pollIntervalSecs": 60,
"testDurationSecs": 7200,
- "kubernetesProxyPort": 8001,
+ "kubernetesProxyPort": 8009,
"datasetIdNamePrefix": "stress_test_csharp",
"summaryTableId": "summary",
"qpsTableId": "qps",
diff --git a/tools/run_tests/stress_test/configs/python.json b/tools/run_tests/stress_test/configs/python.json
new file mode 100644
index 0000000000..4f85de1d5f
--- /dev/null
+++ b/tools/run_tests/stress_test/configs/python.json
@@ -0,0 +1,98 @@
+{
+ "dockerImages": {
+ "grpc_stress_python" : {
+ "buildScript": "tools/run_tests/dockerize/build_interop_stress_image.sh",
+ "dockerFileDir": "grpc_interop_stress_python"
+ }
+ },
+
+ "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"
+ },
+ "env": {
+ "PYTHONPATH": "/var/local/git/grpc/src/python/gens:/var/local/git/grpc/src/python/grpcio",
+ "LD_LIBRARY_PATH":"/var/local/git/grpc/libs/opt"
+ }
+ }
+ },
+ "templates": {
+ "python_client": {
+ "baseTemplate": "default",
+ "stressClientCmd": [
+ "python",
+ "/var/local/git/grpc/src/python/grpcio/tests/stress/client.py"
+ ],
+ "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
+ },
+ "env": {
+ "PYTHONPATH": "/var/local/git/grpc/src/python/gens:/var/local/git/grpc/src/python/grpcio",
+ "LD_LIBRARY_PATH":"/var/local/git/grpc/libs/opt"
+ }
+ }
+ },
+ "templates": {
+ "python_server": {
+ "baseTemplate": "default",
+ "stressServerCmd": [
+ "python",
+ "/var/local/git/grpc/src/python/grpcio/tests/interop/server.py"
+ ]
+ }
+ }
+ },
+
+ "testMatrix": {
+ "serverPodSpecs": {
+ "python-stress-server": {
+ "serverTemplate": "python_server",
+ "dockerImage": "grpc_stress_python",
+ "numInstances": 1
+ }
+ },
+
+ "clientPodSpecs": {
+ "python-stress-client": {
+ "clientTemplate": "python_client",
+ "dockerImage": "grpc_stress_python",
+ "numInstances": 5,
+ "serverPodSpec": "python-stress-server"
+ }
+ }
+ },
+
+ "globalSettings": {
+ "buildDockerImages": true,
+ "pollIntervalSecs": 60,
+ "testDurationSecs": 7200,
+ "kubernetesProxyPort": 8011,
+ "datasetIdNamePrefix": "stress_test_python",
+ "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 d4f1c4ad3d..583e58316f 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, will_run_forever):
+ metrics_args_dict, will_run_forever, env_dict):
self.name = name
self.stress_client_cmd = stress_client_cmd
self.metrics_client_cmd = metrics_client_cmd
@@ -79,19 +79,21 @@ class ClientTemplate:
self.client_args_dict = client_args_dict
self.metrics_args_dict = metrics_args_dict
self.will_run_forever = will_run_forever
+ self.env_dict = env_dict
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, will_run_forever):
+ server_args_dict, will_run_forever, env_dict):
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
+ self.env_dict = env_dict
class DockerImage:
@@ -240,6 +242,7 @@ class Gke:
# server_pod_spec.template.wrapper_script_path) are are injected into the
# container via environment variables
server_env = self.gke_env.copy()
+ server_env.update(server_pod_spec.template.env_dict)
server_env.update({
'STRESS_TEST_IMAGE_TYPE': 'SERVER',
'STRESS_TEST_CMD': server_pod_spec.template.server_cmd,
@@ -283,6 +286,7 @@ class Gke:
# client_pod_spec.template.wrapper_script_path) are are injected into the
# container via environment variables
client_env = self.gke_env.copy()
+ client_env.update(client_pod_spec.template.env_dict)
client_env.update({
'STRESS_TEST_IMAGE_TYPE': 'CLIENT',
'STRESS_TEST_CMD': client_pod_spec.template.stress_client_cmd,
@@ -425,7 +429,8 @@ 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.get('willRunForever', 1))
+ temp_dict['metricsArgs'].copy(), temp_dict.get('willRunForever', 1),
+ temp_dict.get('env', {}).copy())
return client_templates_dict
@@ -461,7 +466,7 @@ class Config:
server_templates_dict[template_name] = ServerTemplate(
template_name, stress_server_cmd, temp_dict['wrapperScriptPath'],
temp_dict['serverPort'], temp_dict['serverArgs'].copy(),
- temp_dict.get('willRunForever', 1))
+ temp_dict.get('willRunForever', 1), temp_dict.get('env', {}).copy())
return server_templates_dict