Merge pull request #15175 from murgatroid99/node_perf_tests_again

Add Node perf tests for both implementations
pull/16372/head
Michael Lumish 6 years ago committed by GitHub
commit 44f1270649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      tools/internal_ci/linux/grpc_full_performance_master.sh
  2. 3
      tools/run_tests/performance/build_performance.sh
  3. 28
      tools/run_tests/performance/build_performance_node.sh
  4. 32
      tools/run_tests/performance/run_worker_node.sh
  5. 102
      tools/run_tests/performance/scenario_config.py
  6. 6
      tools/run_tests/run_performance_tests.py

@ -21,7 +21,7 @@ source tools/internal_ci/helper_scripts/prepare_build_linux_perf_multilang_rc
# run 8core client vs 8core server
tools/run_tests/run_performance_tests.py \
-l c++ csharp ruby java python go php7 php7_protobuf_c \
-l c++ csharp ruby java python go php7 php7_protobuf_c node node_purejs \
--netperf \
--category scalable \
--remote_worker_host grpc-kokoro-performance-server-8core grpc-kokoro-performance-client-8core grpc-kokoro-performance-client2-8core \

@ -55,6 +55,9 @@ do
"csharp")
python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8 --compiler coreclr
;;
"node"|"node_purejs")
tools/run_tests/performance/build_performance_node.sh
;;
*)
python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8
;;

@ -0,0 +1,28 @@
#!/bin/bash
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set +ex
. "$HOME/.nvm/nvm.sh"
nvm install 10
set -ex
cd "$(dirname "$0")/../../../../grpc-node"
npm install
./node_modules/.bin/gulp setup

@ -0,0 +1,32 @@
#!/bin/bash
# Copyright 2018 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
. "$HOME/.nvm/nvm.sh"
nvm use 10
set -ex
fixture=$1
shift
# Enter repo root
cd "$(dirname "$0")/../../.."
# Enter the grpc-node repo root (expected to be next to grpc repo root)
cd ../grpc-node
node -r "./test/fixtures/$fixture" test/performance/worker.js "$@"

@ -1151,6 +1151,106 @@ class GoLanguage:
return 'go'
class NodeLanguage:
def __init__(self, node_purejs=False):
pass
self.node_purejs = node_purejs
self.safename = str(self)
def worker_cmdline(self):
fixture = 'native_js' if self.node_purejs else 'native_native'
return [
'tools/run_tests/performance/run_worker_node.sh', fixture,
'--benchmark_impl=grpc'
]
def worker_port_offset(self):
if self.node_purejs:
return 1100
return 1000
def scenarios(self):
node_implementation = 'node_purejs' if self.node_purejs else 'node'
for secure in [True, False]:
secstr = 'secure' if secure else 'insecure'
smoketest_categories = ([SMOKETEST] if secure else []) + [SCALABLE]
yield _ping_pong_scenario(
'%s_to_node_generic_async_streaming_ping_pong_%s' %
(node_implementation, secstr),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_GENERIC_SERVER',
server_language='node',
use_generic_payload=True,
async_server_threads=1,
secure=secure,
categories=smoketest_categories)
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_streaming_ping_pong_%s' %
(node_implementation, secstr),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
async_server_threads=1,
secure=secure)
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_unary_ping_pong_%s' %
(node_implementation, secstr),
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
async_server_threads=1,
secure=secure,
categories=smoketest_categories)
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_unary_qps_unconstrained_%s' %
(node_implementation, secstr),
rpc_type='UNARY',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
unconstrained_client='async',
secure=secure,
categories=smoketest_categories + [SCALABLE])
yield _ping_pong_scenario(
'%s_to_node_protobuf_async_streaming_qps_unconstrained_%s' %
(node_implementation, secstr),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_SERVER',
server_language='node',
unconstrained_client='async',
secure=secure,
categories=[SCALABLE])
yield _ping_pong_scenario(
'%s_to_node_generic_async_streaming_qps_unconstrained_%s' %
(node_implementation, secstr),
rpc_type='STREAMING',
client_type='ASYNC_CLIENT',
server_type='ASYNC_GENERIC_SERVER',
server_language='node',
unconstrained_client='async',
use_generic_payload=True,
secure=secure,
categories=[SCALABLE])
# TODO(murgatroid99): add scenarios node vs C++
def __str__(self):
if self.node_purejs:
return 'node_purejs'
return 'node'
LANGUAGES = {
'c++': CXXLanguage(),
'csharp': CSharpLanguage(),
@ -1160,4 +1260,6 @@ LANGUAGES = {
'java': JavaLanguage(),
'python': PythonLanguage(),
'go': GoLanguage(),
'node': NodeLanguage(),
'node_purejs': NodeLanguage(node_purejs=True)
}

@ -200,6 +200,8 @@ def archive_repo(languages):
cmdline.append('../grpc-java')
if 'go' in languages:
cmdline.append('../grpc-go')
if 'node' in languages or 'node_purejs' in languages:
cmdline.append('../grpc-node')
archive_job = jobset.JobSpec(
cmdline=cmdline, shortname='archive_repo', timeout_seconds=3 * 60)
@ -253,9 +255,9 @@ def build_on_remote_hosts(hosts,
languages=scenario_config.LANGUAGES.keys(),
build_local=False):
"""Builds performance worker on remote hosts (and maybe also locally)."""
build_timeout = 15 * 60
build_timeout = 45 * 60
# Kokoro VMs (which are local only) do not have caching, so they need more time to build
local_build_timeout = 30 * 60
local_build_timeout = 60 * 60
build_jobs = []
for host in hosts:
user_at_host = '%s@%s' % (_REMOTE_HOST_USERNAME, host)

Loading…
Cancel
Save