From e9a1e22d6cf9842e33ebfc7daa5948fb67af07c4 Mon Sep 17 00:00:00 2001 From: Guilherme Gallo Date: Mon, 16 Jun 2025 23:03:08 -0300 Subject: [PATCH] ci/android: Store stripped CTS on S3 The CTS has almost 9GB atm, which takes almost 20 minutes to download it. Moreover, it is stripped down after that, so we don't need the entire file anyway. So let's move this artifact to S3 in a similar way that we do with fluster vectors. Signed-off-by: Guilherme Gallo Part-of: --- .../container/debian/x86_64_test-android.sh | 32 +++++++++++++------ .gitlab-ci/image-tags.yml | 2 +- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci/container/debian/x86_64_test-android.sh b/.gitlab-ci/container/debian/x86_64_test-android.sh index f19b51fa0d4..9a5e8f6cb68 100755 --- a/.gitlab-ci/container/debian/x86_64_test-android.sh +++ b/.gitlab-ci/container/debian/x86_64_test-android.sh @@ -162,19 +162,33 @@ section_end cuttlefish section_start android-cts "Downloading Android CTS" +# xtrace is getting lost with the section switching +set -x + ANDROID_CTS_VERSION="${ANDROID_VERSION}_r1" ANDROID_CTS_DEVICE_ARCH="x86" -curl -L --retry 4 -f --retry-all-errors --retry-delay 60 \ - -o "android-cts-${ANDROID_CTS_VERSION}-linux_x86-${ANDROID_CTS_DEVICE_ARCH}.zip" \ - "https://dl.google.com/dl/android/cts/android-cts-${ANDROID_CTS_VERSION}-linux_x86-${ANDROID_CTS_DEVICE_ARCH}.zip" -unzip -q -d / "android-cts-${ANDROID_CTS_VERSION}-linux_x86-${ANDROID_CTS_DEVICE_ARCH}.zip" -rm "android-cts-${ANDROID_CTS_VERSION}-linux_x86-${ANDROID_CTS_DEVICE_ARCH}.zip" +# Download the stripped CTS from S3, because the CTS download from Google can take 20 minutes +CTS_FILENAME="android-cts-${ANDROID_CTS_VERSION}-linux_x86-${ANDROID_CTS_DEVICE_ARCH}" +ARTIFACT_PATH="${DATA_STORAGE_PATH}/android-cts/${DEBIAN_TEST_ANDROID_TAG}--${CTS_FILENAME}.tar.zst" -# Keep only the interesting tests to save space -# shellcheck disable=SC2086 # we want word splitting -ANDROID_CTS_MODULES_KEEP_EXPRESSION=$(printf "%s|" $ANDROID_CTS_MODULES | sed -e 's/|$//g') -find /android-cts/testcases/ -mindepth 1 -type d | grep -v -E "$ANDROID_CTS_MODULES_KEEP_EXPRESSION" | xargs rm -rf +if FOUND_ARTIFACT_URL="$(find_s3_project_artifact "${ARTIFACT_PATH}")"; then + echo "Found Android CTS at: ${FOUND_ARTIFACT_URL}" + curl-with-retry "${FOUND_ARTIFACT_URL}" | tar --zstd -x -C / +else + echo "No cached CTS found, downloading from Google and uploading to S3..." + curl-with-retry --remote-name "https://dl.google.com/dl/android/cts/${CTS_FILENAME}.zip" + unzip -q -d / "${CTS_FILENAME}.zip" + rm "${CTS_FILENAME}.zip" + + # Keep only the interesting tests to save space + # shellcheck disable=SC2086 # we want word splitting + ANDROID_CTS_MODULES_KEEP_EXPRESSION=$(printf "%s|" $ANDROID_CTS_MODULES | sed -e 's/|$//g') + find /android-cts/testcases/ -mindepth 1 -type d | grep -v -E "$ANDROID_CTS_MODULES_KEEP_EXPRESSION" | xargs rm -rf + tar --zstd -cf "${CTS_FILENAME}.tar.zst" /android-cts + ci-fairy s3cp --token-file "${S3_JWT_FILE}" "${CTS_FILENAME}.tar.zst" \ + "https://${S3_BASE_PATH}/${CI_PROJECT_PATH}/${ARTIFACT_PATH}" +fi section_end android-cts diff --git a/.gitlab-ci/image-tags.yml b/.gitlab-ci/image-tags.yml index 121d0ef7896..6a5deb8e7f8 100644 --- a/.gitlab-ci/image-tags.yml +++ b/.gitlab-ci/image-tags.yml @@ -23,7 +23,7 @@ variables: DEBIAN_BUILD_TAG: "20250611-rust" - DEBIAN_TEST_ANDROID_TAG: "20250618-rootfs" + DEBIAN_TEST_ANDROID_TAG: "20250618-s3-cts" DEBIAN_TEST_GL_TAG: "20250616-vkcts-main" DEBIAN_TEST_VIDEO_TAG: "20250609-helper" DEBIAN_TEST_VK_TAG: "20250619-vkd3d"