diff --git a/scripts/run_integration_tests_aarch64.sh b/scripts/run_integration_tests_aarch64.sh index 3d485716e..7e3d204d7 100755 --- a/scripts/run_integration_tests_aarch64.sh +++ b/scripts/run_integration_tests_aarch64.sh @@ -154,8 +154,8 @@ update_workloads() { fi popd || exit - # Build custom kernel for guest VMs - build_custom_linux + # Download prebuild linux binaries + download_linux # Update the kernel in the cloud image for some tests that requires recent kernel version FOCAL_OS_RAW_IMAGE_UPDATE_KERNEL_NAME="focal-server-cloudimg-arm64-custom-20210929-0-update-kernel.raw" diff --git a/scripts/run_integration_tests_live_migration.sh b/scripts/run_integration_tests_live_migration.sh index 84986474b..ad0a4f404 100755 --- a/scripts/run_integration_tests_live_migration.sh +++ b/scripts/run_integration_tests_live_migration.sh @@ -56,7 +56,8 @@ popd || exit # Build custom kernel based on virtio-pmem and virtio-fs upstream patches VMLINUX_IMAGE="$WORKLOADS_DIR/vmlinux" if [ ! -f "$VMLINUX_IMAGE" ]; then - build_custom_linux + # Download prebuild linux binaries + download_linux fi CFLAGS="" diff --git a/scripts/run_integration_tests_rate_limiter.sh b/scripts/run_integration_tests_rate_limiter.sh index ca4408c2c..be008625f 100755 --- a/scripts/run_integration_tests_rate_limiter.sh +++ b/scripts/run_integration_tests_rate_limiter.sh @@ -44,7 +44,8 @@ if ! grep focal sha1sums-x86_64 | sha1sum --check; then fi popd || exit -build_custom_linux +# Download prebuild linux binaries +download_linux CFLAGS="" if [[ "${BUILD_TARGET}" == "x86_64-unknown-linux-musl" ]]; then diff --git a/scripts/run_integration_tests_x86_64.sh b/scripts/run_integration_tests_x86_64.sh index 063dae51e..27eb156a0 100755 --- a/scripts/run_integration_tests_x86_64.sh +++ b/scripts/run_integration_tests_x86_64.sh @@ -102,7 +102,8 @@ popd || exit # Build custom kernel based on virtio-pmem and virtio-fs upstream patches VMLINUX_IMAGE="$WORKLOADS_DIR/vmlinux" if [ ! -f "$VMLINUX_IMAGE" ]; then - build_custom_linux + # Download prebuild linux binaries + download_linux fi VIRTIOFSD="$WORKLOADS_DIR/virtiofsd" diff --git a/scripts/run_metrics.sh b/scripts/run_metrics.sh index 24deb7cfe..f244eb62d 100755 --- a/scripts/run_metrics.sh +++ b/scripts/run_metrics.sh @@ -80,8 +80,8 @@ if [ "${TEST_ARCH}" == "aarch64" ]; then guestunmount "$FOCAL_OS_RAW_IMAGE_UPDATE_TOOL_ROOT_DIR" fi -# Build custom kernel based on virtio-pmem and virtio-fs upstream patches -build_custom_linux +# Download prebuild linux binaries +download_linux CFLAGS="" if [[ "${BUILD_TARGET}" == "${TEST_ARCH}-unknown-linux-musl" ]]; then diff --git a/scripts/test-util.sh b/scripts/test-util.sh index 53b6c5f1e..829b1b009 100644 --- a/scripts/test-util.sh +++ b/scripts/test-util.sh @@ -42,6 +42,7 @@ checkout_repo() { fi } +# Not actively used by CI build_custom_linux() { ARCH=$(uname -m) SRCDIR=$PWD @@ -130,6 +131,24 @@ download_hypervisor_fw() { popd || exit } +download_linux() { + if [ -n "$AUTH_DOWNLOAD_TOKEN" ]; then + echo "Using authenticated download from GitHub" + KERNEL_URLS=$(curl --silent https://api.github.com/repos/cloud-hypervisor/linux/releases/latest \ + --header "Authorization: Token $AUTH_DOWNLOAD_TOKEN" \ + --header "X-GitHub-Api-Version: 2022-11-28" | grep "browser_download_url" | grep -o 'https://.*[^ "]') + else + echo "Using anonymous download from GitHub" + KERNEL_URLS=$(curl --silent https://api.github.com/repos/cloud-hypervisor/linux/releases/latest | grep "browser_download_url" | grep -o 'https://.*[^ "]') + fi + pushd "$WORKLOADS_DIR" || exit + for url in $KERNEL_URLS; do + wget --quiet "$url" || exit 1 + done + + popd || exit +} + download_ovmf() { OVMF_FW_TAG="ch-6624aa331f" OVMF_FW_URL="https://github.com/cloud-hypervisor/edk2/releases/download/$OVMF_FW_TAG/CLOUDHV.fd"