diff options
author | Craig Tiller <ctiller@google.com> | 2016-05-22 12:19:57 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-05-22 12:19:57 -0700 |
commit | da2d619cf4d35a7e41da0faf7fb4961c34d93ae6 (patch) | |
tree | 06f52b4285468e781740d657003f443b42af708d /tools | |
parent | 2477c3cb89eb1a06e1284a7d4e14380b2d9d9e4a (diff) | |
parent | f96711dccc575ba52855ecebdd6a7df726a4075c (diff) |
Merge github.com:grpc/grpc into error
Diffstat (limited to 'tools')
-rw-r--r-- | tools/README.md | 2 | ||||
-rwxr-xr-x | tools/jenkins/run_full_performance.sh | 56 | ||||
-rw-r--r-- | tools/run_tests/README.md | 52 | ||||
-rw-r--r-- | tools/run_tests/performance/scenario_config.py | 44 | ||||
-rwxr-xr-x | tools/run_tests/run_performance_tests.py | 3 | ||||
-rwxr-xr-x | tools/run_tests/run_tests.py | 2 |
6 files changed, 138 insertions, 21 deletions
diff --git a/tools/README.md b/tools/README.md index cb6c22dd83..d142d4aee2 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,6 +1,6 @@ buildgen: Template renderer for our build system. -distrib: Scripts to distribute language-specific packages. +distrib: Scripts to distribute language-specific packages and other distribution-related helper scripts. dockerfile: Docker files to test gRPC. diff --git a/tools/jenkins/run_full_performance.sh b/tools/jenkins/run_full_performance.sh new file mode 100755 index 0000000000..bb1f79ff2c --- /dev/null +++ b/tools/jenkins/run_full_performance.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env 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 script is invoked by Jenkins and runs full performance test suite. +set -ex + +# Enter the gRPC repo root +cd $(dirname $0)/../.. + +# run 8core client vs 8core server +tools/run_tests/run_performance_tests.py \ + -l c++ csharp node ruby java python go \ + --netperf \ + --category all \ + --bq_result_table performance_test.performance_experiment \ + --remote_worker_host grpc-performance-server-8core grpc-performance-client-8core \ + || EXIT_CODE=1 + +# scalability with 32cores (and upload to a different BQ table) +tools/run_tests/run_performance_tests.py \ + -l c++ java csharp go \ + --netperf \ + --category scalable \ + --bq_result_table performance_test.performance_experiment_32core \ + --remote_worker_host grpc-performance-server-32core grpc-performance-client-32core \ + || EXIT_CODE=1 + +exit $EXIT_CODE + diff --git a/tools/run_tests/README.md b/tools/run_tests/README.md new file mode 100644 index 0000000000..dd727f4309 --- /dev/null +++ b/tools/run_tests/README.md @@ -0,0 +1,52 @@ +#Overview + +This directory contains scripts that facilitate building and running tests. We are using python scripts as entrypoint for our +tests because that gives us the opportunity to run tests using the same commandline regardless of the platform you are using. + +#Unit tests (run_tests.py) + +Builds gRPC in given language and runs unit tests. Use `tools/run_tests/run_tests.py --help` for more help. + +######Example +`tools/run_tests/run_tests.py -l csharp -c dbg` + +######Useful options (among many others) +- `--use_docker` Builds a docker container containing all the prerequisites for given language and runs the tests under that container. +- `--build_only` Only build, do not run the tests. + +#Interop tests (run_interop_tests.py) + +Runs tests for cross-platform/cross-language interoperability. For more details, see [Interop tests descriptions](/doc/interop-test-descriptions.md) +The script is also capable of running interop tests for grpc-java and grpc-go, using sources checked out alongside the ones of the grpc repository. + +######Example +`tools/run_tests/run_interop_tests.py -l csharp -s c++ --use_docker` (run interop tests with C# client and C++ server) + +#Performance benchmarks (run_performance_tests.py) + +Runs predefined benchmark scenarios for given languages. Besides the simple configuration of running all the scenarios locally, +the script also supports orchestrating test runs with client and server running on different machines and uploading the results +to BigQuery. + +######Example +`tools/run_tests/run_peformance_tests.py -l c++ node` + +######Useful options +- `--regex` use regex to select particular scenarios to run. + +#Stress tests (run_stress_tests.py) + +Runs modified interop tests clients and servers under heavy load for an extended period of time to discover potential stability issues. +The tests are internally using Kubernetes to run the client and server on GKE and upload statistics to BigQuery. + +`tools/run_tests/stress_test/run_on_gke.py --gcp_project_id=<google-cloud-platform-project-id> --config_file=<path-to-config-file>` + +The directory `tools/run_tests/stress_test/configs/` contains the config files for several scenarios + +#Artifacts & Packages (task_runner.py) + +A generalized framework for running predefined tasks based on their labels. We use this to building binary artifacts & distrib packages and testing them) + +######Example +`tools/run_tests/task_runner.py -f python artifact linux x64` (build tasks with labels `python`, `artifact`, `linux`, and `x64`) + diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 77b158f27e..b55d728d84 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -34,6 +34,7 @@ JAVA_WARMUP_SECONDS=15 # Java needs more warmup time for JIT to kick in. BENCHMARK_SECONDS=30 SMOKETEST='smoketest' +SCALABLE='scalable' SECURE_SECARGS = {'use_test_ca': True, 'server_host_override': 'foo.test.google.fr'} @@ -181,7 +182,7 @@ class CXXLanguage: # TODO(ctiller): add 70% load latency test for secure in [True, False]: secstr = 'secure' if secure else 'insecure' - smoketest_categories = [SMOKETEST] if secure else None + smoketest_categories = [SMOKETEST] if secure else [] yield _ping_pong_scenario( 'cpp_generic_async_streaming_ping_pong_%s' % secstr, rpc_type='STREAMING', @@ -214,20 +215,21 @@ class CXXLanguage: client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async', secure=secure, - categories=smoketest_categories) + categories=smoketest_categories+[SCALABLE]) yield _ping_pong_scenario( 'cpp_protobuf_async_streaming_qps_unconstrained_%s' % secstr, rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async', - secure=secure) + secure=secure, + categories=[SCALABLE]) yield _ping_pong_scenario( 'cpp_generic_async_streaming_qps_unconstrained_%s' % secstr, rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_GENERIC_SERVER', unconstrained_client='async', use_generic_payload=True, secure=secure, - categories=smoketest_categories) + categories=smoketest_categories+[SCALABLE]) yield _ping_pong_scenario( 'cpp_generic_async_streaming_qps_one_server_core_%s' % secstr, rpc_type='STREAMING', @@ -275,12 +277,13 @@ class CSharpLanguage: 'csharp_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async', - categories=[SMOKETEST]) + categories=[SMOKETEST,SCALABLE]) yield _ping_pong_scenario( 'csharp_protobuf_async_streaming_qps_unconstrained', rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', - unconstrained_client='async') + unconstrained_client='async', + categories=[SCALABLE]) yield _ping_pong_scenario( 'csharp_to_cpp_protobuf_sync_unary_ping_pong', rpc_type='UNARY', @@ -296,17 +299,20 @@ class CSharpLanguage: yield _ping_pong_scenario( 'csharp_to_cpp_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', - unconstrained_client='async', server_language='c++') + unconstrained_client='async', server_language='c++', + categories=[SCALABLE]) yield _ping_pong_scenario( 'csharp_to_cpp_protobuf_sync_to_async_unary_qps_unconstrained', rpc_type='UNARY', client_type='SYNC_CLIENT', server_type='ASYNC_SERVER', - unconstrained_client='sync', server_language='c++') + unconstrained_client='sync', server_language='c++', + categories=[SCALABLE]) yield _ping_pong_scenario( 'cpp_to_csharp_protobuf_async_unary_qps_unconstrained', rpc_type='UNARY', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', - unconstrained_client='async', client_language='c++') + unconstrained_client='async', client_language='c++', + categories=[SCALABLE]) def __str__(self): @@ -487,7 +493,7 @@ class JavaLanguage: def scenarios(self): for secure in [True, False]: secstr = 'secure' if secure else 'insecure' - smoketest_categories = [SMOKETEST] if secure else None + smoketest_categories = [SMOKETEST] if secure else [] yield _ping_pong_scenario( 'java_generic_async_streaming_ping_pong_%s' % secstr, rpc_type='STREAMING', @@ -520,19 +526,21 @@ class JavaLanguage: client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async', secure=secure, warmup_seconds=JAVA_WARMUP_SECONDS, - categories=smoketest_categories) + categories=smoketest_categories+[SCALABLE]) yield _ping_pong_scenario( 'java_protobuf_async_streaming_qps_unconstrained_%s' % secstr, rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_SERVER', unconstrained_client='async', - secure=secure, warmup_seconds=JAVA_WARMUP_SECONDS) + secure=secure, warmup_seconds=JAVA_WARMUP_SECONDS, + categories=[SCALABLE]) yield _ping_pong_scenario( 'java_generic_async_streaming_qps_unconstrained_%s' % secstr, rpc_type='STREAMING', client_type='ASYNC_CLIENT', server_type='ASYNC_GENERIC_SERVER', unconstrained_client='async', use_generic_payload=True, - secure=secure, warmup_seconds=JAVA_WARMUP_SECONDS) + secure=secure, warmup_seconds=JAVA_WARMUP_SECONDS, + categories=[SCALABLE]) yield _ping_pong_scenario( 'java_generic_async_streaming_qps_one_server_core_%s' % secstr, rpc_type='STREAMING', @@ -562,7 +570,7 @@ class GoLanguage: def scenarios(self): for secure in [True, False]: secstr = 'secure' if secure else 'insecure' - smoketest_categories = [SMOKETEST] if secure else None + smoketest_categories = [SMOKETEST] if secure else [] # ASYNC_GENERIC_SERVER for Go actually uses a sync streaming server, # but that's mostly because of lack of better name of the enum value. @@ -592,14 +600,15 @@ class GoLanguage: client_type='SYNC_CLIENT', server_type='SYNC_SERVER', unconstrained_client='async', secure=secure, - categories=smoketest_categories) + categories=smoketest_categories+[SCALABLE]) # unconstrained_client='async' is intended (client uses goroutines) yield _ping_pong_scenario( 'go_protobuf_sync_streaming_qps_unconstrained_%s' % secstr, rpc_type='STREAMING', client_type='SYNC_CLIENT', server_type='SYNC_SERVER', unconstrained_client='async', - secure=secure) + secure=secure, + categories=[SCALABLE]) # unconstrained_client='async' is intended (client uses goroutines) # ASYNC_GENERIC_SERVER for Go actually uses a sync streaming server, @@ -608,7 +617,8 @@ class GoLanguage: 'go_generic_sync_streaming_qps_unconstrained_%s' % secstr, rpc_type='STREAMING', client_type='SYNC_CLIENT', server_type='ASYNC_GENERIC_SERVER', unconstrained_client='async', use_generic_payload=True, - secure=secure) + secure=secure, + categories=[SCALABLE]) # TODO(jtattermusch): add scenarios go vs C++ diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py index 181d62bf4a..f037d0d17d 100755 --- a/tools/run_tests/run_performance_tests.py +++ b/tools/run_tests/run_performance_tests.py @@ -73,7 +73,6 @@ class QpsWorkerJob: def create_qpsworker_job(language, shortname=None, port=10000, remote_host=None): - # TODO: support more languages cmdline = language.worker_cmdline() + ['--driver_port=%s' % port] if remote_host: user_at_host = '%s@%s' % (_REMOTE_HOST_USERNAME, remote_host) @@ -373,7 +372,7 @@ argp.add_argument('-r', '--regex', default='.*', type=str, argp.add_argument('--bq_result_table', default=None, type=str, help='Bigquery "dataset.table" to upload results to.') argp.add_argument('--category', - choices=['smoketest','all'], + choices=['smoketest','all','scalable'], default='all', help='Select a category of tests to run.') argp.add_argument('--netperf', diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 97054c62cc..f6e4e8d157 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -892,7 +892,7 @@ for l in languages: language_make_options=[] if any(language.make_options() for language in languages): - if len(languages) != 1: + if not 'gcov' in args.config and len(languages) != 1: print 'languages with custom make options cannot be built simultaneously with other languages' sys.exit(1) else: |