Skip to contentSkip to conversation

CI configuration improvements

PATCH In review Peter Hoyes 3 participants 9 messages Mar 10, 2023 – Mar 22, 2023

lore
Share & tools
lore
#0 lore raw

cover CI configuration improvements

From: Peter Hoyes <[email protected]>

On our team at Arm, we would like to run the U-Boot CI on our infrastructure in order to verify patches before sending them upstream. This requires some minor changes to the Gitlab CI config which can be implemented in a backwards-compatible way.

Peter Hoyes (2):
CI: Allow job tag to be optionally set globally
CI: Allow a mirror to be specified for Docker Hub

 .gitlab-ci.yml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 CI: Allow job tag to be optionally set globally

From: Peter Hoyes <[email protected]>

The default behavior of Gitlab runners is to only run jobs which match the configured tag, although there is an option to run untagged jobs [1].

To support running the CI in more complex environments where different types of runners may be present that support different tags, allow the DEFAULT_TAG for all jobs in the pipeline to be set globally using an environment variable. An empty default value is provided to retain support for untagged runners.

[1] https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run

---
 .gitlab-ci.yml | 7 +++++++
 1 file changed, 7 insertions(+)
.gitlab-ci.yml +7 -0
index 272d69e220..d54694e016 100644
@@ -1,5 +1,12 @@
 # SPDX-License-Identifier: GPL-2.0+
 
+variables:
+  DEFAULT_TAG: ""
+
+default:
+  tags:
+    - ${DEFAULT_TAG}
+
 # Grab our configured image.  The source for this is found
 # in the u-boot tree at tools/docker/Dockerfile
 image: trini/u-boot-gitlab-ci-runner:jammy-20230126-10Feb2023
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] CI: Allow job tag to be optionally set globally

Quoted 13 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

The default behavior of Gitlab runners is to only run jobs which match the configured tag, although there is an option to run untagged jobs [1].

To support running the CI in more complex environments where different types of runners may be present that support different tags, allow the DEFAULT_TAG for all jobs in the pipeline to be set globally using an environment variable. An empty default value is provided to retain support for untagged runners.

Quoted 6 lines

[1] https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run

---
 .gitlab-ci.yml | 7 +++++++
 1 file changed, 7 insertions(+)
Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] CI: Allow job tag to be optionally set globally

In reply to Peter Hoyes
Quoted 12 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

The default behavior of Gitlab runners is to only run jobs which match the configured tag, although there is an option to run untagged jobs [1].

To support running the CI in more complex environments where different types of runners may be present that support different tags, allow the DEFAULT_TAG for all jobs in the pipeline to be set globally using an environment variable. An empty default value is provided to retain support for untagged runners.

Quoted 3 lines

[1] https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run

Signature · 1 line
Tom
#4 lore raw

Re: [PATCH 1/2] CI: Allow job tag to be optionally set globally

In reply to Peter Hoyes
Quoted 12 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

The default behavior of Gitlab runners is to only run jobs which match the configured tag, although there is an option to run untagged jobs [1].

To support running the CI in more complex environments where different types of runners may be present that support different tags, allow the DEFAULT_TAG for all jobs in the pipeline to be set globally using an environment variable. An empty default value is provided to retain support for untagged runners.

Quoted 5 lines

[1] https://docs.gitlab.com/ee/ci/runners/configure_runners.html#use-tags-to-control-which-jobs-a-runner-can-run

Applied to u-boot/next, thanks!

Signature · 1 line
Tom
#5 lore raw

PATCH 2/2 CI: Allow a mirror to be specified for Docker Hub

In reply to Peter Hoyes

From: Peter Hoyes <[email protected]>

To conserve bandwidth and potentially avoid rate limits, allow a local mirror of Docker Hub to be specified globally. The default value is unchanged.

---
 .gitlab-ci.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
.gitlab-ci.yml +2 -1
index d54694e016..f6bcd30124 100644
@@ -2,6 +2,7 @@
 
 variables:
   DEFAULT_TAG: ""
+  MIRROR_DOCKER: docker.io
 
 default:
   tags:
@@ -9,7 +10,7 @@ default:
 
 # Grab our configured image.  The source for this is found
 # in the u-boot tree at tools/docker/Dockerfile
-image: trini/u-boot-gitlab-ci-runner:jammy-20230126-10Feb2023
+image: ${MIRROR_DOCKER}/trini/u-boot-gitlab-ci-runner:jammy-20230126-10Feb2023
 
 # We run some tests in different order, to catch some failures quicker.
 stages:
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] CI: Allow a mirror to be specified for Docker Hub

Quoted 11 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

To conserve bandwidth and potentially avoid rate limits, allow a local mirror of Docker Hub to be specified globally. The default value is unchanged.

---
 .gitlab-ci.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Reviewed-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] CI: Allow a mirror to be specified for Docker Hub

In reply to Peter Hoyes
Quoted 7 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

To conserve bandwidth and potentially avoid rate limits, allow a local mirror of Docker Hub to be specified globally. The default value is unchanged.

Oh neat. What we have the source.denx.de runners configured to have a local registry mirror.

Signature · 1 line
Tom
#8 lore raw

Re: [PATCH 2/2] CI: Allow a mirror to be specified for Docker Hub

In reply to Peter Hoyes
Quoted 9 lines · Peter Hoyes

From: Peter Hoyes <[email protected]>

To conserve bandwidth and potentially avoid rate limits, allow a local mirror of Docker Hub to be specified globally. The default value is unchanged.

Applied to u-boot/next, thanks!

Signature · 1 line
Tom