Skip to content

Draft: Adding ENV to allow customizing where docker runner images live

John McDonnell requested to merge jmd-add-offline-container-registry into master

What does this MR do and why?

As part of Identify mechanism to allow 'offline container ... (gitlab-qa#700) we may want to modify the host where we pull docker images from when running container registry test.

In this MR we are adding an ENV that allows customising the registry host name where images used for runner fabrication live.

How to set up and validate locally

# To run a local container registry see https://docs.docker.com/registry/ 
docker run -d -p 5001:5000 --name registry registry:2

docker pull registry.gitlab.com/gitlab-org/gitlab-runner:alpine
docker pull registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7 

docker tag registry.gitlab.com/gitlab-org/gitlab-runner:alpine localhost:5001/gitlab-org/gitlab-runner:alpine
docker tag registry.gitlab.com/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7 localhost:5001/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7

docker push localhost:5001/gitlab-org/gitlab-runner:alpine
docker push localhost:5001/gitlab-org/gitlab-build-images:gitlab-qa-alpine-ruby-2.7 
  • Run any E2E test that makes use of QA:Resource:Runner
    • QA_RUNNER_IMAGE_REGISTRY=localhost:5001 bundle exec bin/qa Test::Instance::All http://gdk.test:3000 qa/specs/features/api/4_verify/remove_runner_spec.rb
  • Note the local container registry is accessed in lines such as docker run -d --rm --network test --name qa-runner-1671190607 --privileged localhost:5001/gitlab-org/gitlab-runner:alpine

NB - we shouldn't expect to see any changes in the pipelines here as we haven't set the ENV anywhere

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by John McDonnell

Merge request reports

Loading