Multi Platform Gitlab Runner Helper Image
Currently, the gitlab runner helper image has images supporting various platforms but there's no multi platform images available https://hub.docker.com/r/gitlab/gitlab-runner-helper/tags.
Here's the scenario I've found myself in.
I have a kubernetes cluster that is made up of both amd64 and arm64 virtual machines. I want to configure 3 instances of the kubernetes executor.
Untagged executor - I want this runner to pick up any untagged jobs. These jobs could run on either my amd64 or arm64 nodes based on free capacity at the time.
AMD64 executor - I want this runner to pick up jobs tagged with amd64 and it would run the jobs on amd64 nodes only.
ARM64 executor - I want this runner to pick up jobs tagged with arm64 and it would run the jobs on arm64 nodes only.
The problem here is with the untagged executor. With this configuration, the following happens:
- If the untagged executor selects an amd64 node to run the job, everything works (the helper image seems to default to an amd64 image)
- If the untagged executor selects an arm64 node to run the job, the job fails as the helper image fails to start with an exec error (the helper image pulled is the amd64 one which won't run on arm64)
Currently, to make this scenario work I've created my own multi platform helper image.
docker buildx imagetools create "gitlab/gitlab-runner-helper:arm64-latest" "gitlab/gitlab-runner-helper:x86_64-latest" --tag "MY_PRIVATE_REGISTRY/gitlab-runner-helper:latest"
[runners.kubernetes]
helper_image = "MY_PRIVATE_REGISTRY/gitlab-runner-helper:latest"
Whilst this works, it means that I need to need this up to date which is additional overhead I'd rather avoid. If such an image was provided by Gitlab, I wouldn't need to maintain my own multi platform version.
If a multi platform image was available and gets configured as the default, the following advanced configuration for arm would no longer be required.
The actual gitlab runner image already has multi platform images https://hub.docker.com/r/gitlab/gitlab-runner/tags, it's just the helper which is missing them.