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 <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-10-28 17:13:51 +01:00
1 parent 8f59d4dcff
commit 283cdd86bd
2 files changed
+8 -8

No files matched your search

+1 -1
View File
@@ -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 }}
+7 -7
View File
@@ -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