From d527da301f6c690f008c831ecd9759fb497b1d24 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Mon, 5 May 2025 10:07:28 +0200 Subject: [PATCH] ci: Don't include the kernel in test-base image Including the kernel image in test-base requires rebuilding every x86_64 container image on each kernel uprev, even though only the crosvm jobs use this kernel. Move the download to runtime and update the distribution tags to avoid triggering container rebuilds on kernel changes. Signed-off-by: Valentine Burley Part-of: --- .gitlab-ci/common/init-stage2.sh | 7 ------- .gitlab-ci/container/debian/test-base.sh | 11 +---------- .gitlab-ci/container/gitlab-ci.yml | 8 ++++---- .gitlab-ci/crosvm-runner.sh | 7 +++++++ 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci/common/init-stage2.sh b/.gitlab-ci/common/init-stage2.sh index 0ce96019594..9d9226e5735 100755 --- a/.gitlab-ci/common/init-stage2.sh +++ b/.gitlab-ci/common/init-stage2.sh @@ -76,8 +76,6 @@ fi # - vmx for Intel VT # - svm for AMD-V # -# Additionally, download the kernel image to boot the VM via HWCI_TEST_SCRIPT. -# if [ "$HWCI_KVM" = "true" ]; then unset KVM_KERNEL_MODULE { @@ -91,11 +89,6 @@ if [ "$HWCI_KVM" = "true" ]; then echo "WARNING: Failed to detect CPU virtualization extensions" } || \ modprobe ${KVM_KERNEL_MODULE} - - mkdir -p /kernel - curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - -o "/kernel/${KERNEL_IMAGE_NAME}" \ - "${KERNEL_IMAGE_BASE}/amd64/${KERNEL_IMAGE_NAME}" fi # Fix prefix confusion: the build installs to $CI_PROJECT_DIR, but we expect diff --git a/.gitlab-ci/container/debian/test-base.sh b/.gitlab-ci/container/debian/test-base.sh index 91056f89e94..8eaa4644d83 100644 --- a/.gitlab-ci/container/debian/test-base.sh +++ b/.gitlab-ci/container/debian/test-base.sh @@ -195,17 +195,8 @@ section_end debian_setup . .gitlab-ci/container/build-kdl.sh -############### Download prebuilt kernel and firmware +############### Download firmware -if [ "$DEBIAN_ARCH" = amd64 ]; then - uncollapsed_section_start kernel "Downloading kernel and firmware" - export KERNEL_IMAGE_NAME=bzImage - mkdir -p /kernel - # shellcheck disable=SC2153 # KERNEL_IMAGE_BASE is set in the root .gitlab-ci.yml file - curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - -o "/kernel/${KERNEL_IMAGE_NAME}" "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH}/${KERNEL_IMAGE_NAME}" - section_end kernel -fi . .gitlab-ci/container/get-firmware-from-source.sh / "$FIRMWARE_FILES" ############### Build mold diff --git a/.gitlab-ci/container/gitlab-ci.yml b/.gitlab-ci/container/gitlab-ci.yml index d658a380edf..63d4e412420 100644 --- a/.gitlab-ci/container/gitlab-ci.yml +++ b/.gitlab-ci/container/gitlab-ci.yml @@ -374,7 +374,7 @@ debian/x86_64_test-base: - .firmware_x86_64 - .container-builds-base variables: - MESA_IMAGE_TAG: &debian-x86_64_test-base "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${KERNEL_TAG}" + MESA_IMAGE_TAG: &debian-x86_64_test-base "${DEBIAN_BASE_TAG}--${PKG_REPO_REV}" LLVM_VERSION: *debian-x86_64-llvm .use-debian/x86_64_test-base: @@ -453,7 +453,7 @@ debian/x86_64_test-gl: - .export-container variables: MESA_IMAGE_TAG: &debian-x86_64_test-gl ${DEBIAN_TEST_GL_TAG} - LAVA_DISTRIBUTION_TAG: "debian/x86_64_test-gl:${DEBIAN_TEST_GL_TAG}--${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}" + LAVA_DISTRIBUTION_TAG: "debian/x86_64_test-gl:${DEBIAN_TEST_GL_TAG}--${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${MESA_TEMPLATES_COMMIT}" .use-debian/x86_64_test-gl: tags: @@ -475,7 +475,7 @@ debian/x86_64_test-vk: - .export-container variables: MESA_IMAGE_TAG: &debian-x86_64_test-vk ${DEBIAN_TEST_VK_TAG} - LAVA_DISTRIBUTION_TAG: "debian/x86_64_test-vk:${DEBIAN_TEST_VK_TAG}--${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}" + LAVA_DISTRIBUTION_TAG: "debian/x86_64_test-vk:${DEBIAN_TEST_VK_TAG}--${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${MESA_TEMPLATES_COMMIT}" .use-debian/x86_64_test-vk: tags: @@ -519,7 +519,7 @@ debian/x86_64_test-video: - .export-container variables: MESA_IMAGE_TAG: &debian-x86_64_test-video ${DEBIAN_TEST_VIDEO_TAG} - LAVA_DISTRIBUTION_TAG: "debian/x86_64_test-video:${DEBIAN_TEST_VIDEO_TAG}--${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}" + LAVA_DISTRIBUTION_TAG: "debian/x86_64_test-video:${DEBIAN_TEST_VIDEO_TAG}--${DEBIAN_BASE_TAG}--${PKG_REPO_REV}--${MESA_TEMPLATES_COMMIT}" .use-debian/x86_64_test-video: tags: diff --git a/.gitlab-ci/crosvm-runner.sh b/.gitlab-ci/crosvm-runner.sh index d5d18cb0273..75638fcf6f8 100755 --- a/.gitlab-ci/crosvm-runner.sh +++ b/.gitlab-ci/crosvm-runner.sh @@ -120,6 +120,13 @@ then set -x fi +if [ ! -f "/kernel/${KERNEL_IMAGE_NAME:-bzImage}" ]; then + mkdir -p /kernel + # shellcheck disable=SC2153 # KERNEL_IMAGE_BASE is set in the default before_script + curl -L --retry 4 -f --retry-connrefused --retry-delay 30 \ + -o "/kernel/${KERNEL_IMAGE_NAME:-bzImage}" "${KERNEL_IMAGE_BASE}/${DEBIAN_ARCH:-amd64}/${KERNEL_IMAGE_NAME:-bzImage}" +fi + # We aren't testing the host driver here, so we don't need to validate NIR on the host NIR_DEBUG="novalidate" \ LIBGL_ALWAYS_SOFTWARE=${CROSVM_LIBGL_ALWAYS_SOFTWARE:-} \