create_windows_debug_worker.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. # Creates a worker for debugging/experiments.
  16. # The worker will have all the prerequisites that are installed on kokoro
  17. # windows workers.
  18. set -ex
  19. cd "$(dirname "$0")"
  20. CLOUD_PROJECT=grpc-testing
  21. ZONE=us-central1-b
  22. if [ "$1" != "" ]
  23. then
  24. INSTANCE_NAME="$1"
  25. else
  26. INSTANCE_NAME="${USER}-windows-kokoro-debug1"
  27. fi
  28. MACHINE_TYPE=e2-standard-8
  29. TMP_DISK_NAME="$INSTANCE_NAME-temp-disk"
  30. gcloud compute disks create "$TMP_DISK_NAME" \
  31. --project="$CLOUD_PROJECT" \
  32. --zone "$ZONE" \
  33. --image-project google.com:kokoro \
  34. --image empty-100g-image \
  35. --type pd-ssd
  36. echo 'Created scratch disk, waiting for it to become available.'
  37. sleep 15
  38. # The image version might need updating.
  39. gcloud compute instances create "$INSTANCE_NAME" \
  40. --project="$CLOUD_PROJECT" \
  41. --zone "$ZONE" \
  42. --machine-type "$MACHINE_TYPE" \
  43. --image-project google.com:kokoro \
  44. --image kokoro-winserver2016-v2m-prod-debug \
  45. --boot-disk-size 500 \
  46. --boot-disk-type pd-ssd \
  47. --tags=allow-ssh \
  48. --disk "auto-delete=yes,boot=no,name=$TMP_DISK_NAME"