Jan Tattermusch | 2152b6c | 2017-11-01 23:13:42 +0100 | [diff] [blame] | 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 | # Creates a worker for debugging/experiments. |
| 17 | # The worker will have all the prerequisites that are installed on kokoro |
| 18 | # windows workers. |
| 19 | |
| 20 | set -ex |
| 21 | |
| 22 | cd $(dirname $0) |
| 23 | |
| 24 | CLOUD_PROJECT=grpc-testing |
| 25 | ZONE=us-central1-b |
| 26 | |
| 27 | if [ "$1" != "" ] |
| 28 | then |
| 29 | INSTANCE_NAME="$1" |
| 30 | else |
| 31 | INSTANCE_NAME="${USER}-windows-kokoro-debug1" |
| 32 | fi |
| 33 | |
| 34 | MACHINE_TYPE=n1-standard-8 |
Jan Tattermusch | 041802c | 2017-11-03 14:16:39 +0100 | [diff] [blame^] | 35 | TMP_DISK_NAME="$INSTANCE_NAME-temp-disk" |
| 36 | |
| 37 | gcloud compute disks create $TMP_DISK_NAME \ |
| 38 | --project="$CLOUD_PROJECT" \ |
| 39 | --zone "$ZONE" \ |
| 40 | --image-project google.com:kokoro \ |
| 41 | --image empty-100g-image \ |
| 42 | --type pd-ssd |
| 43 | |
| 44 | echo 'Created scratch disk, waiting for it to become available.' |
| 45 | sleep 15 |
Jan Tattermusch | 2152b6c | 2017-11-01 23:13:42 +0100 | [diff] [blame] | 46 | |
| 47 | gcloud compute instances create $INSTANCE_NAME \ |
| 48 | --project="$CLOUD_PROJECT" \ |
| 49 | --zone "$ZONE" \ |
| 50 | --machine-type $MACHINE_TYPE \ |
| 51 | --image-project google.com:kokoro \ |
| 52 | --image kokoro-win7build-v9-prod-debug \ |
Jan Tattermusch | 041802c | 2017-11-03 14:16:39 +0100 | [diff] [blame^] | 53 | --boot-disk-type pd-ssd \ |
| 54 | --tags=allow-ssh \ |
| 55 | --disk auto-delete=yes,boot=no,name=$TMP_DISK_NAME |