automatic selection of platform-compatible gitlab-runner-helper image

Release notes

automatic selection of platform-compatible gitlab-runner-helper image

Problem to solve

a user setting up a GitLab CI Runner with jobs running on ARM64 machines will have a broken setup until they realise that they need to hardcode the gitlab-runner-helper image for ARM64: https://docs.gitlab.com/runner/configuration/advanced-configuration.html#helper-image-configuration-for-kubernetes-on-arm

because each instance of gitlab-runner is hardcoded to a single gitlab-runner-helper, if you have 2x different architectures of job machines (e.g. ARM64 and x86-64) then you'll need 2x gitlab-runner instances, which is double the work and operational burden

Proposal

when the user has not hard-coded their own custom gitlab-runner-helper, gitlab-runner should select the architecture-compatible version of GitLab's own gitlab-runner-helper image

it should be able to determine, via the k8s API, which possible architectures are included when it applies the configured or default node selector ( https://docs.gitlab.com/runner/configuration/advanced-configuration.html#the-runnerskubernetes-section )

if this isn't possible, or if multiple architectures are implicated, then one possible solution could be to retry a failed job using the gitlab-runner-helper image for a different architecture, until there aren't any worth trying (e.g. hypothetical RISC-V image hasn't been tried yet, but the node selector only returns ARM64 and x86-64 machines), or until there aren't any left untried

Intended users

users installing GitLab CI Runner on their own infrastructure, Kubernetes in particular