From 368237276439d93a8437d0a45d8535c91dac2406 Mon Sep 17 00:00:00 2001 From: Dennis Kempin Date: Thu, 25 Feb 2021 14:57:27 -0800 Subject: [PATCH] ci: Upgrade test-vm to debian bullseye This change updates the test VM to debian bullseye, primarily to enable io_uring features that are not available in the 4.16 kernel shipping with debian buster. We are not updating the builder containers to bullseye, as newer versions of qemu fail to start on kokoro. See b/181359683 Since it was needed for debugging this CL, it includes a feature to debug kokoro builders via SSH. It can be enabled by setting DEBUG_SSH_KEY from the fusion2 UI. BUG=b:178228512 TEST=./test_all passes Change-Id: I22f1678577183a0aace80245a87c31907221cc09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2721062 Reviewed-by: Daniel Verkamp Reviewed-by: Zach Reizner Tested-by: kokoro Commit-Queue: Dennis Kempin --- ci/crosvm_test_vm/Dockerfile | 2 +- ci/crosvm_test_vm/build/cloud_init_data.yaml | 18 ------------------ ci/image_tag | 2 +- ci/kokoro/common.sh | 19 +++++++++++++++++++ 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/ci/crosvm_test_vm/Dockerfile b/ci/crosvm_test_vm/Dockerfile index 9974052147..97be9825e4 100644 --- a/ci/crosvm_test_vm/Dockerfile +++ b/ci/crosvm_test_vm/Dockerfile @@ -24,7 +24,7 @@ RUN apt-get update && apt-get install --yes \ WORKDIR /workspace/vm RUN curl -sSfL -o rootfs.qcow2 \ - "https://cdimage.debian.org/cdimage/cloud/buster/20201214-484/debian-10-generic-${VM_ARCH}-20201214-484.qcow2" + "http://cloud.debian.org/images/cloud/bullseye/daily/20210208-542/debian-11-generic-${VM_ARCH}-daily-20210208-542.qcow2" # Package `cloud_init_data.yaml` to be loaded during `first_boot.expect` COPY build/cloud_init_data.yaml ./ diff --git a/ci/crosvm_test_vm/build/cloud_init_data.yaml b/ci/crosvm_test_vm/build/cloud_init_data.yaml index 5544d5f2e4..63dac25b47 100644 --- a/ci/crosvm_test_vm/build/cloud_init_data.yaml +++ b/ci/crosvm_test_vm/build/cloud_init_data.yaml @@ -12,12 +12,6 @@ users: crosvm@localhost groups: kvm, disk, tty -apt: - sources: - testing: - source: "deb $MIRROR bullseye main" - conf: APT::Default-Release "stable"; - # Store working data on tmpfs to reduce unnecessary disk IO mounts: - [swap, null] @@ -37,18 +31,6 @@ packages: - rsync runcmd: - # Install testing (debian bullseye) versions of some libraries. - - [ - apt-get, - install, - --yes, - -t, - testing, - --no-install-recommends, - libdrm2, - libepoxy0, - ] - # Trim some fat - [apt-get, remove, --yes, vim-runtime, iso-codes, perl, grub-common] - [apt-get, autoremove, --yes] diff --git a/ci/image_tag b/ci/image_tag index 75d30fb532..9742708e66 100644 --- a/ci/image_tag +++ b/ci/image_tag @@ -1 +1 @@ -r0001 +r0002 diff --git a/ci/kokoro/common.sh b/ci/kokoro/common.sh index 54aba174f1..744517d4f4 100755 --- a/ci/kokoro/common.sh +++ b/ci/kokoro/common.sh @@ -5,6 +5,19 @@ crosvm_root="${KOKORO_ARTIFACTS_DIR}"/git/crosvm +# Enable SSH access to the kokoro builder. +# Use the fusion2/ UI to trigger a build and set the DEBUG_SSH_KEY environment +# variable to your public key, that will allow you to connect to the builder +# via SSH. +# Note: Access is restricted to the google corporate network. +# Details: https://yaqs.corp.google.com/eng/q/6628551334035456 +if [[ ! -z "${DEBUG_SSH_KEY}" ]]; then + echo "${DEBUG_SSH_KEY}" >> ~/.ssh/authorized_keys + external_ip=$(curl -s -H "Metadata-Flavor: Google" + http://metadata/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip) + echo "SSH Debug enabled. Connect to: kbuilder@${external_ip}" +fi + setup_source() { if [ -z "${KOKORO_ARTIFACTS_DIR}" ]; then echo "This script must be run in kokoro" @@ -45,6 +58,12 @@ setup_source() { } cleanup() { + # Sleep after the build to allow for SSH debugging to continue. + if [[ ! -z "${DEBUG_SSH_KEY}" ]]; then + echo "Build done. Blocking for SSH debugging." + sleep 1h + fi + if command -v bindfs >/dev/null; then fusermount -uz "${KOKORO_ARTIFACTS_DIR}/cros/src/platform/crosvm" else