• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2# Copyright 2015 gRPC authors.
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16source ~/.rvm/scripts/rvm
17set -ex
18
19cd "$(dirname "$0")/../../.."
20
21CONFIG=${CONFIG:-opt}
22
23# build C++ qps worker & driver always - we need at least the driver to
24# run any of the scenarios.
25# TODO(jtattermusch): C++ worker and driver are not buildable on Windows yet
26if [ "$OSTYPE" != "msys" ]
27then
28  # TODO(jtattermusch): not embedding OpenSSL breaks the C# build because
29  # grpc_csharp_ext needs OpenSSL embedded and some intermediate files from
30  # this build will be reused.
31  make CONFIG="${CONFIG}" EMBED_OPENSSL=true EMBED_ZLIB=true qps_worker qps_json_driver -j8
32fi
33
34PHP_ALREADY_BUILT=""
35for language in "$@"
36do
37  case "$language" in
38  "c++")
39    ;;  # C++ has already been built.
40  "java")
41    (cd ../grpc-java/ &&
42      ./gradlew -PskipCodegen=true :grpc-benchmarks:installDist)
43    ;;
44  "go")
45    tools/run_tests/performance/build_performance_go.sh
46    ;;
47  "php7"|"php7_protobuf_c")
48    if [ -n "$PHP_ALREADY_BUILT" ]; then
49      echo "Skipping PHP build as already built by $PHP_ALREADY_BUILT"
50    else
51      PHP_ALREADY_BUILT=$language
52      tools/run_tests/performance/build_performance_php7.sh
53    fi
54    ;;
55  "csharp")
56    python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8 --compiler coreclr
57    ;;
58  "node"|"node_purejs")
59    tools/run_tests/performance/build_performance_node.sh
60    ;;
61  *)
62    python tools/run_tests/run_tests.py -l "$language" -c "$CONFIG" --build_only -j 8
63    ;;
64  esac
65done
66