From c3e2ad8a8344eced1c37b8c575cc1275908f48dd Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Tue, 12 Sep 2023 17:22:19 -0400 Subject: [PATCH 1/6] test/main: report disk usage (df -h) prior to actually cleaning up Signed-off-by: Simon Deziel --- test/main.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/main.sh b/test/main.sh index befe36755c90..bbf3498aafe5 100755 --- a/test/main.sh +++ b/test/main.sh @@ -83,6 +83,10 @@ cleanup() { read -r _ fi + echo "" + echo "df -h output:" + df -h + if [ -n "${GITHUB_ACTIONS:-}" ]; then echo "==> Skipping cleanup (GitHub Action runner detected)" else From 69596da1d647f812859dd6383d9bb008d9d7b88f Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 13 Sep 2023 13:32:22 -0400 Subject: [PATCH 2/6] test/backends/ceph: lower OSD pg_num to 8 This is an attempt to improve the reliability of the test suite that often times out during the ceph pool setup: > 2023-09-12T17:14:09.3105279Z + timeout --foreground 120 /home/runner/go/bin/lxc storage create lxdtest-gOl ceph volume.size=25MiB ceph.osd.pg_num=16 --verbose > 2023-09-12T17:16:09.3132429Z + cleanup g_num=16 Signed-off-by: Simon Deziel --- test/backends/ceph.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/backends/ceph.sh b/test/backends/ceph.sh index 189566be1060..4d5511f33e93 100644 --- a/test/backends/ceph.sh +++ b/test/backends/ceph.sh @@ -15,7 +15,7 @@ ceph_configure() { echo "==> Configuring CEPH backend in ${LXD_DIR}" - lxc storage create "lxdtest-$(basename "${LXD_DIR}")" ceph volume.size=25MiB ceph.osd.pg_num=16 + lxc storage create "lxdtest-$(basename "${LXD_DIR}")" ceph volume.size=25MiB ceph.osd.pg_num=8 lxc profile device add default root disk path="/" pool="lxdtest-$(basename "${LXD_DIR}")" } From 1879ed5a01b9ae45d6986c1c2d6292ced3f5d51d Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 13 Sep 2023 14:52:03 -0400 Subject: [PATCH 3/6] github: action runners already have snapd installed Signed-off-by: Simon Deziel --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 123e9b7f5ff6..1d00db735c88 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -218,7 +218,7 @@ jobs: if: ${{ matrix.backend == 'ceph' }} run: | set -x - sudo apt-get install --no-install-recommends -y snapd ceph-common + sudo apt-get install --no-install-recommends -y ceph-common sudo snap install microceph --edge sleep 5 sudo microceph cluster bootstrap From cdac28d44cacda39732e1f2c5341242ba3bfe2e6 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 13 Sep 2023 16:22:18 -0400 Subject: [PATCH 4/6] github: remove core20 to reclaim some space in the rootfs `mdl` depends on `core18` and the `microceph` on `core22` Signed-off-by: Simon Deziel --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d00db735c88..eb5b700b69d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -150,6 +150,7 @@ jobs: sudo apt-get update sudo snap remove lxd --purge + sudo snap remove core20 --purge || true sudo apt-get autopurge moby-containerd docker uidmap -y sudo ip link delete docker0 sudo nft flush ruleset From af97ea43f6bc6cc43f49af64b51d3e44ee4a144e Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 13 Sep 2023 14:59:46 -0400 Subject: [PATCH 5/6] github: use the whole ephemeral disk as ceph OSD Signed-off-by: Simon Deziel --- .github/workflows/tests.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb5b700b69d5..cc00749c9d07 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -231,17 +231,11 @@ jobs: for flag in nosnaptrim noscrub nobackfill norebalance norecover noscrub nodeep-scrub; do sudo microceph.ceph osd set $flag done - # Use ephemeral disk mounted on /mnt for ceph OSD. - # The block-devices plug doesn't allow accessing /dev/loopX devices so we make those same devices - # available under alternate names (/dev/sdiY) that are not used inside GitHub Action runners. + # Repurpose the ephemeral disk for ceph OSD. sudo swapoff /mnt/swapfile - sudo rm -f /mnt/swapfile - loop_file="/mnt/ceph-osd.img" - sudo fallocate -l 10G "${loop_file}" - loop_dev="$(sudo losetup --show --direct-io=on --nooverlap -f "${loop_file}")" - devInfo=($(sudo stat -c '%t %T' "${loop_dev}")) - sudo mknod -m 0660 /dev/sdia b 0x"${devInfo[0]}" 0x"${devInfo[1]}" - sudo microceph disk add --wipe /dev/sdia + ephemeral_disk="$(findmnt --noheadings --output SOURCE --target /mnt | sed 's/[0-9]\+$//')" + sudo umount /mnt + sudo microceph disk add --wipe "${ephemeral_disk}" sudo rm -rf /etc/ceph sudo ln -s /var/snap/microceph/current/conf/ /etc/ceph sudo microceph enable rgw From 65695816a095de0cfef91f475cc0e9d75a3a1019 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Wed, 13 Sep 2023 16:37:30 -0400 Subject: [PATCH 6/6] github: instruct curl to fail on error when downloading gotip This avoid saving the 404 XML error if the commit hash is wrong/not available: > $ cat gotip.tar.gz > NoSuchKey > The specified key does not exist.
No such object: > go-build-snap/go/linux-amd64/.tar.gz
As that would later on be feed to `tar`/`gzip`: gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now Signed-off-by: Simon Deziel --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cc00749c9d07..ec5513772a59 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -134,7 +134,7 @@ jobs: - name: Install Go (tip) run: | - curl -sL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz + curl -sSfL https://storage.googleapis.com/go-build-snap/go/linux-amd64/$(git ls-remote https://github.com/golang/go.git HEAD | awk '{print $1;}').tar.gz -o gotip.tar.gz ls -lah gotip.tar.gz mkdir -p ~/sdk/gotip tar -C ~/sdk/gotip -xzf gotip.tar.gz