diff --git a/.gitlab-ci/conditional-build-image-tags.yml b/.gitlab-ci/conditional-build-image-tags.yml index 707206f6571..80a749090d4 100644 --- a/.gitlab-ci/conditional-build-image-tags.yml +++ b/.gitlab-ci/conditional-build-image-tags.yml @@ -1,5 +1,5 @@ variables: - CONDITIONAL_BUILD_ANDROID_CTS_TAG: 363c33efa7f381a9be0d4c6af2dfaa1d + CONDITIONAL_BUILD_ANDROID_CTS_TAG: 3e87ed2c4c2d00d764321eb26dd70f48 CONDITIONAL_BUILD_ANGLE_TAG: 6ab21f6e04363ee652c71461e7fbe5f7 CONDITIONAL_BUILD_CROSVM_TAG: 7edabf28bbd50e00558e3b0bb2d94255 CONDITIONAL_BUILD_FLUSTER_TAG: e13f8521875ebd70e207ec0f6f3d3e5b diff --git a/.gitlab-ci/container/build-android-cts.sh b/.gitlab-ci/container/build-android-cts.sh index 4edaa904a0f..d822029d834 100644 --- a/.gitlab-ci/container/build-android-cts.sh +++ b/.gitlab-ci/container/build-android-cts.sh @@ -32,11 +32,15 @@ ANDROID_CTS_MODULES=( ) ANDROID_CTS_VERSION="${ANDROID_VERSION}_r5" -ANDROID_CTS_DEVICE_ARCH="x86" + +case "$ANDROID_ARCH" in + x86_64) ANDROID_CTS_ARCH=x86;; + arm64) ANDROID_CTS_ARCH=arm;; +esac # 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/${ANDROID_CTS_TAG}.tar.zst" +CTS_FILENAME="android-cts-${ANDROID_CTS_VERSION}-linux_x86-${ANDROID_CTS_ARCH}" +ARTIFACT_PATH="${DATA_STORAGE_PATH}/android-cts/${DEBIAN_ARCH}/${ANDROID_CTS_TAG}.tar.zst" if FOUND_ARTIFACT_URL="$(find_s3_project_artifact "${ARTIFACT_PATH}")"; then echo "Found Android CTS at: ${FOUND_ARTIFACT_URL}" @@ -56,6 +60,13 @@ else 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 + # Android CTS bundles a JDK for x86_64 hosts. + # Replace this with the JDK we installed. + if [ "${DEBIAN_ARCH}" = "arm64" ]; then + rm -rf /android-cts/jdk + mv /usr/lib/jvm/java-21-openjdk-arm64 /android-cts/jdk + fi + # Using zstd compressed tarball instead of zip, the compression ratio is almost the same, but # the extraction is faster, also LAVA overlays don't support zip compression. tar --zstd -cf "${CTS_FILENAME}.tar.zst" /android-cts diff --git a/.gitlab-ci/container/debian/test-android.sh b/.gitlab-ci/container/debian/test-android.sh index 8ecad167af3..26d22bd903c 100755 --- a/.gitlab-ci/container/debian/test-android.sh +++ b/.gitlab-ci/container/debian/test-android.sh @@ -55,7 +55,9 @@ if "${BUILD_CONTAINER}"; then ) else # We only need the build tools in build containers - EPHEMERAL=() + EPHEMERAL=( + unzip + ) fi if "${TEST_CONTAINER}"; then @@ -66,6 +68,10 @@ if "${TEST_CONTAINER}"; then cuttlefish-user iproute2 ) + # Android CTS only comes with x86_64 Java bundled, so we need to install it on arm64 + if [ "${DEBIAN_ARCH}" = "arm64" ]; then + DEPS+=(openjdk-21-jdk-headless) + fi else DEPS=() fi @@ -203,8 +209,7 @@ fi ############### Downloading Android CTS -# We currently only have x86_64 CTS jobs -if [ "${ANDROID_ARCH}" = "x86_64" ]; then +if "${TEST_CONTAINER}"; then . .gitlab-ci/container/build-android-cts.sh fi @@ -239,6 +244,12 @@ if "${BUILD_CONTAINER}"; then rm -rf "/${ndk:?}" fi +# We currently only have LAVA jobs on arm64, where we deploy Android CTS as a LAVA overlay. +# Remove it from the container image to save some space. +if "${TEST_CONTAINER}" && [ "${DEBIAN_ARCH}" = "arm64" ]; then + rm -rf "/android-cts" +fi + apt-get purge -y "${EPHEMERAL[@]}" . .gitlab-ci/container/container_post_build.sh diff --git a/.gitlab-ci/lava/lava-submit.sh b/.gitlab-ci/lava/lava-submit.sh index 43cf198c9a5..528c903cc5e 100755 --- a/.gitlab-ci/lava/lava-submit.sh +++ b/.gitlab-ci/lava/lava-submit.sh @@ -83,7 +83,7 @@ if [ -n "${ANDROID_CTS_TAG:-}" ]; then LAVA_EXTRA_OVERLAYS+=( - append-overlay --name=android-cts - --url="$(fdo_find_s3_path "${DATA_STORAGE_PATH}/android-cts/${ANDROID_CTS_TAG}.tar.zst")" + --url="$(fdo_find_s3_path "${DATA_STORAGE_PATH}/android-cts/${DEBIAN_ARCH}/${ANDROID_CTS_TAG}.tar.zst")" --path="/" --format=tar --compression=zstd