From 283cdd86bd143adc021b45f3798e8b4a67ef632f Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 28 Oct 2026 17:13:51 +0100 Subject: [PATCH] fix(ci): keep the inventory artifact and the first error on a budget kill A compose job that runs out of its distro budget is stopped by `timeout -k 60` in distros.sh: SIGTERM at the deadline, SIGKILL 60 s later. dedicated.sh's cleanup trap copied the generated inventory out of the DinD container only after the rescue capture, which alone took 266 s in Baserow#0 (run 40625679270), so the kill always landed first. The zip step then failed with "No inventory found", never wrote INVENTORY_ZIP, and the upload step failed again on an empty `path`; two follow-up errors buried the real `rc=137`. Nextcloud#0 and #2 of the same run show the same trio. - The inventory copy moves unchanged to the top of the trap, ahead of the Playwright copy and the rescue capture; the three write to disjoint directories and none reads another's output. - The zip step writes INVENTORY_ZIP before running the zip script, so a missing zip falls under the upload's existing `if-no-files-found: ignore` instead of failing the step a second time. The budget overrun itself came from the docs README replay pulled into the round through partners, which 91022ad37a removes. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/call-test-deploy.yml | 2 +- scripts/tests/deploy/ci/dedicated.sh | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/call-test-deploy.yml b/.github/workflows/call-test-deploy.yml index c379c43535..3444c3bc55 100644 --- a/.github/workflows/call-test-deploy.yml +++ b/.github/workflows/call-test-deploy.yml @@ -448,8 +448,8 @@ jobs: set -euo pipefail kind=swarm [ "${{ matrix.mode }}" = "swarm" ] || kind=compose - bash "scripts/github/inventory/zip/${kind}_for_upload.sh" echo "INVENTORY_ZIP=/tmp/inventory-${kind}-${APP_ID}.zip" >> "$GITHUB_ENV" + bash "scripts/github/inventory/zip/${kind}_for_upload.sh" - name: "⬆️ Upload inventory artifact" if: ${{ always() && !env.ACT }} diff --git a/scripts/tests/deploy/ci/dedicated.sh b/scripts/tests/deploy/ci/dedicated.sh index d3e377d22a..df4e3df9fd 100755 --- a/scripts/tests/deploy/ci/dedicated.sh +++ b/scripts/tests/deploy/ci/dedicated.sh @@ -65,6 +65,13 @@ echo "=== distro=${INFINITO_DISTRO} app=${apps} (debug always on) ===" cleanup() { rc=$? + local _inv_parent + _inv_parent="$(dirname "${INFINITO_INVENTORY_DIR}")" + echo ">>> Copying generated inventory from ${INFINITO_CONTAINER} to host ${_inv_parent}" + mkdir -p "${_inv_parent}" + # nocheck: container-cp - container-to-host extraction on the CI host itself + docker cp "${INFINITO_CONTAINER}:${_inv_parent}/." "${_inv_parent}/" 2>/dev/null || true # nocheck: shell-or-true -- grandfathered: worked in practice; TODO: sharpen to catch only the exact tolerated error + local _playwright_host_dir="/tmp/playwright-artifacts/${INFINITO_DISTRO}/${apps}" mkdir -p "${_playwright_host_dir}" echo ">>> Copying Playwright artifacts from ${INFINITO_CONTAINER} to ${_playwright_host_dir}" @@ -96,13 +103,6 @@ cleanup() { bash scripts/tests/deploy/utils/rescue_index.sh "${_rescue_host_dir}" - local _inv_parent - _inv_parent="$(dirname "${INFINITO_INVENTORY_DIR}")" - echo ">>> Copying generated inventory from ${INFINITO_CONTAINER} to host ${_inv_parent}" - mkdir -p "${_inv_parent}" - # nocheck: container-cp - container-to-host extraction on the CI host itself - docker cp "${INFINITO_CONTAINER}:${_inv_parent}/." "${_inv_parent}/" 2>/dev/null || true # nocheck: shell-or-true -- grandfathered: worked in practice; TODO: sharpen to catch only the exact tolerated error - echo ">>> Removing stack for distro ${INFINITO_DISTRO} (fresh start for next distro)" "${PYTHON}" -m cli.administration.deploy.development down || true # nocheck: shell-or-true -- grandfathered: worked in practice; TODO: sharpen to catch only the exact tolerated error