Skip to content
Snippets Groups Projects
Commit 83a9a655 authored by Sree Kuchibhotla's avatar Sree Kuchibhotla
Browse files

node wrapper

parent 7a05436a
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# This is a wrapper script that was created to help run_server.py and
# run_client.py to launch 'node js' stress clients and stress servers
source ~/.nvm/nvm.sh
set -ex
$@
......@@ -29,8 +29,8 @@
"templates": {
"cxx_client_asan": {
"baseTemplate": "default",
"stressClientCmd": "/var/local/git/grpc/bins/asan/stress_test",
"metricsClientCmd": "/var/local/git/grpc/bins/asan/metrics_client"
"stressClientCmd": ["/var/local/git/grpc/bins/asan/stress_test"],
"metricsClientCmd": ["/var/local/git/grpc/bins/asan/metrics_client"]
}
}
},
......@@ -48,7 +48,7 @@
"templates": {
"cxx_server_asan": {
"baseTemplate": "default",
"stressServerCmd": "/var/local/git/grpc/bins/asan/interop_server"
"stressServerCmd": ["/var/local/git/grpc/bins/asan/interop_server"]
}
}
},
......
......@@ -27,8 +27,16 @@
"templates": {
"node_client": {
"baseTemplate": "default",
"stressClientCmd": "node /var/local/git/grpc/src/node/stress/stress_client.js",
"metricsClientCmd": "node /var/local/git/grpc/src/node/stress/metrics_client.js"
"stressClientCmd": [
"/var/local/git/grpc/tools/gcp/stress_test/run_node.sh",
"node",
"/var/local/git/grpc/src/node/stress/stress_client.js"
],
"metricsClientCmd": [
"/var/local/git/grpc/tools/gcp/stress_test/run_node.sh",
"node",
"/var/local/git/grpc/src/node/stress/metrics_client.js"
]
}
}
},
......@@ -46,7 +54,11 @@
"templates": {
"node_server": {
"baseTemplate": "default",
"stressServerCmd": "node /var/local/git/grpc/src/node/interop/interop_server.js"
"stressServerCmd": [
"/var/local/git/grpc/tools/gcp/stress_test/run_node.sh",
"node",
"/var/local/git/grpc/src/node/interop/interop_server.js"
]
}
}
},
......@@ -64,7 +76,7 @@
"node-stress-client": {
"clientTemplate": "node_client",
"dockerImage": "grpc_stress_node",
"numInstances": 1,
"numInstances": 2,
"serverPodSpec": "node-stress-server"
}
}
......@@ -73,7 +85,7 @@
"globalSettings": {
"buildDockerImages": false,
"pollIntervalSecs": 10,
"testDurationSecs": 60,
"testDurationSecs": 120,
"kubernetesProxyPort": 8001,
"datasetIdNamePrefix": "stress_test_node",
"summaryTableId": "summary",
......
......@@ -39,18 +39,18 @@
"templates": {
"cxx_client_opt": {
"baseTemplate": "default",
"stressClientCmd": "/var/local/git/grpc/bins/opt/stress_test",
"metricsClientCmd": "/var/local/git/grpc/bins/opt/metrics_client"
"stressClientCmd": ["/var/local/git/grpc/bins/opt/stress_test"],
"metricsClientCmd": ["/var/local/git/grpc/bins/opt/metrics_client"]
},
"cxx_client_tsan": {
"baseTemplate": "default",
"stressClientCmd": "/var/local/git/grpc/bins/tsan/stress_test",
"metricsClientCmd": "/var/local/git/grpc/bins/tsan/metrics_client"
"stressClientCmd": ["/var/local/git/grpc/bins/tsan/stress_test"],
"metricsClientCmd": ["/var/local/git/grpc/bins/tsan/metrics_client"]
},
"cxx_client_asan": {
"baseTemplate": "default",
"stressClientCmd": "/var/local/git/grpc/bins/asan/stress_test",
"metricsClientCmd": "/var/local/git/grpc/bins/asan/metrics_client"
"stressClientCmd": ["/var/local/git/grpc/bins/asan/stress_test"],
"metricsClientCmd": ["/var/local/git/grpc/bins/asan/metrics_client"]
}
}
},
......@@ -68,15 +68,15 @@
"templates": {
"cxx_server_opt": {
"baseTemplate": "default",
"stressServerCmd": "/var/local/git/grpc/bins/opt/interop_server"
"stressServerCmd": ["/var/local/git/grpc/bins/opt/interop_server"]
},
"cxx_server_tsan": {
"baseTemplate": "default",
"stressServerCmd": "/var/local/git/grpc/bins/tsan/interop_server"
"stressServerCmd": ["/var/local/git/grpc/bins/tsan/interop_server"]
},
"cxx_server_asan": {
"baseTemplate": "default",
"stressServerCmd": "/var/local/git/grpc/bins/asan/interop_server"
"stressServerCmd": ["/var/local/git/grpc/bins/asan/interop_server"]
}
}
},
......
......@@ -29,8 +29,8 @@
"templates": {
"cxx_client_opt": {
"baseTemplate": "default",
"stressClientCmd": "/var/local/git/grpc/bins/opt/stress_test",
"metricsClientCmd": "/var/local/git/grpc/bins/opt/metrics_client"
"stressClientCmd": ["/var/local/git/grpc/bins/opt/stress_test"],
"metricsClientCmd": ["/var/local/git/grpc/bins/opt/metrics_client"]
}
}
},
......@@ -48,7 +48,7 @@
"templates": {
"cxx_server_opt": {
"baseTemplate": "default",
"stressServerCmd": "/var/local/git/grpc/bins/opt/interop_server"
"stressServerCmd": ["/var/local/git/grpc/bins/opt/interop_server"]
}
}
},
......
......@@ -29,8 +29,8 @@
"templates": {
"cxx_client_tsan": {
"baseTemplate": "default",
"stressClientCmd": "/var/local/git/grpc/bins/tsan/stress_test",
"metricsClientCmd": "/var/local/git/grpc/bins/tsan/metrics_client"
"stressClientCmd": ["/var/local/git/grpc/bins/tsan/stress_test"],
"metricsClientCmd": ["/var/local/git/grpc/bins/tsan/metrics_client"]
}
}
},
......@@ -48,7 +48,7 @@
"templates": {
"cxx_server_tsan": {
"baseTemplate": "default",
"stressServerCmd": "/var/local/git/grpc/bins/tsan/interop_server"
"stressServerCmd": ["/var/local/git/grpc/bins/tsan/interop_server"]
}
}
},
......
......@@ -67,9 +67,9 @@ class GlobalSettings:
class ClientTemplate:
""" Contains all the common settings that are used by a stress client """
def __init__(self, name, stress_client_cmd, metrics_client_cmd,
metrics_port, wrapper_script_path, poll_interval_secs,
client_args_dict, metrics_args_dict):
def __init__(self, name, stress_client_cmd, metrics_client_cmd, metrics_port,
wrapper_script_path, poll_interval_secs, client_args_dict,
metrics_args_dict):
self.name = name
self.stress_client_cmd = stress_client_cmd
self.metrics_client_cmd = metrics_client_cmd
......@@ -285,8 +285,7 @@ class Gke:
'STRESS_TEST_CMD': client_pod_spec.template.stress_client_cmd,
'STRESS_TEST_ARGS_STR': self._args_dict_to_str(
client_pod_spec.get_client_args_dict()),
'METRICS_CLIENT_CMD':
client_pod_spec.template.metrics_client_cmd,
'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)
......@@ -416,11 +415,13 @@ class Config:
temp_dict.update(templates_dict[template_name])
# Create and add ClientTemplate object to the final client_templates_dict
stress_client_cmd = ' '.join(temp_dict['stressClientCmd'])
metrics_client_cmd = ' '.join(temp_dict['metricsClientCmd'])
client_templates_dict[template_name] = ClientTemplate(
template_name, temp_dict['stressClientCmd'],
temp_dict['metricsClientCmd'], temp_dict['metricsPort'],
temp_dict['wrapperScriptPath'], temp_dict['pollIntervalSecs'],
temp_dict['clientArgs'].copy(), temp_dict['metricsArgs'].copy())
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())
return client_templates_dict
......@@ -452,10 +453,10 @@ class Config:
temp_dict.update(templates_dict[template_name])
# Create and add ServerTemplate object to the final server_templates_dict
stress_server_cmd = ' '.join(temp_dict['stressServerCmd'])
server_templates_dict[template_name] = ServerTemplate(
template_name, temp_dict['stressServerCmd'],
temp_dict['wrapperScriptPath'], temp_dict['serverPort'],
temp_dict['serverArgs'].copy())
template_name, stress_server_cmd, temp_dict['wrapperScriptPath'],
temp_dict['serverPort'], temp_dict['serverArgs'].copy())
return server_templates_dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment