From f4b4bc0c2f94e54e987137dbbf6cab76a9ee6244 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Roukala=20=28n=C3=A9=20Peres=29?= Date: Thu, 29 Dec 2022 09:16:53 +0200 Subject: [PATCH] ci/b2c: start making use of the harbor.fd.o MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A new container registry was added recently in the fd.o infrastructure. It is located in a datacenter that does not charge for bandwidth usage, and aims to become the canonical registry in the future. It is however currently configured to be a partial mirror of registry.fd.o, where only the most-downloaded container images can be found. The address of the new registry is specified in mesa/mesa's CI variables, which means forks will default to registry.fd.o. However, Valve Infra DUTs do not have access to the internet, and instead use another cache proxy hosted locally on the CI gateways. This forced Benjamin to overwrite the registry URL from harbor.freedesktop.org to registry.freedesktop.org in 0bd9a062e1ab ("CI: Overwrite valve infra's registry"). After adding support for the new registry in valve infra, then deploying the update, we are now able to make use of the new container registry. This commit simply rewrites the URL harbor.freedesktop.org into `{{ harbor_fdo_registry }}`. This variable is set in the valve infra to point to the `host:ip` of the service, which means changes to the way we deploy this service can be done on the valve-infra side without needing to make changes to every project that makes use of our machines. Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7913 Acked-by: Benjamin Tissoires Signed-off-by: Martin Roukala (né Peres) Part-of: --- .gitlab-ci/b2c/generate_b2c.py | 10 ++++++---- .gitlab-ci/test/gitlab-ci.yml | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci/b2c/generate_b2c.py b/.gitlab-ci/b2c/generate_b2c.py index 976c5b4..830aa8d 100755 --- a/.gitlab-ci/b2c/generate_b2c.py +++ b/.gitlab-ci/b2c/generate_b2c.py @@ -92,10 +92,12 @@ if args.mount_volume is not None: values['working_dir'] = args.working_dir assert(len(args.local_container) > 0) -values['local_container'] = args.local_container.replace( - # Use the gateway's pull-through registry cache to reduce load on fd.o. - 'registry.freedesktop.org', '{{ fdo_proxy_registry }}' -) + +# Use the gateway's pull-through registry caches to reduce load on fd.o. +values['local_container'] = args.local_container +for url, replacement in [('registry.freedesktop.org', '{{ fdo_proxy_registry }}'), + ('harbor.freedesktop.org', '{{ harbor_fdo_registry }}')]: + values['local_container'] = values['local_container'].replace(url, replacement) if 'B2C_KERNEL_CMDLINE_EXTRAS' in environ: values['cmdline_extras'] = environ['B2C_KERNEL_CMDLINE_EXTRAS'] diff --git a/.gitlab-ci/test/gitlab-ci.yml b/.gitlab-ci/test/gitlab-ci.yml index ac0a237..fa094aa 100644 --- a/.gitlab-ci/test/gitlab-ci.yml +++ b/.gitlab-ci/test/gitlab-ci.yml @@ -241,9 +241,6 @@ rustfmt: # We don't want the tarball unpacking of .test, but will take the JWT bits. - !reference [default, before_script] - # temporary overrides to allow others to use harbor.freedesktop.org - - export IMAGE_UNDER_TEST=${IMAGE_UNDER_TEST/harbor/registry} - - | set -x -- 2.7.4