Commit bd3f737
committed
Stop chowning all of ${RUNNER_TEMP} in linux_job_v2
${RUNNER_TEMP} also holds the runner's own control files --
_github_workflow/event.json, _runner_file_commands/ -- and the recursive
chown we issue from inside an alpine container is not guaranteed to land
on the runner's UID.
On a runner whose docker daemon remaps container UIDs it does not. The
gfx1100 ROCm runners (ctr-navi3x-b13-ws*) run rootless docker (`docker
info` reports DockerRootDir=/home/pytorchci/.local/share/docker), where
container UID 0 maps to the host runner user and container UID N>0 maps
into that user's subuid range. `chown -R $(id -u)` -- the runner's *host*
UID, expanded outside the container -- therefore lands on a subordinate
UID that nothing on the host owns. The runner then cannot read
event.json, and every remaining step of the job fails with
##[error]Access to the path
'/home/pytorchci/actions-runner/_work/_temp/_github_workflow/event.json'
is denied.
Chown only the three directories we actually hand to the container:
$RUNNER_ARTIFACT_DIR, $RUNNER_DOCS_DIR and $RUNNER_TEST_RESULTS_DIR.
Those are the bind mounts the exec container writes to as root, so they
are the only ones that need restoring, and none of them belong to the
runner. setup-linux, setup-rocm and setup-xpu all set the three env vars
to ${RUNNER_TEMP}/{artifacts,docs,test-results}.
Anything a script writes directly to ${RUNNER_TEMP} as root is no longer
chowned back. linux_job.yml has the same step but is legacy, so it is
left alone.
Hoist the repeated ALPINE_IMAGE expression to a job-level env var rather
than repeat it three times.1 parent 936e72e commit bd3f737
1 file changed
Lines changed: 19 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
314 | | - | |
| 315 | + | |
315 | 316 | | |
316 | | - | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
317 | 320 | | |
318 | 321 | | |
319 | | - | |
320 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
321 | 336 | | |
322 | 337 | | |
323 | 338 | | |
| |||
0 commit comments