diff mbox series

[meta-zephyr,1/5] CI: Add variables needed for k8s runners

Message ID 20221216153723.1522131-1-peter.hoyes@arm.com
State New
Headers show
Series [meta-zephyr,1/5] CI: Add variables needed for k8s runners | expand

Commit Message

Peter Hoyes Dec. 16, 2022, 3:37 p.m. UTC
From: Peter Hoyes <Peter.Hoyes@arm.com>

The Kas container needs to use the entrypoint as that is where the user
changes from root to a normal user.

Also set the KUBERNETES_CPU_REQUEST to the variable CPU_REQUEST as this
needs to be tuned per-deployment.

CPU_REQUEST has no value outside of Arm Corp.  Gitlab CI allows for
variables to be overridden by default.  So, we can give it a default
value of NULL/empty and have everything work internally and externally
by default.

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Jon Mason <jon.mason@arm.com>
Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 .gitlab-ci.yml | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Jon Mason Jan. 15, 2023, 8:12 p.m. UTC | #1
On Fri, Dec 16, 2022 at 03:37:19PM +0000, Peter Hoyes wrote:
> From: Peter Hoyes <Peter.Hoyes@arm.com>
> 
> The Kas container needs to use the entrypoint as that is where the user
> changes from root to a normal user.
> 
> Also set the KUBERNETES_CPU_REQUEST to the variable CPU_REQUEST as this
> needs to be tuned per-deployment.
> 
> CPU_REQUEST has no value outside of Arm Corp.  Gitlab CI allows for
> variables to be overridden by default.  So, we can give it a default
> value of NULL/empty and have everything work internally and externally
> by default.
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> Signed-off-by: Jon Mason <jon.mason@arm.com>
> Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>

I ran this series (batched with the other patches destined for the
master branch) though CI and it passes (with the known qemu a9 poll
issue).  See:
https://gitlab.com/jonmason00/meta-zephyr/-/pipelines/747733921

Tested-by: Jon Mason <jon.mason@arm.com>

> ---
>  .gitlab-ci.yml | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> index 3f0e319..616626a 100644
> --- a/.gitlab-ci.yml
> +++ b/.gitlab-ci.yml
> @@ -1,5 +1,12 @@
>  image: ghcr.io/siemens/kas/kas:latest-release
>  
> +variables:
> +  CPU_REQUEST: ""
> +  # These are needed as the k8s executor doesn't respect the container
> +  # entrypoint by default
> +  FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
> +  FF_KUBERNETES_HONOR_ENTRYPOINT: 1
> +
>  stages:
>    - prep
>    - build
> @@ -24,6 +31,8 @@ stages:
>  # Generalised fragment to do a Kas build
>  .build:
>    extends: .setup
> +  variables:
> +    KUBERNETES_CPU_REQUEST: $CPU_REQUEST
>    script:
>      - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME")
>      - kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'
> -- 
> 2.25.1
> 
>
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3f0e319..616626a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,12 @@ 
 image: ghcr.io/siemens/kas/kas:latest-release
 
+variables:
+  CPU_REQUEST: ""
+  # These are needed as the k8s executor doesn't respect the container
+  # entrypoint by default
+  FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY: 0
+  FF_KUBERNETES_HONOR_ENTRYPOINT: 1
+
 stages:
   - prep
   - build
@@ -24,6 +31,8 @@  stages:
 # Generalised fragment to do a Kas build
 .build:
   extends: .setup
+  variables:
+    KUBERNETES_CPU_REQUEST: $CPU_REQUEST
   script:
     - KASFILES=$(./ci/jobs-to-kas "$CI_JOB_NAME")
     - kas shell --update --force-checkout $KASFILES -c 'cat conf/*.conf'