From f7befb9d8d33c1cf8ba475e3d32d44777e098d60 Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Fri, 13 Jun 2025 08:47:24 +0200 Subject: [PATCH] ci/lava: Make Cuttlefish a LAVA overlay Instead of including Cuttlefish in the core LAVA rootfs, make it an optional LAVA overlay. This reduces the size of the core rootfs and keeps Cuttlefish cached when the container is rebuilt, leading to faster deploys. Signed-off-by: Valentine Burley Part-of: --- .../container/debian/x86_64_test-android.sh | 14 +++------- .gitlab-ci/container/fdo_cntr_export.sh | 1 + .gitlab-ci/container/gitlab-ci.yml | 6 +++++ .gitlab-ci/image-tags.yml | 2 +- .gitlab-ci/lava/lava-submit.sh | 26 +++++++++++++++++++ 5 files changed, 37 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci/container/debian/x86_64_test-android.sh b/.gitlab-ci/container/debian/x86_64_test-android.sh index 4853a56b4bd..f19b51fa0d4 100755 --- a/.gitlab-ci/container/debian/x86_64_test-android.sh +++ b/.gitlab-ci/container/debian/x86_64_test-android.sh @@ -113,18 +113,14 @@ rm -rf /VK-GL-CTS section_start cuttlefish "Downloading, building and installing Cuttlefish" -CUTTLEFISH_PROJECT_PATH=ao2/aosp-manifest -CUTTLEFISH_BUILD_VERSION_TAGS=mesa-venus -CUTTLEFISH_BUILD_NUMBER=20250506.001 - mkdir /cuttlefish pushd /cuttlefish curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - -O "https://${S3_HOST}/${S3_ANDROID_BUCKET}/${CUTTLEFISH_PROJECT_PATH}/aosp-${CUTTLEFISH_BUILD_VERSION_TAGS}.${CUTTLEFISH_BUILD_NUMBER}/aosp_cf_x86_64_only_phone-img-$CUTTLEFISH_BUILD_NUMBER.tar.zst" + -O "https://${S3_HOST}/${S3_ANDROID_BUCKET}/${CUTTLEFISH_PROJECT_PATH}/aosp-${CUTTLEFISH_BUILD_VERSION_TAGS}.${CUTTLEFISH_BUILD_NUMBER}/aosp_cf_x86_64_only_phone-img-${CUTTLEFISH_BUILD_NUMBER}.tar.zst" -tar --zstd -xvf aosp_cf_x86_64_only_phone-img-$CUTTLEFISH_BUILD_NUMBER.tar.zst -rm aosp_cf_x86_64_only_phone-img-$CUTTLEFISH_BUILD_NUMBER.tar.zst +tar --zstd -xvf aosp_cf_x86_64_only_phone-img-"$CUTTLEFISH_BUILD_NUMBER".tar.zst +rm aosp_cf_x86_64_only_phone-img-"$CUTTLEFISH_BUILD_NUMBER".tar.zst ls -lhS ./* curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ @@ -132,10 +128,6 @@ curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ tar --zst -xvf cvd-host_package-x86_64.tar.zst rm cvd-host_package-x86_64.tar.zst -AOSP_KERNEL_PROJECT_PATH=ao2/aosp-kernel-manifest -AOSP_KERNEL_BUILD_VERSION_TAGS=common-android14-6.1-venus -AOSP_KERNEL_BUILD_NUMBER=20241107.001 - curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ -O "https://${S3_HOST}/${S3_ANDROID_BUCKET}/${AOSP_KERNEL_PROJECT_PATH}/aosp-kernel-common-${AOSP_KERNEL_BUILD_VERSION_TAGS}.${AOSP_KERNEL_BUILD_NUMBER}/bzImage" curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ diff --git a/.gitlab-ci/container/fdo_cntr_export.sh b/.gitlab-ci/container/fdo_cntr_export.sh index 5699c5baa56..869016d575e 100644 --- a/.gitlab-ci/container/fdo_cntr_export.sh +++ b/.gitlab-ci/container/fdo_cntr_export.sh @@ -47,6 +47,7 @@ buildah_export() { # These components will be provided via LAVA overlays, # so remove them from the core rootfs + rm -rf "${mountpoint}/cuttlefish" rm -rf "${mountpoint}/vkd3d-proton-tests" rm -rf "${mountpoint}/vkd3d-proton-wine64" diff --git a/.gitlab-ci/container/gitlab-ci.yml b/.gitlab-ci/container/gitlab-ci.yml index 9945c3a16f1..cc7384833bf 100644 --- a/.gitlab-ci/container/gitlab-ci.yml +++ b/.gitlab-ci/container/gitlab-ci.yml @@ -260,6 +260,12 @@ debian/s390x_build: # used (LLVM 19 in our Debian system), but ANDROID_LLVM_VERSION refers to # the cross-compiling LLVM toolchain used to build for the Android system. LLVM_VERSION: &debian-android-llvm 19 + CUTTLEFISH_PROJECT_PATH: ao2/aosp-manifest + CUTTLEFISH_BUILD_VERSION_TAGS: mesa-venus + CUTTLEFISH_BUILD_NUMBER: 20250506.001 + AOSP_KERNEL_PROJECT_PATH: ao2/aosp-kernel-manifest + AOSP_KERNEL_BUILD_VERSION_TAGS: common-android14-6.1-venus + AOSP_KERNEL_BUILD_NUMBER: 20241107.001 debian/android_build: extends: diff --git a/.gitlab-ci/image-tags.yml b/.gitlab-ci/image-tags.yml index d31bffc56a8..121d0ef7896 100644 --- a/.gitlab-ci/image-tags.yml +++ b/.gitlab-ci/image-tags.yml @@ -30,7 +30,7 @@ variables: ALPINE_X86_64_BUILD_TAG: "20250611-rust" ALPINE_X86_64_LAVA_SSH_TAG: "20250423-rootfs" - ALPINE_X86_64_LAVA_TRIGGER_TAG: "20250610-eval" + ALPINE_X86_64_LAVA_TRIGGER_TAG: "20250613-cuttlefish" FEDORA_X86_64_BUILD_TAG: "20250611-rust" diff --git a/.gitlab-ci/lava/lava-submit.sh b/.gitlab-ci/lava/lava-submit.sh index 52b4dbe0ecf..cf1aa570388 100755 --- a/.gitlab-ci/lava/lava-submit.sh +++ b/.gitlab-ci/lava/lava-submit.sh @@ -79,6 +79,32 @@ if [ -n "${VKD3D_PROTON_TAG:-}" ]; then --compression=zstd ) fi +if [ -n "${S3_ANDROID_ARTIFACT_NAME:-}" ]; then + LAVA_EXTRA_OVERLAYS+=( + - append-overlay + --name=android-cf-image + --url="https://${S3_BASE_PATH}/${CUTTLEFISH_PROJECT_PATH}/aosp-${CUTTLEFISH_BUILD_VERSION_TAGS}.${CUTTLEFISH_BUILD_NUMBER}/aosp_cf_${ARCH}_only_phone-img-${CUTTLEFISH_BUILD_NUMBER}.tar.zst" + --path="/cuttlefish" + --format=tar + --compression=zstd + - append-overlay + --name=android-cvd-host-package + --url="https://${S3_BASE_PATH}/${CUTTLEFISH_PROJECT_PATH}/aosp-${CUTTLEFISH_BUILD_VERSION_TAGS}.${CUTTLEFISH_BUILD_NUMBER}/cvd-host_package-${ARCH}.tar.zst" + --path="/cuttlefish" + --format=tar + --compression=zstd + - append-overlay + --name=android-kernel + --url="https://${S3_BASE_PATH}/${AOSP_KERNEL_PROJECT_PATH}/aosp-kernel-common-${AOSP_KERNEL_BUILD_VERSION_TAGS}.${AOSP_KERNEL_BUILD_NUMBER}/bzImage" + --path="/cuttlefish" + --format=file + - append-overlay + --name=android-initramfs + --url="https://${S3_BASE_PATH}/${AOSP_KERNEL_PROJECT_PATH}/aosp-kernel-common-${AOSP_KERNEL_BUILD_VERSION_TAGS}.${AOSP_KERNEL_BUILD_NUMBER}/initramfs.img" + --path="/cuttlefish" + --format=file + ) +fi PYTHONPATH=/ /lava/lava_job_submitter.py \ --farm "${FARM}" \