How to deploy a new executor image
- Clone of
terraformin the version specified in executors/.tool-versions
asdf install terraform x.x.x
- Authenticated with GCP:
gcloud auth application-default login
- AWS credentials set as env vars:
Make a change to the
executorcode so that the buildkite build results in new
executorAWS/GCP images being built & published. Or push to a branch with the
executor-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-imagein here. The first one builds and uploads image. Second step releases it.
Try to find the GCP image name, i.e.
Try to find the AWS AMI name, i.e.
executors/(dogfood|cloud)/gcp.tfand update the image at the top in
executors/dogfood/aws.tfand update the image at the top in
aws_executor_ami(only for dogfood).
Create a pull request with that change.
Get approval for PR.
In that PR branch, in the
Open https://k8s.sgdev.org/site-admin/executors to see check the new version is used.
Releasing a new terraform module version with these newly built images
When we only dogfood a new image in between Sourcegraph releases using our own enviroments, this step can be skipped. Otherwise, we need to update the variable defaults for those images as well. This, for example, should be done before every release cut to ensure the terraform module version for the to-be-cut Sourcegraph version exists.
- Clone both github.com/sourcegraph/terraform-google-executors and github.com/sourcegraph/terraform-aws-executors.
- In each module, replace the variable default for the machine image both in the root module
variables.tfand in the
- Open a PR with this change.
- Get approval and merge this PR.
- If necessary: Cut a new release of the modules. For that, run
./release.shfrom the two repos. See the section on compatibility with Sourcegraph for versioning constraints.
- Update the executor modules in our infrastructure repo to validate and dogfood those new version tags.