blob: 76e4905272aea6284bdd68f8de3d3bc825d81c07 [file] [log] [blame]
Jan Tattermusch3fdf18c2016-03-25 20:13:28 -07001#!/bin/bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2015 gRPC authors.
Jan Tattermusch3fdf18c2016-03-25 20:13:28 -07003#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02004# 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
Jan Tattermusch3fdf18c2016-03-25 20:13:28 -07007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch3fdf18c2016-03-25 20:13:28 -07009#
Jan Tattermusch7897ae92017-06-07 22:57:36 +020010# 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.
Jan Tattermusch3fdf18c2016-03-25 20:13:28 -070015
16# Creates an interop worker on GCE.
Jan Tattermusch2a4d4782016-03-30 11:17:23 -070017# IMPORTANT: After this script finishes, there are still some manual
18# steps needed there are hard to automatize.
19# See go/grpc-jenkins-setup for followup instructions.
Jan Tattermusch3fdf18c2016-03-25 20:13:28 -070020
21set -ex
22
23cd $(dirname $0)
24
25CLOUD_PROJECT=grpc-testing
26ZONE=us-east1-a # canary gateway is reachable from this zone
27
28INSTANCE_NAME="${1:-grpc-canary-interop2}"
29
30gcloud compute instances create $INSTANCE_NAME \
31 --project="$CLOUD_PROJECT" \
32 --zone "$ZONE" \
33 --machine-type n1-standard-16 \
34 --image ubuntu-15-10 \
35 --boot-disk-size 1000 \
36 --scopes https://www.googleapis.com/auth/xapi.zoo
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 jenkins_master.pub linux_worker_init.sh ${INSTANCE_NAME}:~
45
46gcloud compute ssh \
47 --project="$CLOUD_PROJECT" \
48 --zone "$ZONE" \
49 $INSTANCE_NAME --command "./linux_worker_init.sh"