Commit 163d976
committed
Stop chowning all of ${RUNNER_TEMP} in linux_job/linux_job_v2
${RUNNER_TEMP} is not ours to chown. It 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}.
chown-directory now no-ops on an empty or missing directory, since v1
runs these steps with `if: always()` and a skipped setup-* action leaves
the env vars unset. That also stops docker from creating the bind mount
source itself, which it would do as root.
Hoist the repeated ALPINE_IMAGE expression to a job-level env var rather
than repeat it four times.1 parent 936e72e commit 163d976
3 files changed
Lines changed: 45 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
283 | | - | |
| 284 | + | |
284 | 285 | | |
285 | | - | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
286 | 289 | | |
287 | 290 | | |
288 | 291 | | |
289 | | - | |
290 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
291 | 308 | | |
292 | 309 | | |
293 | 310 | | |
| |||
| 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