How to deploy a new executor image
This guide documents how to deploy a new image of executors to the following Sourcegraph instances:
Requirements
- Clone of
infrastructure
repository terraform
in the version specified in executors/.tool-versions- Using
asdf
:asdf install terraform x.x.x
- Using
- Authenticated with GCP:
gcloud auth application-default login
- AWS credentials set as env vars:
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
Steps
-
Make a change to the
executor
code so that the buildkite build results in newexecutor
AWS/GCP images being built & published. Or push to a branch with theexecutor-patch-notest/
prefix to trigger the build. -
Look at the buildkite build. Example: https://buildkite.com/sourcegraph/sourcegraph/builds/116966
There are two steps with
executor-image
in here. The first one builds and uploads image. Second step releases it.Try to find the GCP image name, i.e.
executor-cc28c728e5-116966
Try to find the AWS AMI name, i.e.
ami-0fb21656aeba5eb7c
-
In the
infrastructure
repository:
- Open
executors/gcp.tf
and update the image at the top ingcp_executor_machine_image
. - open
executors/aws.tf
and update the image at the top inaws_executor_ami
.
- Create a pull request with that change.
- Get approval for PR.
- In that PR branch, in the
executors
folder, run:terraform apply
. - Open https://k8s.sgdev.org/site-admin/executors to see that the new version is used.
- Merge PR.