diff --git a/apps/base/forgejo/runner-amd64.yaml b/apps/base/forgejo/runner-amd64.yaml index 8f1fedc..82f3ec4 100644 --- a/apps/base/forgejo/runner-amd64.yaml +++ b/apps/base/forgejo/runner-amd64.yaml @@ -25,12 +25,6 @@ spec: matchLabels: app: forgejo-runner arch: amd64 - # RWO PVC: never two pods on one data-root. Consequence to know before you - # touch this template: a rollout SIGKILLs the job container of any run in - # flight, and Forgejo then reports that run as a plain failure with the log - # cut off mid-step (no `exitcode` line) — seen as a 14 min "failing" push on - # sirius/sirius-growth, card t_29249bf0. Land template changes while the - # runner is idle. strategy: type: Recreate template: @@ -93,20 +87,18 @@ spec: - | set -e chown 1000:1000 /data - # Re-own the trees the runner itself writes: runner.ini, the act - # cache (cache/) and the action-repo checkout cache (.cache/act/). - # The re-own MUST be recursive. A top-level owner check is exactly - # what let this through once: /data/.cache was already 1000 while - # the git packs inside it were still root:root from the pre-uid-1000 - # runner, so the guard skipped the one file that mattered and every - # job died in actions/checkout before any step ran: - # open /data/.cache/act/actions-checkout@v4/.git/objects/pack/ - # pack-.pack: permission denied - # (card t_29249bf0: 3 s red X, zero steps.) A few thousand small - # files; the dind data-root (/data/docker, tens of GB) stays - # root-owned and is deliberately not walked. - for d in /data/cache /data/.cache /data/runner.ini; do - if [ -e "$d" ]; then chown -R 1000:1000 "$d"; fi + # Re-own every entry the runner writes as uid 1000 — runner.ini, + # cache/ and the actions cache .cache/act/ where it clones the + # action repos (a stale root-owned pack file there fails the job + # with "permission denied"). Skip `docker`, the dind data-root, + # which stays root-owned: a recursive chown of that tree is tens + # of GB on the Pi. The owner check makes repeat starts cheap. + for d in /data/* /data/.[!.]*; do + if [ ! -e "$d" ]; then continue; fi + if [ "$d" = /data/docker ]; then continue; fi + if [ "$(stat -c %u "$d")" != 1000 ]; then + chown -R 1000:1000 "$d" + fi done true volumeMounts: diff --git a/apps/base/forgejo/runner-arm64.yaml b/apps/base/forgejo/runner-arm64.yaml index 6acbe81..4b16820 100644 --- a/apps/base/forgejo/runner-arm64.yaml +++ b/apps/base/forgejo/runner-arm64.yaml @@ -12,12 +12,7 @@ spec: matchLabels: app: forgejo-runner arch: arm64 - # RWO PVC: never two pods on one data-root. Consequence to know before you - # touch this template: a rollout SIGKILLs the job container of any run in - # flight, and Forgejo then reports that run as a plain failure with the log - # cut off mid-step (no `exitcode` line) — seen as a 14 min "failing" push on - # sirius/sirius-growth, card t_29249bf0. Land template changes while the - # runner is idle. + # RWO PVC: never two pods on one data-root. strategy: type: Recreate template: @@ -58,20 +53,18 @@ spec: - | set -e chown 1000:1000 /data - # Re-own the trees the runner itself writes: runner.ini, the act - # cache (cache/) and the action-repo checkout cache (.cache/act/). - # The re-own MUST be recursive. A top-level owner check is exactly - # what let this through once: /data/.cache was already 1000 while - # the git packs inside it were still root:root from the pre-uid-1000 - # runner, so the guard skipped the one file that mattered and every - # job died in actions/checkout before any step ran: - # open /data/.cache/act/actions-checkout@v4/.git/objects/pack/ - # pack-.pack: permission denied - # (card t_29249bf0: 3 s red X, zero steps.) A few thousand small - # files; the dind data-root (/data/docker, tens of GB) stays - # root-owned and is deliberately not walked. - for d in /data/cache /data/.cache /data/runner.ini; do - if [ -e "$d" ]; then chown -R 1000:1000 "$d"; fi + # Re-own every entry the runner writes as uid 1000 — runner.ini, + # cache/ and the actions cache .cache/act/ where it clones the + # action repos (a stale root-owned pack file there fails the job + # with "permission denied"). Skip `docker`, the dind data-root, + # which stays root-owned: a recursive chown of that tree is tens + # of GB on the Pi. The owner check makes repeat starts cheap. + for d in /data/* /data/.[!.]*; do + if [ ! -e "$d" ]; then continue; fi + if [ "$d" = /data/docker ]; then continue; fi + if [ "$(stat -c %u "$d")" != 1000 ]; then + chown -R 1000:1000 "$d" + fi done true volumeMounts: diff --git a/apps/base/forgejo/runner-deploy-arm64.yaml b/apps/base/forgejo/runner-deploy-arm64.yaml index 0656d8c..dc759cc 100644 --- a/apps/base/forgejo/runner-deploy-arm64.yaml +++ b/apps/base/forgejo/runner-deploy-arm64.yaml @@ -30,12 +30,6 @@ spec: matchLabels: app: forgejo-runner role: deploy - # RWO PVC: never two pods on one data-root. Consequence to know before you - # touch this template: a rollout SIGKILLs the job container of any run in - # flight, and Forgejo then reports that run as a plain failure with the log - # cut off mid-step (no `exitcode` line) — seen as a 14 min "failing" push on - # sirius/sirius-growth, card t_29249bf0. Land template changes while the - # runner is idle. strategy: type: Recreate template: @@ -98,20 +92,18 @@ spec: - | set -e chown 1000:1000 /data - # Re-own the trees the runner itself writes: runner.ini, the act - # cache (cache/) and the action-repo checkout cache (.cache/act/). - # The re-own MUST be recursive. A top-level owner check is exactly - # what let this through once: /data/.cache was already 1000 while - # the git packs inside it were still root:root from the pre-uid-1000 - # runner, so the guard skipped the one file that mattered and every - # job died in actions/checkout before any step ran: - # open /data/.cache/act/actions-checkout@v4/.git/objects/pack/ - # pack-.pack: permission denied - # (card t_29249bf0: 3 s red X, zero steps.) A few thousand small - # files; the dind data-root (/data/docker, tens of GB) stays - # root-owned and is deliberately not walked. - for d in /data/cache /data/.cache /data/runner.ini; do - if [ -e "$d" ]; then chown -R 1000:1000 "$d"; fi + # Re-own every entry the runner writes as uid 1000 — runner.ini, + # cache/ and the actions cache .cache/act/ where it clones the + # action repos (a stale root-owned pack file there fails the job + # with "permission denied"). Skip `docker`, the dind data-root, + # which stays root-owned: a recursive chown of that tree is tens + # of GB on the Pi. The owner check makes repeat starts cheap. + for d in /data/* /data/.[!.]*; do + if [ ! -e "$d" ]; then continue; fi + if [ "$d" = /data/docker ]; then continue; fi + if [ "$(stat -c %u "$d")" != 1000 ]; then + chown -R 1000:1000 "$d" + fi done true volumeMounts: