Skip to content

Self-hosted: isolate each job's runtime directory and scope cleanup without sudo #75441

Closed

Description

@lpcox

Summary

Track the shared-runtime and cleanup problem from github/gh-aw-firewall#11130. Multiple runners on one native Linux VM share /tmp/gh-aw; setup and teardown can remove another active job's files. A no-sudo runner also cannot reclaim root-owned leftovers.

Reported environment

  • gh-aw v1.0.1, emitting AWF v0.29.0.
  • Multiple self-hosted runners with separate work directories on one Linux VM and one shared /tmp.
  • runs-on: linux64-selfhosted; not ARC/DinD, no runner.topology.
  • Docker available; no sudo; non-Debian image.

Release-source evidence

  • setup.sh removes and recreates global /tmp/gh-aw. It escalates to sudo -n when the directory or children cannot be removed as the runner.
  • post.js and clean.sh also clean the global directory.
  • Runtime constants distinguish runner-local ${RUNNER_TEMP}/gh-aw from hardcoded /tmp/gh-aw paths and mounts. Changing RUNNER_TEMP alone does not isolate the latter.
  • Copilot installation scans /tmp and removes matching AWF chroot directories. Passing --rootless removes sudo but does not make this global cleanup run-scoped. Post-job cleanup also scans those patterns.
  • Gateway generation uses the fixed container name awmg-mcpg; shared-daemon resource names also need review before claiming parallel-job support.

Current workaround

Reporter rewrites compiled paths and downloaded setup scripts to /tmp/gh-aw-<uid>-<runner name> and removes sudo calls. This is not a supported allocation contract and does not by itself scope all cleanup.

Requested outcome

  • Allocate an owner-private runtime root per job/invocation, with collision-resistant identity across runners, jobs and retries; a runner-name-only suffix is insufficient for full isolation.
  • Propagate the allocation through setup, generated paths, container mounts, gateway configuration, logs, detection, artifacts and teardown. Preserve required host/container path translation and visibility boundaries.
  • Cleanup only resources belonging to that allocation. Do not delete another job's files or perform broad /tmp chroot sweeps. Handle unreclaimable stale paths explicitly without requiring sudo on the supported unprivileged path.
  • Review fixed container names and other shared-daemon resources within the concurrency contract.
  • Add a regression with two simultaneous jobs sharing /tmp and a Docker daemon: setup/installation/cleanup of one must not remove or corrupt the other's active resources. Cover failed/interrupted runs and no-sudo cleanup.

No live run was supplied or executed for this diagnosis. Installer privilege selection and safeoutputs identity are separate issues; neither an AWF version bump nor simply deleting sudo calls resolves the runtime collision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions