Add support for aliasing user provided images
For the macOS build cloud, we will expose our OS images to the user on a public identifier like macos-11-xcode-12.img
.
To be able to release new image robustly, we need:
- to be able to control when a new image is released, separate from the time it is built
- to be able to roll back to a previous version of an image if we have an outage
Since image storage is actually just a folder on disk, and we have quota limitations, we can't keep infinite version history. Additionally, image names are limited to 29 chars, including extension, so we're limited in the versioning patterns we use.
We want to keep the public user-facing identifier generic, with only the major macOS and Xcode versions. Since the user selects the image by setting image: macos-11-xcode-12.img
in their .gitlab-ci.yml
, an identifier too specific would prevent us from updating it for security reasons or otherwise.
The release process should then be as follows:
- when we want to release a new image, run a manual job on orka's master pipeline to copy the latest master build to a unique identifier
macos-tag-$CI_JOB_ID.img
- in the autoscaler configuration, update the image alias to say that
macos-11-xcode-12.img
is now pointing tomacos-tag-$CI_JOB_ID.img
- deploy the new autoscaler configuration, so new VMs use the new image
- at some point in the future, clean up unused tagged images to free up quota for new ones
Let's add support for this aliasing in the autoscaler config.toml
:
[Orka]
[Orka.ImageAliases]
"macos-11-xcode-12.img" = "macos-tag-12345.img"
"macos-10.15-xcode-11.img" =" macos-tag-67890.img"