-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automate GCP VM image creation (#2130)
With this change, updating CI Linux & Windows image is as simple as triggering builds in the following pipeline: - https://buildkite.com/bazel-trusted/create-windows-vm-image - https://buildkite.com/bazel-trusted/create-linux-vm-image Check the documentation for more details.
- Loading branch information
1 parent
ca51d31
commit dc1fc9a
Showing
5 changed files
with
153 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
--- | ||
steps: | ||
- command: |- | ||
cd buildkite | ||
./create_images.py ${BAZEL_TEST_VM_NAME} | ||
label: ":pipeline:" | ||
agents: | ||
- "queue=default" | ||
plugins: | ||
- docker#v3.8.0: | ||
always-pull: true | ||
environment: | ||
- "ANDROID_HOME" | ||
- "ANDROID_NDK_HOME" | ||
- "BUILDKITE_ARTIFACT_UPLOAD_DESTINATION" | ||
image: "gcr.io/bazel-public/ubuntu2204" | ||
network: "host" | ||
privileged: true | ||
propagate-environment: true | ||
propagate-uid-gid: true | ||
volumes: | ||
- "/etc/group:/etc/group:ro" | ||
- "/etc/passwd:/etc/passwd:ro" | ||
- "/etc/shadow:/etc/shadow:ro" | ||
- "/opt/android-ndk-r15c:/opt/android-ndk-r15c:ro" | ||
- "/opt/android-sdk-linux:/opt/android-sdk-linux:ro" | ||
- "/var/lib/buildkite-agent:/var/lib/buildkite-agent" | ||
- "/var/lib/gitmirrors:/var/lib/gitmirrors:ro" | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
- wait | ||
|
||
- block: ":arrows_counterclockwise: Re-create instance group in the bazel-testing org" | ||
|
||
- command: |- | ||
cd buildkite | ||
./create_instances.py ${BAZEL_TEST_VM_NAME} | ||
label: ":pipeline:" | ||
agents: | ||
- "queue=default" | ||
plugins: | ||
- docker#v3.8.0: | ||
always-pull: true | ||
environment: | ||
- "ANDROID_HOME" | ||
- "ANDROID_NDK_HOME" | ||
- "BUILDKITE_ARTIFACT_UPLOAD_DESTINATION" | ||
image: "gcr.io/bazel-public/ubuntu2204" | ||
network: "host" | ||
privileged: true | ||
propagate-environment: true | ||
propagate-uid-gid: true | ||
volumes: | ||
- "/etc/group:/etc/group:ro" | ||
- "/etc/passwd:/etc/passwd:ro" | ||
- "/etc/shadow:/etc/shadow:ro" | ||
- "/opt/android-ndk-r15c:/opt/android-ndk-r15c:ro" | ||
- "/opt/android-sdk-linux:/opt/android-sdk-linux:ro" | ||
- "/var/lib/buildkite-agent:/var/lib/buildkite-agent" | ||
- "/var/lib/gitmirrors:/var/lib/gitmirrors:ro" | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
- wait | ||
|
||
- block: ":white_check_mark: Confirm you have tested the new VM image in the bazel-testing org" | ||
|
||
- wait | ||
|
||
- block: ":rocket: Promote the VM image to Prod" | ||
|
||
- command: |- | ||
cd buildkite | ||
./promote_images.py ${BAZEL_VM_NAME} | ||
label: ":pipeline:" | ||
agents: | ||
- "queue=default" | ||
plugins: | ||
- docker#v3.8.0: | ||
always-pull: true | ||
environment: | ||
- "ANDROID_HOME" | ||
- "ANDROID_NDK_HOME" | ||
- "BUILDKITE_ARTIFACT_UPLOAD_DESTINATION" | ||
image: "gcr.io/bazel-public/ubuntu2204" | ||
network: "host" | ||
privileged: true | ||
propagate-environment: true | ||
propagate-uid-gid: true | ||
volumes: | ||
- "/etc/group:/etc/group:ro" | ||
- "/etc/passwd:/etc/passwd:ro" | ||
- "/etc/shadow:/etc/shadow:ro" | ||
- "/opt/android-ndk-r15c:/opt/android-ndk-r15c:ro" | ||
- "/opt/android-sdk-linux:/opt/android-sdk-linux:ro" | ||
- "/var/lib/buildkite-agent:/var/lib/buildkite-agent" | ||
- "/var/lib/gitmirrors:/var/lib/gitmirrors:ro" | ||
- "/var/run/docker.sock:/var/run/docker.sock" |