From 48a3cf58d5ad9cf2a4a4e6167171070b88c25369 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 19 May 2021 20:15:53 +0200 Subject: [PATCH 1/3] ci: work around #19442 to make CI happy again Let's introduce a somewhat ugly workaround for #19442 and retry the systemd-nspawn image boot test up to three times in case it dies with the dissect timeout. Since this issue occurs only in the Arch job, limit the workaround to this job only. --- .github/workflows/mkosi.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index c7508a5bd9..d1f9891062 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -48,8 +48,14 @@ jobs: - name: Build ${{ matrix.distro }} run: sudo python3 -m mkosi --password= --qemu-headless build + # Ugly workaround for systemd/systemd#19442 where systemd-nspawn + # occasionally fails with 'Failed to dissect image xxx: Connection timed out + - name: Retry the build if necessary + if: ${{ matrix.distro == 'arch' }} + run: echo "BUILD_RETRY_MAX=3" >> $GITHUB_ENV + - name: Boot ${{ matrix.distro }} systemd-nspawn - run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --qemu-headless boot + run: sudo -E bash +e -x -c 'for _ in $(seq 1 ${BUILD_RETRY_MAX:-1}); do ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --qemu-headless boot && break; done' - name: Boot ${{ matrix.distro }} QEMU run: sudo ./.github/workflows/test_mkosi_boot.py python3 -m mkosi --password= --qemu-headless qemu From 715a273b104c8cf58f9167e26ade5255c02e44a0 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 19 May 2021 21:29:42 +0200 Subject: [PATCH 2/3] ci: show image summary --- .github/workflows/mkosi.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/mkosi.yml b/.github/workflows/mkosi.yml index d1f9891062..d6b0566605 100644 --- a/.github/workflows/mkosi.yml +++ b/.github/workflows/mkosi.yml @@ -48,6 +48,9 @@ jobs: - name: Build ${{ matrix.distro }} run: sudo python3 -m mkosi --password= --qemu-headless build + - name: Show ${{ matrix.distro }} image summary + run: sudo python3 -m mkosi --password= --qemu-headless summary + # Ugly workaround for systemd/systemd#19442 where systemd-nspawn # occasionally fails with 'Failed to dissect image xxx: Connection timed out - name: Retry the build if necessary From 27b4d606780cef0d7259fb3e17362297f4033c43 Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 19 May 2021 22:03:38 +0200 Subject: [PATCH 3/3] ci: skip root tty login We use the `autologin` mkosi option (see mkosi.default.d/10-systemd.conf), so the pexpect root login throws a (harmless) error: ``` Arch Linux (built from systemd tree) Kernel 5.4.0-1047-azure on an x86_64 (console) image login: root (automatic login) root root [root@image ~]# systemctl poweroff root -bash: root: command not found [root@image ~]# systemctl poweroff ``` --- .github/workflows/test_mkosi_boot.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test_mkosi_boot.py b/.github/workflows/test_mkosi_boot.py index 37904eb059..3418fd3a51 100755 --- a/.github/workflows/test_mkosi_boot.py +++ b/.github/workflows/test_mkosi_boot.py @@ -8,9 +8,6 @@ import sys def run() -> None: p = pexpect.spawnu(" ".join(sys.argv[1:]), logfile=sys.stdout, timeout=300) - p.expect("login:") - p.sendline("root") - p.expect("#") p.sendline("systemctl poweroff")