1#!/bin/bash 2# Copyright 2017 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 16# Source this rc script to prepare the environment for linux perf builds 17 18# Need to increase open files limit and size for perf test 19ulimit -n 32768 20ulimit -c unlimited 21 22# Performance PR testing needs GH API key and PR metadata to comment results 23if [ -n "$KOKORO_GITHUB_PULL_REQUEST_NUMBER" ]; then 24 set +x 25 sudo apt-get install -y jq 26 export ghprbTargetBranch=$(curl -s https://api.github.com/repos/grpc/grpc/pulls/$KOKORO_GITHUB_PULL_REQUEST_NUMBER | jq -r .base.ref) 27 28 gsutil cp gs://grpc-testing-secrets/github_credentials/oauth_token.txt ~/ 29 # TODO(matt-kwong): rename this to GITHUB_OAUTH_TOKEN after Jenkins deprecation 30 export JENKINS_OAUTH_TOKEN=$(cat ~/oauth_token.txt) 31 export ghprbPullId=$KOKORO_GITHUB_PULL_REQUEST_NUMBER 32 set -x 33fi 34 35sudo pip install tabulate 36 37git submodule update --init 38