diff --git a/tools/run_tests/performance/build_performance.sh b/tools/run_tests/performance/build_performance.sh index 4bf2186b26b9fa..bb48c3f4d5ddb0 100755 --- a/tools/run_tests/performance/build_performance.sh +++ b/tools/run_tests/performance/build_performance.sh @@ -75,6 +75,9 @@ do "python_asyncio") $bazel build -c opt //src/python/grpcio_tests/tests_aio/benchmark:worker ;; + "rust") + (cd ../grpc-rs/ && cargo build -p benchmark --release) + ;; *) python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8 ;; diff --git a/tools/run_tests/performance/run_worker_rust.sh b/tools/run_tests/performance/run_worker_rust.sh new file mode 100755 index 00000000000000..7e2b4ed4ff789e --- /dev/null +++ b/tools/run_tests/performance/run_worker_rust.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# Copyright 2016 PingCAP, Inc. +# +# 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, +# See the License for the specific language governing permissions and +# limitations under the License. + +set -ex + +cd $(dirname $0)/../../.. + +../grpc-rs/target/release/qps_worker $@ diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 21338c401099ae..7d953465cccd9a 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -1355,11 +1355,131 @@ def __str__(self): return 'node_purejs' return 'node' +class RustLanguage: + + def __init__(self): + self.safename = str(self) + + def worker_cmdline(self): + return ['tools/run_tests/performance/run_worker_rust.sh'] + + def worker_port_offset(self): + return 100 + + def scenarios(self): + yield _ping_pong_scenario( + 'rust_generic_async_streaming_ping_pong', + rpc_type='STREAMING', + client_type='ASYNC_CLIENT', + server_type='ASYNC_GENERIC_SERVER', + use_generic_payload=True, + categories=[SMOKETEST, SCALABLE]) + + yield _ping_pong_scenario( + 'rust_protobuf_async_streaming_ping_pong', + rpc_type='STREAMING', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER') + + yield _ping_pong_scenario( + 'rust_protobuf_async_unary_ping_pong', + rpc_type='UNARY', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + categories=[SMOKETEST, SCALABLE]) + + yield _ping_pong_scenario( + 'rust_protobuf_sync_to_async_unary_ping_pong', + rpc_type='UNARY', + client_type='SYNC_CLIENT', + server_type='ASYNC_SERVER') + + yield _ping_pong_scenario( + 'rust_protobuf_async_unary_qps_unconstrained', + rpc_type='UNARY', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + unconstrained_client='async', + categories=[SMOKETEST,SCALABLE]) + + yield _ping_pong_scenario( + 'rust_protobuf_async_streaming_qps_unconstrained', + rpc_type='STREAMING', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + unconstrained_client='async', + categories=[SCALABLE]) + + yield _ping_pong_scenario( + 'rust_protobuf_async_streaming_from_client_unconstrained', + rpc_type='STREAMING_FROM_CLIENT', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + unconstrained_client='async', + categories=[SCALABLE]) + + yield _ping_pong_scenario( + 'rust_to_cpp_protobuf_sync_unary_ping_pong', + rpc_type='UNARY', + client_type='SYNC_CLIENT', + server_type='SYNC_SERVER', + server_language='c++', + async_server_threads=1, + categories=[SMOKETEST, SCALABLE]) + + yield _ping_pong_scenario( + 'rust_to_cpp_protobuf_async_streaming_ping_pong', + rpc_type='STREAMING', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + server_language='c++', + async_server_threads=1) + + yield _ping_pong_scenario( + 'rust_to_cpp_protobuf_async_unary_qps_unconstrained', + rpc_type='UNARY', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + unconstrained_client='async', + server_language='c++', + categories=[SCALABLE]) + + yield _ping_pong_scenario( + 'rust_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++', + categories=[SCALABLE]) + + yield _ping_pong_scenario( + 'cpp_to_rust_protobuf_async_unary_qps_unconstrained', + rpc_type='UNARY', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + unconstrained_client='async', + client_language='c++', + categories=[SCALABLE]) + + yield _ping_pong_scenario( + 'rust_protobuf_async_unary_ping_pong_1MB', + rpc_type='UNARY', + client_type='ASYNC_CLIENT', + server_type='ASYNC_SERVER', + req_size=1024*1024, + resp_size=1024*1024, + categories=[SMOKETEST, SCALABLE]) + + + def __str__(self): + return 'rust' LANGUAGES = { 'c++': CXXLanguage(), 'csharp': CSharpLanguage(), 'ruby': RubyLanguage(), + 'rust': RustLanguage(), 'php7': Php7Language(), 'php7_protobuf_c': Php7Language(php7_protobuf_c=True), 'java': JavaLanguage(), diff --git a/update-branch.sh b/update-branch.sh new file mode 100644 index 00000000000000..f3524e900431d0 --- /dev/null +++ b/update-branch.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +patch=$(git rev-parse HEAD) +git checkout -b update-to-$1 $1 +git cherry-pick $patch