Using External Images in CI

How to mirror external images to the CI environments for use in jobs.

The ci-operator config only allows referencing an image in the form of namespace/name:tag, it does not allow the specification of arbitrary Docker pull specs. In order to use external images, they need to be mirrored to QCI.

Mirror Public Images

If the source image is open to the public, we can mirror it to QCI by adding it into the configuration file in the core-services/image-mirroring folder of openshift/release repository.

1
2
3
4
5
6
7
supplementalCIImages:
  ci/boskos:latest:
    image: gcr.io/k8s-staging-boskos/boskos:latest
  ci/ci-tools-build-root:1.21:
    namespace: ci
    name: ci-tools-build-root
    tag: "1.21"

The above stanza indicates the image gcr.io/k8s-staging-boskos/boskos:latest is pushed to QCI as quay.io/openshift/ci:ci_boskos_latest and registry.ci.openshift.org/ci/ci-tools-build-root:1.21 as quay.io/openshift/ci:ci_ci-tools-build-root_1.21. The target of the mapping supplementalCIImages is of the form namespace/name:tag and the source is specified either by image or a reference of an imagestreamtag on app.ci. The latter kind of source is useful when the source image is on app.ci, e.g., the output of a buildConfig. It takes a couple of hours to complete the mirroring after the change on the configuration file is merged. Once the target image lands on QCI, it can be referenced in ci-operator’s config file as follows:

1
2
3
4
5
base_images:
  my-external-image:
    namespace: ci
    name:  boskos
    tag: latest

Mirror Private Images

It is not supported at the moment to mirror external private images to the central CI registry.