fix(cleanup): per-run 缓存清理改容器 root 执行(PLAT-014,坑 #18 同族)
宿主 08-30 治理后为非 root gitea-runner,rm 容器 root 属主缓存文件必 EACCES (Seabed run 917 两 attempt 测试全绿、清理步必死)。复用 job 已拉的 node-image find -mindepth 1 -delete + 宿主 rmdir 自建目录。v3 不动;合并后打 v4, per-run 调用方(Seabed)升 @v4,fixed 调用方(Reef)可留 @v3。
This commit is contained in:
@@ -143,6 +143,19 @@ jobs:
|
||||
$env_args \
|
||||
"${{ inputs.node-image }}" sh -euxc '${{ inputs.install-command }} && ${{ inputs.quality-command }}'
|
||||
|
||||
- name: cleanup per-run cache dir
|
||||
# PLAT-014: the helper container writes root-owned files (tsx workers,
|
||||
# playwright, compile caches) into the per-run cache mount; the host job
|
||||
# runs as non-root gitea-runner since the 2026-08-30 runner governance,
|
||||
# so a host-side rm -rf fails with EACCES and reds the job (playbook #18
|
||||
# family). Clean as container root using the image this job already
|
||||
# pulled, then rmdir the host-created directory itself.
|
||||
- name: cleanup per-run cache dir (container root)
|
||||
if: always() && inputs.cache-mode == 'per-run'
|
||||
run: rm -rf -- "${TOOL_CACHE_DIR:-}"
|
||||
run: |
|
||||
set -eu
|
||||
[ -n "${TOOL_CACHE_DIR:-}" ] || exit 0
|
||||
docker run --rm \
|
||||
-v "${TOOL_CACHE_DIR}":/cleanup-root \
|
||||
"${{ inputs.node-image }}" \
|
||||
find /cleanup-root -mindepth 1 -delete
|
||||
rmdir "${TOOL_CACHE_DIR}"
|
||||
|
||||
@@ -305,6 +305,15 @@ jobs:
|
||||
} >>"${GITHUB_STEP_SUMMARY:-/dev/stdout}"
|
||||
cat "$digest_file"
|
||||
|
||||
- name: cleanup per-run cache dir
|
||||
# PLAT-014: same ownership fix as node-quality — see the comment there
|
||||
# (host non-root runner cannot rm container-root-owned cache files).
|
||||
- name: cleanup per-run cache dir (container root)
|
||||
if: always() && inputs.build-command != '' && inputs.cache-mode == 'per-run'
|
||||
run: rm -rf -- "${TOOL_CACHE_DIR:-}"
|
||||
run: |
|
||||
set -eu
|
||||
[ -n "${TOOL_CACHE_DIR:-}" ] || exit 0
|
||||
docker run --rm \
|
||||
-v "${TOOL_CACHE_DIR}":/cleanup-root \
|
||||
"${{ inputs.node-image }}" \
|
||||
find /cleanup-root -mindepth 1 -delete
|
||||
rmdir "${TOOL_CACHE_DIR}"
|
||||
|
||||
@@ -33,6 +33,7 @@ jobs:
|
||||
## 迁移与同步
|
||||
|
||||
- 2026-08-27 定稿:曾按初版决策试建 est/ci-workflows,因 est org 私有闸门不可跨仓调用而删除(用户改批 mu-ref 宿主);同日自 est/Est-Infra 上移 tools/ci。
|
||||
- 2026-08-31 v4(PLAT-014,Issue #75):per-run 缓存清理步改容器 root 执行(node-image `find /cleanup-root -mindepth 1 -delete` + 宿主 `rmdir`)——08-30 非 root runner 治理后宿主 rm 撞容器 root 属主文件必 EACCES(坑 #18 同族,Seabed run 917 两次复现);v3 保持不动,per-run 调用方(est/Seabed)应升 @v4,fixed 模式调用方(est/Reef)无清理步可留 @v3。
|
||||
- 2026-08-29 v3:模板 checkout 恢复 mu-ref/actions-checkout@v4(JS action)+ HEAD==SHA postcondition——P1-10 的 JS 迁移(est/Est-Infra@57cc9f7,08-27 09:39)在 08-27 12:07 上移建仓时被回退为 P1-7 host-clone fallback 血统,v3 恢复并经 Seabed 私仓探针验证;无调用方的孤儿模板 `reusable/checkout.yml` 删除(reusable 不可嵌套调用,其守卫已内联进两个模板)。
|
||||
- helper Dockerfile 的可复现 bake 与 ops 巡检脚本仍属项目级(Est-Infra / gitea-host-setup)。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user