blob: 0fdb43cf16aa7e6414d1dc7a0568d6a72a938d97 [file] [log] [blame]
Matt Kwongb95aa402017-10-13 13:25:23 -07001#!/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# Creates a performance worker on GCE to be used on Kokoro.
17
18set -ex
19
20cd $(dirname $0)
21
22CLOUD_PROJECT=grpc-testing
23ZONE=us-central1-b # this zone allows 32core machines
24
25INSTANCE_NAME="${1:-grpc-kokoro-performance-server1}"
26MACHINE_TYPE=n1-standard-32
27
28gcloud compute instances create $INSTANCE_NAME \
29 --project="$CLOUD_PROJECT" \
30 --zone "$ZONE" \
31 --machine-type $MACHINE_TYPE \
32 --image-project ubuntu-os-cloud \
33 --image-family ubuntu-1704 \
34 --boot-disk-size 300 \
35 --scopes https://www.googleapis.com/auth/bigquery \
36 --tags=allow-ssh
37
38echo 'Created GCE instance, waiting 60 seconds for it to come online.'
39sleep 60
40
41gcloud compute copy-files \
42 --project="$CLOUD_PROJECT" \
43 --zone "$ZONE" \
44 kokoro_performance.pub linux_kokoro_performance_worker_init.sh kbuilder@${INSTANCE_NAME}:~
45
46gcloud compute ssh \
47 --project="$CLOUD_PROJECT" \
48 --zone "$ZONE" \
49 kbuilder@${INSTANCE_NAME} --command "./linux_kokoro_performance_worker_init.sh"