ci improvements
cover ci improvements
This brings a number of improvements for our CI/CT:
- resource groups for board to avoid spinning actively on busy ones
- filter variable to run only for a specific Xenomai branch
- consolidation of the artifact/no-artifact cases
- fix for artifact child pipeline
With this and an upcoming CI patch for Xenomai, we can now trigger the lab test run for the specific Xenomai branch that received an update.
Jan
Jan Kiszka (9):
ci: Create resource groups for all LAVA boards
ci: Remove "board-" from job names
ci: Fix USE_GITLAB_ARTIFACTS definition
ci: Remove redundant job filtering on USE_GITLAB_ARTIFACTS
ci: Pull common .add-lava-ssh-config into gitlab-ci-base.yml
ci: Consolidate artifacts/no-artifacts case
ci: Rename and reorder child pipeline
ci: Factor out common bridge jobs
ci: Add job filter variable
.gitlab-ci-artifacts.yml | 3 -- ci/artifacts.yml | 22 +++---------- ci/child_pipelines_artifacts.yml | 26 ++++++++-------- ci/child_pipelines_common.yml | 21 +++++++++++++ ci/child_pipelines_no_artifacts.yml | 26 ++++++++-------- ci/gitlab-ci-base.yml | 46 +++++++++++++++++++++------ ci/kernel_4_19_xenomai_next.yml | 48 ++++++++++++++--------------- ci/kernel_5_4_xenomai_next.yml | 48 ++++++++++++++--------------- ci/no-artifacts.yml | 19 ++---------- ci/xenomai_3_0_x.yml | 20 ++++++------ ci/xenomai_3_1_x.yml | 48 ++++++++++++++--------------- 11 files changed, 170 insertions(+), 157 deletions(-) create mode 100644 ci/child_pipelines_common.yml
Signature · 1 line
2.26.2
PATCH 1/9 ci: Create resource groups for all LAVA boards
From: Jan Kiszka <[email protected]>
We currently have only one instance per board in our lab. So far, test jobs requesting the same one can start in parallel and will then wait on the LAVA cli, consuming job time. Avoid this at CI level already.
--- ci/gitlab-ci-base.yml | 6 ++++++ 1 file changed, 6 insertions(+)
ci/gitlab-ci-base.yml +6 -0
@@ -47,6 +47,7 @@ default: .lava-test:qemu-amd64: extends: .test + resource_group: board-qemu-amd64 variables: TARGET: qemu-amd64
@@ -58,6 +59,7 @@ default: .lava-test:qemu-armhf: extends: .test + resource_group: board-qemu-armhf variables: TARGET: qemu-armhf
@@ -69,6 +71,7 @@ default: .lava-test:qemu-arm64: extends: .test + resource_group: board-qemu-arm64 variables: TARGET: qemu-arm64
@@ -80,6 +83,7 @@ default: .lava-test:board-hikey: extends: .test + resource_group: board-hikey variables: TARGET: hikey
@@ -91,6 +95,7 @@ default: .lava-test:board-beagle-bone-black: extends: .test + resource_group: board-beagle-bone-black variables: TARGET: beagle-bone-black
@@ -102,5 +107,6 @@ default: .lava-test:board-x86-64-efi: extends: .test + resource_group: board-x86-64-efi variables: TARGET: x86-64-efi
Signature · 1 line
2.26.2
PATCH 2/9 ci: Remove "board-" from job names
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Only adds verbosity but no information. Keep it for the resource groups, though, as they are board-related.
--- ci/gitlab-ci-base.yml | 20 +++++++------- ci/kernel_4_19_xenomai_next.yml | 48 ++++++++++++++++----------------- ci/kernel_5_4_xenomai_next.yml | 48 ++++++++++++++++----------------- ci/xenomai_3_0_x.yml | 20 +++++++------- ci/xenomai_3_1_x.yml | 48 ++++++++++++++++----------------- 5 files changed, 92 insertions(+), 92 deletions(-)
ci/gitlab-ci-base.yml +10 -10
@@ -34,12 +34,12 @@ default: - export BUILD_JOB_ID=$(scripts/get-build-id.sh ${BUILD_JOB_NAME}) - scripts/run-lava-tests.sh ${TARGET} variables: - BUILD_JOB_NAME: "build-${BUILD_IDENTIFIER}:board-${TARGET}${TARGET_EXTENSION}" + BUILD_JOB_NAME: "build-${BUILD_IDENTIFIER}:${TARGET}${TARGET_EXTENSION}" only: variables: - $LAVA_SSH_USER -.build:board-qemu-amd64: +.build:qemu-amd64: extends: .build variables: TARGET: qemu-amd64
@@ -51,7 +51,7 @@ default: variables: TARGET: qemu-amd64 -.build:board-qemu-armhf: +.build:qemu-armhf: extends: .build variables: TARGET: qemu-armhf
@@ -63,7 +63,7 @@ default: variables: TARGET: qemu-armhf -.build:board-qemu-arm64: +.build:qemu-arm64: extends: .build variables: TARGET: qemu-arm64
@@ -75,37 +75,37 @@ default: variables: TARGET: qemu-arm64 -.build:board-hikey: +.build:hikey: extends: .build variables: TARGET: hikey BUILD_OPTIONS: ":opt-lava-test.yml" -.lava-test:board-hikey: +.lava-test:hikey: extends: .test resource_group: board-hikey variables: TARGET: hikey -.build:board-beagle-bone-black: +.build:beagle-bone-black: extends: .build variables: TARGET: beagle-bone-black BUILD_OPTIONS: ":opt-lava-test.yml" -.lava-test:board-beagle-bone-black: +.lava-test:beagle-bone-black: extends: .test resource_group: board-beagle-bone-black variables: TARGET: beagle-bone-black -.build:board-x86-64-efi: +.build:x86-64-efi: extends: .build variables: TARGET: x86-64-efi BUILD_OPTIONS: ":opt-lava-test.yml" -.lava-test:board-x86-64-efi: +.lava-test:x86-64-efi: extends: .test resource_group: board-x86-64-efi variables:
ci/kernel_4_19_xenomai_next.yml +24 -24
98 lines not on this page · raw message
ci/kernel_5_4_xenomai_next.yml +24 -24
104 lines not on this page · raw message
ci/xenomai_3_0_x.yml +10 -10
@@ -11,28 +11,28 @@ include: - local: '/ci/gitlab-ci-base.yml' -build-4.4:board-beagle-bone-black: - extends: .build:board-beagle-bone-black +build-4.4:beagle-bone-black: + extends: .build:beagle-bone-black variables: XENOMAI_BUILD_OPTION: ":opt-xenomai-3.0.x.yml" DEPLOY_DIR_EXTENSION: "xenomai-3.0.x" -lava-test-4.4:board-beagle-bone-black: - needs: [ "build-4.4:board-beagle-bone-black" ] - extends: .lava-test:board-beagle-bone-black +lava-test-4.4:beagle-bone-black: + needs: [ "build-4.4:beagle-bone-black" ] + extends: .lava-test:beagle-bone-black variables: DEPLOY_DIR_EXTENSION: "xenomai-3.0.x" BUILD_IDENTIFIER: "4.4" -build-4.4:board-x86-64-efi: - extends: .build:board-x86-64-efi +build-4.4:x86-64-efi: + extends: .build:x86-64-efi variables: XENOMAI_BUILD_OPTION: ":opt-xenomai-3.0.x.yml" DEPLOY_DIR_EXTENSION: "xenomai-3.0.x" -lava-test-4.4:board-x86-64-efi: - needs: [ "build-4.4:board-x86-64-efi" ] - extends: .lava-test:board-x86-64-efi +lava-test-4.4:x86-64-efi: + needs: [ "build-4.4:x86-64-efi" ] + extends: .lava-test:x86-64-efi variables: DEPLOY_DIR_EXTENSION: "xenomai-3.0.x" BUILD_IDENTIFIER: "4.4"
ci/xenomai_3_1_x.yml +24 -24
104 lines not on this page · raw message
Signature · 1 line
2.26.2
PATCH 3/9 ci: Fix USE_GITLAB_ARTIFACTS definition
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Variables do not propagate automatically to child pipelines. So define this one in the artifact version of the child pipeline file.
--- .gitlab-ci-artifacts.yml | 3 --- ci/artifacts.yml | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-)
.gitlab-ci-artifacts.yml +0 -3
@@ -9,8 +9,5 @@ # SPDX-License-Identifier: MIT # -variables: - USE_GITLAB_ARTIFACTS: "true" - include: - local: '/ci/child_pipelines_artifacts.yml'
ci/artifacts.yml +4 -0
@@ -8,6 +8,10 @@ # # SPDX-License-Identifier: MIT # + +variables: + USE_GITLAB_ARTIFACTS: "true" + # add lavacli to the container and install the ssh keys # for the test infrastructure .add-lava-ssh-config:
Signature · 1 line
2.26.2
PATCH 4/9 ci: Remove redundant job filtering on USE_GITLAB_ARTIFACTS
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Already done by including only one of the two files.
--- ci/artifacts.yml | 4 ---- ci/no-artifacts.yml | 3 --- 2 files changed, 7 deletions(-)
ci/artifacts.yml +0 -4
@@ -30,7 +30,3 @@ variables: paths: - build/tmp/deploy/images/${TARGET}/ expire_in: 1 week - only: - variables: - - $USE_GITLAB_ARTIFACTS -
ci/no-artifacts.yml +0 -3
@@ -23,6 +23,3 @@ - echo "Building kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS}" - kas build kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS} - scripts/deploy_for_testing.sh ${TARGET} - except: - variables: - - $USE_GITLAB_ARTIFACTS
Signature · 1 line
2.26.2
PATCH 5/9 ci: Pull common .add-lava-ssh-config into gitlab-ci-base.yml
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Also refactor a bit for better readability.
--- ci/artifacts.yml | 8 -------- ci/gitlab-ci-base.yml | 12 ++++++++++++ ci/no-artifacts.yml | 9 +-------- 3 files changed, 13 insertions(+), 16 deletions(-)
ci/artifacts.yml +0 -8
@@ -12,14 +12,6 @@ variables: USE_GITLAB_ARTIFACTS: "true" -# add lavacli to the container and install the ssh keys -# for the test infrastructure -.add-lava-ssh-config: - before_script: - - mkdir -p -m=700 ~/.ssh - - if [ -n "$https_proxy" ]; then echo "ProxyCommand socat - PROXY:$(echo $https_proxy | sed 's|.*://\([^:]*\).*|\1|'):%h:%p,proxyport=$(echo $https_proxy | sed 's|.*:\([0-9]*\)$|\1|')" >> ~/.ssh/config && chmod 600 ~/.ssh/config; fi; - - echo "$LAVA_SSH_UPLOAD_KEY" | tr -d '\r' > ~/.ssh/lava_id_rsa && chmod 600 ~/.ssh/lava_id_rsa - - echo "$LAVA_SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts .build: extends: .add-lava-ssh-config stage: build
ci/gitlab-ci-base.yml +12 -0
@@ -26,6 +26,18 @@ variables: default: image: ghcr.io/siemens/kas/kas-isar:2.4 +# add lavacli to the container and install the ssh keys +# for the test infrastructure +.add-lava-ssh-config: + before_script: + - mkdir -p -m=700 ~/.ssh + - if [ -n "$https_proxy" ]; then + echo "ProxyCommand socat - PROXY:$(echo $https_proxy | sed 's|.*://\([^:]*\).*|\1|'):%h:%p,proxyport=$(echo $https_proxy | sed 's|.*:\([0-9]*\)$|\1|')" >> ~/.ssh/config; + chmod 600 ~/.ssh/config; + fi + - echo "$LAVA_SSH_UPLOAD_KEY" | tr -d '\r' > ~/.ssh/lava_id_rsa && chmod 600 ~/.ssh/lava_id_rsa + - echo "$LAVA_SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts + .test: extends: .add-lava-ssh-config stage: test
ci/no-artifacts.yml +1 -8
@@ -8,14 +8,7 @@ # # SPDX-License-Identifier: MIT # -# add lavacli to the container and install the ssh keys -# for the test infrastructure -.add-lava-ssh-config: - before_script: - - mkdir -p -m=700 ~/.ssh - - if [ -n "$https_proxy" ]; then echo "ProxyCommand socat - PROXY:$(echo $https_proxy | sed 's|.*://\([^:]*\).*|\1|'):%h:%p,proxyport=$(echo $https_proxy | sed 's|.*:\([0-9]*\)$|\1|')" >> ~/.ssh/config && chmod 600 ~/.ssh/config; fi; - - echo "$LAVA_SSH_UPLOAD_KEY" | tr -d '\r' > ~/.ssh/lava_id_rsa && chmod 600 ~/.ssh/lava_id_rsa - - echo "$LAVA_SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts + .build: extends: .add-lava-ssh-config stage: build
Signature · 1 line
2.26.2
PATCH 6/9 ci: Consolidate artifacts/no-artifacts case
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
By checking for USE_GITLAB_ARTIFACTS, we can share the scripts section. This leaves the variation to the addition of artifacts.
--- ci/artifacts.yml | 6 +----- ci/gitlab-ci-base.yml | 8 ++++++++ ci/no-artifacts.yml | 7 +------ 3 files changed, 10 insertions(+), 11 deletions(-)
ci/artifacts.yml +1 -5
@@ -13,11 +13,7 @@ variables: USE_GITLAB_ARTIFACTS: "true" .build: - extends: .add-lava-ssh-config - stage: build - script: - - echo "Building kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS}" - - kas build kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS} + extends: .build-base artifacts: paths: - build/tmp/deploy/images/${TARGET}/
ci/gitlab-ci-base.yml +8 -0
@@ -38,6 +38,14 @@ default: - echo "$LAVA_SSH_UPLOAD_KEY" | tr -d '\r' > ~/.ssh/lava_id_rsa && chmod 600 ~/.ssh/lava_id_rsa - echo "$LAVA_SSH_KNOWN_HOSTS" >> ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts +.build-base: + extends: .add-lava-ssh-config + stage: build + script: + - echo "Building kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS}" + - kas build kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS} + - if [ -z "${USE_GITLAB_ARTIFACTS}" ]; then scripts/deploy_for_testing.sh ${TARGET}; fi + .test: extends: .add-lava-ssh-config stage: test
ci/no-artifacts.yml +1 -6
@@ -10,9 +10,4 @@ # .build: - extends: .add-lava-ssh-config - stage: build - script: - - echo "Building kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS}" - - kas build kas.yml:board-${TARGET}.yml${XENOMAI_BUILD_OPTION}${LINUX_BUILD_OPTION}${BUILD_OPTIONS} - - scripts/deploy_for_testing.sh ${TARGET} + extends: .build-base
Signature · 1 line
2.26.2
PATCH 7/9 ci: Rename and reorder child pipeline
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Ordering for pure aesthetic reasons, naming to align with the branch names from the main Xenomai repo. The latter will help with setting triggers.
--- ci/child_pipelines_artifacts.yml | 12 ++++++------ ci/child_pipelines_no_artifacts.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-)
ci/child_pipelines_artifacts.yml +6 -6
@@ -11,26 +11,26 @@ stages: - parent -xenomai next: +stable/v3.0.x: stage: parent trigger: include: - local: '/ci/artifacts.yml' - - local: '/ci/xenomai_next.yml' + - local: '/ci/xenomai_3_0_x.yml' strategy: depend -xenomai 3.0.x: +stable/v3.1.x: stage: parent trigger: include: - local: '/ci/artifacts.yml' - - local: '/ci/xenomai_3_0_x.yml' + - local: '/ci/xenomai_3_1_x.yml' strategy: depend -xenomai 3.1.x: +next: stage: parent trigger: include: - local: '/ci/artifacts.yml' - - local: '/ci/xenomai_3_1_x.yml' + - local: '/ci/xenomai_next.yml' strategy: depend
ci/child_pipelines_no_artifacts.yml +6 -6
@@ -11,26 +11,26 @@ stages: - parent -xenomai next: +stable/v3.0.x: stage: parent trigger: include: - local: '/ci/no-artifacts.yml' - - local: '/ci/xenomai_next.yml' + - local: '/ci/xenomai_3_0_x.yml' strategy: depend -xenomai 3.0.x: +stable/v3.1.x: stage: parent trigger: include: - local: '/ci/no-artifacts.yml' - - local: '/ci/xenomai_3_0_x.yml' + - local: '/ci/xenomai_3_1_x.yml' strategy: depend -xenomai 3.1.x: +next: stage: parent trigger: include: - local: '/ci/no-artifacts.yml' - - local: '/ci/xenomai_3_1_x.yml' + - local: '/ci/xenomai_next.yml' strategy: depend
Signature · 1 line
2.26.2
PATCH 8/9 ci: Factor out common bridge jobs
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
Further reduces the duplicate parts in
child_pipelines_[no_]artifacts.yml.
--- ci/child_pipelines_artifacts.yml | 14 ++++++-------- ci/child_pipelines_common.yml | 19 +++++++++++++++++++ ci/child_pipelines_no_artifacts.yml | 14 ++++++-------- 3 files changed, 31 insertions(+), 16 deletions(-) create mode 100644 ci/child_pipelines_common.yml
ci/child_pipelines_artifacts.yml +6 -8
@@ -8,29 +8,27 @@ # # SPDX-License-Identifier: MIT # -stages: - - parent + +include: + - local: '/ci/child_pipelines_common.yml' stable/v3.0.x: - stage: parent + extends: .parent trigger: include: - local: '/ci/artifacts.yml' - local: '/ci/xenomai_3_0_x.yml' - strategy: depend stable/v3.1.x: - stage: parent + extends: .parent trigger: include: - local: '/ci/artifacts.yml' - local: '/ci/xenomai_3_1_x.yml' - strategy: depend next: - stage: parent + extends: .parent trigger: include: - local: '/ci/artifacts.yml' - local: '/ci/xenomai_next.yml' - strategy: depend
ci/child_pipelines_common.yml new file +19 -0
@@ -0,0 +1,19 @@ +# +# Xenomai Real-Time System +# +# Copyright (c) Siemens AG, 2019 - 2021 +# +# Authors: +# Quirin Gylstorff <[email protected]> +# Jan Kiszka <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +stages: + - parent + +.parent: + stage: parent + trigger: + strategy: depend
ci/child_pipelines_no_artifacts.yml +6 -8
@@ -8,29 +8,27 @@ # # SPDX-License-Identifier: MIT # -stages: - - parent + +include: + - local: '/ci/child_pipelines_common.yml' stable/v3.0.x: - stage: parent + extends: .parent trigger: include: - local: '/ci/no-artifacts.yml' - local: '/ci/xenomai_3_0_x.yml' - strategy: depend stable/v3.1.x: - stage: parent + extends: .parent trigger: include: - local: '/ci/no-artifacts.yml' - local: '/ci/xenomai_3_1_x.yml' - strategy: depend next: - stage: parent + extends: .parent trigger: include: - local: '/ci/no-artifacts.yml' - local: '/ci/xenomai_next.yml' - strategy: depend
Signature · 1 line
2.26.2
PATCH 9/9 ci: Add job filter variable
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
This allows to set a filter variable when triggering the pipeline, effectively running only one of the currently three child pipelines. Will permit automatic triggering from the Xenomai repo on pushes to the corresponding branches.
--- ci/child_pipelines_common.yml | 2 ++ 1 file changed, 2 insertions(+)
ci/child_pipelines_common.yml +2 -0
@@ -17,3 +17,5 @@ stages: stage: parent trigger: strategy: depend + rules: + - if: '$ONLY_RUN == null || $ONLY_RUN == $CI_JOB_NAME'
Signature · 1 line
2.26.2
PATCH v2 1/9 ci: Create resource groups for all LAVA boards
In reply to Jan KiszkaFrom: Jan Kiszka <[email protected]>
We currently have only one instance per board in our lab, and there is only one QEMU instance max, independently of the architecture. So far, test jobs requesting the same one can start in parallel and will then wait on the LAVA cli, consuming job time. Avoid this at CI level already.
---
Changes in v2:
- put all QEMUs into one group (misunderstanding of mine...)
ci/gitlab-ci-base.yml | 6 ++++++ 1 file changed, 6 insertions(+)
ci/gitlab-ci-base.yml +6 -0
@@ -47,6 +47,7 @@ default: .lava-test:qemu-amd64: extends: .test + resource_group: board-qemu variables: TARGET: qemu-amd64
@@ -58,6 +59,7 @@ default: .lava-test:qemu-armhf: extends: .test + resource_group: board-qemu variables: TARGET: qemu-armhf
@@ -69,6 +71,7 @@ default: .lava-test:qemu-arm64: extends: .test + resource_group: board-qemu variables: TARGET: qemu-arm64
@@ -80,6 +83,7 @@ default: .lava-test:board-hikey: extends: .test + resource_group: board-hikey variables: TARGET: hikey
@@ -91,6 +95,7 @@ default: .lava-test:board-beagle-bone-black: extends: .test + resource_group: board-beagle-bone-black variables: TARGET: beagle-bone-black
@@ -102,5 +107,6 @@ default: .lava-test:board-x86-64-efi: extends: .test + resource_group: board-x86-64-efi variables: TARGET: x86-64-efi
Signature · 1 line
2.26.2