Add support for Container Optimized OS
Overview
CoreOS, which is used by use on GitLab.com's Runners fleet, is deprecated and got an EOL dated for May 26th, 2020. After this date it will not get any new updates (including security ones).
Since we still didn't implement any replacement for Docker Machine, we need to chose another base image for our fleet. And while the date 2020-05-26 is not a strict deadline (we use our own image built on top of the base one, and the updates are needed quite rarely), we're not in a comfortable situation having only 3.5 months.
At https://gitlab.com/gitlab-com/gl-infra/infrastructure/issues/9132 we've started a discussion about searching a new replacement.
One of the proposed choices is to use GCP's Container Optimized OS. It 's similar to CoreOS in a way that it brings Docker natively and already installed on the base image. It's also the image that is the default choice for powering Google Kubernetes Engine, so should have the best support for containers in GCP.
However, Docker Machine doesn't know how to provision it:
Running pre-create checks...
(tm-test-machine-1) Check that the project exists
(tm-test-machine-1) Check if the instance already exists
Creating machine...
(tm-test-machine-1) Generating SSH Key
(tm-test-machine-1) Creating host...
(tm-test-machine-1) Opening firewall ports
(tm-test-machine-1) Creating instance
(tm-test-machine-1) Waiting for Instance
(tm-test-machine-1) Uploading SSH Key
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Error creating machine: Error detecting OS: OS type not recognized
It should be fairly easy to prepare a new provisioner for cos
(GCP's abbreviation for Container Optimized OS and the ID of the release that is used in /etc/os-release
), basing it on the existing CoreOS provisioner. We would mostly need to change the release ID used in initialization and maybe adjust a little the provisioning steps.
While the choice was not done yet, I'd propose to prepare the provisioner and experiment a little with cos
images as a new base for our CI fleet.
Things to investigate
- Google COS
- flatcar
- If it's possible to use https://dev.gitlab.org/cookbooks/packer-runner-machines with the new OS and if there would be any limiations.