From 228e9151bc35b1715bd91d8c1d9a81b7ac15ee8c Mon Sep 17 00:00:00 2001 From: pat-s Date: Thu, 5 Oct 2023 23:23:33 +0200 Subject: [PATCH 1/4] update platform documentation --- docs/docs/20-usage/30-matrix-workflows.md | 7 ++++- .../22-backends/40-kubernetes.md | 28 +++++++++++++++++-- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/docs/docs/20-usage/30-matrix-workflows.md b/docs/docs/20-usage/30-matrix-workflows.md index 0e0e07e5d0e..2c180a1ea27 100644 --- a/docs/docs/20-usage/30-matrix-workflows.md +++ b/docs/docs/20-usage/30-matrix-workflows.md @@ -120,7 +120,8 @@ matrix: - linux/amd64 - linux/arm64 -platform: ${platform} +labels: + platform: ${platform} steps: test: @@ -136,3 +137,7 @@ steps: when: platform: linux/arm* ``` + +:::note +If you want to control the architecture of a runner on Kubernetes, see [the nodeSelector documentation of the Kubernetes backend](./40-kubernetes.md#nodeSelector). +::: diff --git a/docs/docs/30-administration/22-backends/40-kubernetes.md b/docs/docs/30-administration/22-backends/40-kubernetes.md index 21182e63057..aa68949b96d 100644 --- a/docs/docs/30-administration/22-backends/40-kubernetes.md +++ b/docs/docs/30-administration/22-backends/40-kubernetes.md @@ -80,9 +80,31 @@ See the [kubernetes documentation](https://kubernetes.io/docs/concepts/security/ ### nodeSelector -Specify the label which is used to select the node where the job should be executed. Labels defined here will be appended to a list already containing "kubernetes.io/arch". -By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_PLATFORM. To overwrite this, you need to specify this label in the nodeSelector section. -See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for more information on using nodeSelector. +Specify the label which is used to select the node where the job should be executed. +Labels defined here will be appended to a list already containing "kubernetes.io/arch". +By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_PLATFORM. +To overwrite this, you need to specify this label in the `nodeSelector` section of the `backend_options`. +See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for more information on about the `nodeSelector` setting. + +A practical example is when you are running a matrix-build and you want to delegate specific elements of the matrix to run on a certain architecture. +In this case, define an arbitrary key in the matrix section of the respective matrix element: + +```yml +matrix: + include: + - NAME: runner1 + ARCH: arm64 +``` + +And then overwrit the `nodeSelector` in the `backend_options` section of the step(s): + +```yml +[...] + backend_options: + kubernetes: + nodeSelector: + kubernetes.io/arch: "${ARCH}" +``` ### tolerations From 8200d22cef7071a5a36e50f1741a8dd5ff8c3f1f Mon Sep 17 00:00:00 2001 From: pat-s Date: Thu, 5 Oct 2023 23:30:58 +0200 Subject: [PATCH 2/4] fix ref --- docs/docs/20-usage/30-matrix-workflows.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/20-usage/30-matrix-workflows.md b/docs/docs/20-usage/30-matrix-workflows.md index 2c180a1ea27..424bc33686a 100644 --- a/docs/docs/20-usage/30-matrix-workflows.md +++ b/docs/docs/20-usage/30-matrix-workflows.md @@ -139,5 +139,5 @@ steps: ``` :::note -If you want to control the architecture of a runner on Kubernetes, see [the nodeSelector documentation of the Kubernetes backend](./40-kubernetes.md#nodeSelector). +If you want to control the architecture of a runner on Kubernetes, see [the nodeSelector documentation of the Kubernetes backend](../30-administration/22-backends/40-kubernetes.md#nodeSelector). ::: From aa7328968feb9bc1346dbe3e06836ce861e659be Mon Sep 17 00:00:00 2001 From: pat-s Date: Mon, 9 Oct 2023 16:58:27 +0200 Subject: [PATCH 3/4] update text --- docs/docs/20-usage/30-matrix-workflows.md | 2 +- .../22-backends/40-kubernetes.md | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/docs/20-usage/30-matrix-workflows.md b/docs/docs/20-usage/30-matrix-workflows.md index 424bc33686a..e37425d2130 100644 --- a/docs/docs/20-usage/30-matrix-workflows.md +++ b/docs/docs/20-usage/30-matrix-workflows.md @@ -139,5 +139,5 @@ steps: ``` :::note -If you want to control the architecture of a runner on Kubernetes, see [the nodeSelector documentation of the Kubernetes backend](../30-administration/22-backends/40-kubernetes.md#nodeSelector). +If you want to control the architecture of a pipeline on a Kubernetes runner, see [the nodeSelector documentation of the Kubernetes backend](../30-administration/22-backends/40-kubernetes.md#nodeSelector). ::: diff --git a/docs/docs/30-administration/22-backends/40-kubernetes.md b/docs/docs/30-administration/22-backends/40-kubernetes.md index aa68949b96d..98c43489bc7 100644 --- a/docs/docs/30-administration/22-backends/40-kubernetes.md +++ b/docs/docs/30-administration/22-backends/40-kubernetes.md @@ -80,14 +80,15 @@ See the [kubernetes documentation](https://kubernetes.io/docs/concepts/security/ ### nodeSelector -Specify the label which is used to select the node where the job should be executed. -Labels defined here will be appended to a list already containing "kubernetes.io/arch". -By default the pod will use "kubernetes.io/arch" inferred from top-level "platform" setting which is deducted from the agents' environment variable CI_SYSTEM_PLATFORM. -To overwrite this, you need to specify this label in the `nodeSelector` section of the `backend_options`. -See the [kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) for more information on about the `nodeSelector` setting. +Specifies the label which is used to select the node on which the job will be executed. -A practical example is when you are running a matrix-build and you want to delegate specific elements of the matrix to run on a certain architecture. -In this case, define an arbitrary key in the matrix section of the respective matrix element: +Labels defined here will be appended to a list which already contains `"kubernetes.io/arch"`. +`"kubernetes.io/arch"` is inferred from the agents' environment variable `CI_SYSTEM_PLATFORM`. +Without a manual overwrite, builds will be randomly assigned to the runners and inherit their respective architectures. + +To overwrite this, one needs to set the label in the `nodeSelector` section of the `backend_options`. +A practical example for this is when running a matrix-build and delegating specific elements of the matrix to run on a specific architecture. +In this case, one must define an arbitrary key in the matrix section of the respective matrix element: ```yml matrix: @@ -96,7 +97,7 @@ matrix: ARCH: arm64 ``` -And then overwrit the `nodeSelector` in the `backend_options` section of the step(s): +And then overwrite the `nodeSelector` in the `backend_options` section of the step(s) using the name of the respective env var: ```yml [...] From 7e168d57c306019f72f42ee725e49903791434fb Mon Sep 17 00:00:00 2001 From: Patrick Schratz Date: Tue, 10 Oct 2023 22:12:33 +0200 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: Thomas Anderson <127358482+zc-devs@users.noreply.github.com> --- docs/docs/30-administration/22-backends/40-kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/30-administration/22-backends/40-kubernetes.md b/docs/docs/30-administration/22-backends/40-kubernetes.md index ad538a9061e..788fb65d5a7 100644 --- a/docs/docs/30-administration/22-backends/40-kubernetes.md +++ b/docs/docs/30-administration/22-backends/40-kubernetes.md @@ -83,7 +83,7 @@ See the [kubernetes documentation](https://kubernetes.io/docs/concepts/security/ Specifies the label which is used to select the node on which the job will be executed. Labels defined here will be appended to a list which already contains `"kubernetes.io/arch"`. -`"kubernetes.io/arch"` is inferred from the agents' environment variable `CI_SYSTEM_PLATFORM`. +By default `"kubernetes.io/arch"` is inferred from the agents' platform. One can override it by setting that label in the `nodeSelector` section of the `backend_options`. Without a manual overwrite, builds will be randomly assigned to the runners and inherit their respective architectures. To overwrite this, one needs to set the label in the `nodeSelector` section of the `backend_options`.