ci(runners): re-own the actions cache recursively — uid-1000 jobs die in checkout #70
3 changed files with 60 additions and 37 deletions
|
|
@ -25,6 +25,12 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: forgejo-runner
|
app: forgejo-runner
|
||||||
arch: amd64
|
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:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
|
|
@ -87,18 +93,20 @@ spec:
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
chown 1000:1000 /data
|
chown 1000:1000 /data
|
||||||
# Re-own every entry the runner writes as uid 1000 — runner.ini,
|
# Re-own the trees the runner itself writes: runner.ini, the act
|
||||||
# cache/ and the actions cache .cache/act/ where it clones the
|
# cache (cache/) and the action-repo checkout cache (.cache/act/).
|
||||||
# action repos (a stale root-owned pack file there fails the job
|
# The re-own MUST be recursive. A top-level owner check is exactly
|
||||||
# with "permission denied"). Skip `docker`, the dind data-root,
|
# what let this through once: /data/.cache was already 1000 while
|
||||||
# which stays root-owned: a recursive chown of that tree is tens
|
# the git packs inside it were still root:root from the pre-uid-1000
|
||||||
# of GB on the Pi. The owner check makes repeat starts cheap.
|
# runner, so the guard skipped the one file that mattered and every
|
||||||
for d in /data/* /data/.[!.]*; do
|
# job died in actions/checkout before any step ran:
|
||||||
if [ ! -e "$d" ]; then continue; fi
|
# open /data/.cache/act/actions-checkout@v4/.git/objects/pack/
|
||||||
if [ "$d" = /data/docker ]; then continue; fi
|
# pack-<id>.pack: permission denied
|
||||||
if [ "$(stat -c %u "$d")" != 1000 ]; then
|
# (card t_29249bf0: 3 s red X, zero steps.) A few thousand small
|
||||||
chown -R 1000:1000 "$d"
|
# files; the dind data-root (/data/docker, tens of GB) stays
|
||||||
fi
|
# 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
|
||||||
done
|
done
|
||||||
true
|
true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,12 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: forgejo-runner
|
app: forgejo-runner
|
||||||
arch: arm64
|
arch: arm64
|
||||||
# RWO PVC: never two pods on one data-root.
|
# 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:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
|
|
@ -53,18 +58,20 @@ spec:
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
chown 1000:1000 /data
|
chown 1000:1000 /data
|
||||||
# Re-own every entry the runner writes as uid 1000 — runner.ini,
|
# Re-own the trees the runner itself writes: runner.ini, the act
|
||||||
# cache/ and the actions cache .cache/act/ where it clones the
|
# cache (cache/) and the action-repo checkout cache (.cache/act/).
|
||||||
# action repos (a stale root-owned pack file there fails the job
|
# The re-own MUST be recursive. A top-level owner check is exactly
|
||||||
# with "permission denied"). Skip `docker`, the dind data-root,
|
# what let this through once: /data/.cache was already 1000 while
|
||||||
# which stays root-owned: a recursive chown of that tree is tens
|
# the git packs inside it were still root:root from the pre-uid-1000
|
||||||
# of GB on the Pi. The owner check makes repeat starts cheap.
|
# runner, so the guard skipped the one file that mattered and every
|
||||||
for d in /data/* /data/.[!.]*; do
|
# job died in actions/checkout before any step ran:
|
||||||
if [ ! -e "$d" ]; then continue; fi
|
# open /data/.cache/act/actions-checkout@v4/.git/objects/pack/
|
||||||
if [ "$d" = /data/docker ]; then continue; fi
|
# pack-<id>.pack: permission denied
|
||||||
if [ "$(stat -c %u "$d")" != 1000 ]; then
|
# (card t_29249bf0: 3 s red X, zero steps.) A few thousand small
|
||||||
chown -R 1000:1000 "$d"
|
# files; the dind data-root (/data/docker, tens of GB) stays
|
||||||
fi
|
# 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
|
||||||
done
|
done
|
||||||
true
|
true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,12 @@ spec:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: forgejo-runner
|
app: forgejo-runner
|
||||||
role: deploy
|
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:
|
strategy:
|
||||||
type: Recreate
|
type: Recreate
|
||||||
template:
|
template:
|
||||||
|
|
@ -92,18 +98,20 @@ spec:
|
||||||
- |
|
- |
|
||||||
set -e
|
set -e
|
||||||
chown 1000:1000 /data
|
chown 1000:1000 /data
|
||||||
# Re-own every entry the runner writes as uid 1000 — runner.ini,
|
# Re-own the trees the runner itself writes: runner.ini, the act
|
||||||
# cache/ and the actions cache .cache/act/ where it clones the
|
# cache (cache/) and the action-repo checkout cache (.cache/act/).
|
||||||
# action repos (a stale root-owned pack file there fails the job
|
# The re-own MUST be recursive. A top-level owner check is exactly
|
||||||
# with "permission denied"). Skip `docker`, the dind data-root,
|
# what let this through once: /data/.cache was already 1000 while
|
||||||
# which stays root-owned: a recursive chown of that tree is tens
|
# the git packs inside it were still root:root from the pre-uid-1000
|
||||||
# of GB on the Pi. The owner check makes repeat starts cheap.
|
# runner, so the guard skipped the one file that mattered and every
|
||||||
for d in /data/* /data/.[!.]*; do
|
# job died in actions/checkout before any step ran:
|
||||||
if [ ! -e "$d" ]; then continue; fi
|
# open /data/.cache/act/actions-checkout@v4/.git/objects/pack/
|
||||||
if [ "$d" = /data/docker ]; then continue; fi
|
# pack-<id>.pack: permission denied
|
||||||
if [ "$(stat -c %u "$d")" != 1000 ]; then
|
# (card t_29249bf0: 3 s red X, zero steps.) A few thousand small
|
||||||
chown -R 1000:1000 "$d"
|
# files; the dind data-root (/data/docker, tens of GB) stays
|
||||||
fi
|
# 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
|
||||||
done
|
done
|
||||||
true
|
true
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue