diff --git a/.buildkite/chromium.sh b/.buildkite/chromium.sh old mode 100644 new mode 100755 index 3b742a53..734f396b --- a/.buildkite/chromium.sh +++ b/.buildkite/chromium.sh @@ -1,25 +1,27 @@ #!/usr/bin/env bash +set -eux -ZONE="us-central-1" +ZONE="us-central1-c" PROJECT="sourcegraph-ci" INSTANCE="scip-clang-runner" # From https://stackoverflow.com/a/65683139/2682729 -function wait_vm() { +function wait_vm_start() { local counter=0 - local maxRetry=20 + local maxRetry=10 while true ; do if (( counter == maxRetry )) ; then echo "Reach the retry upper limit $counter" exit 1 fi - if gcloud compute ssh --quiet --zone "$ZONE" --project "$PROJECT" "$INSTANCE" --tunnel-through-iap --command="true" 2> /dev/null ; then + if gcloud compute ssh --quiet --zone "$ZONE" --project "$PROJECT" "$INSTANCE" --tunnel-through-iap --command="true" ; then echo "The machine is up!" exit 0 else echo "Maybe later? Retry: $counter/$maxRetry" - ((counter++)) + # Don't use post-increment: https://stackoverflow.com/a/22428973/2682729 + ((++counter)) sleep 5 fi done diff --git a/.buildkite/chromium.yaml b/.buildkite/chromium.yaml index b3cedcbb..08110cd7 100644 --- a/.buildkite/chromium.yaml +++ b/.buildkite/chromium.yaml @@ -1,7 +1,9 @@ $schema: "http://json.schemastore.org/buildkite" steps: - - label: "Start VM" + - label: "Index Chromium" agents: queue: bazel command: | ./.buildkite/chromium.sh +notify: + - slack: "#code-intel-indexing-alerts"