gh-aw icon indicating copy to clipboard operation
gh-aw copied to clipboard

Self-hosted: isolate AWF Docker resources and listener ports across concurrent jobs

Open lpcox opened this issue 1 week ago • 0 comments

Summary

Per-job runtime path isolation does not complete the concurrency contract for multiple gh-aw jobs sharing one self-hosted host and Docker daemon. Even after the filesystem work tracked by #78555 and #78863, AWF still uses shared Docker resource names and listener ports that can collide across simultaneous workflow invocations.

Remaining gap

#75441 originally requested review of fixed container names and other shared-daemon resources. #75444 addressed installer staging and unsafe cleanup but explicitly deferred full runtime migration. #78863 isolates runtime paths and ownership-checked cleanup, while documenting that full shared-daemon AWF isolation remains incomplete because upstream fixed container/network names and existing listener ports still prevent unrestricted concurrent execution.

Consequences can include:

  • One invocation failing because another already owns a fixed container or network name.
  • Cleanup or replacement of a shared Docker resource affecting another active invocation.
  • Listener port conflicts between concurrent jobs.
  • Filesystem isolation appearing complete while the overall workflow remains unsafe to run concurrently on one host.

Expected behavior

Every Docker resource and listener allocated by gh-aw/AWF should either be invocation-private or use a coordination mechanism that provides equivalent isolation. Setup and teardown must identify and operate only on resources owned by the current invocation.

Acceptance criteria

  • Inventory fixed container names, network names, volumes, listener ports, and other shared-daemon resources used by gh-aw and AWF.
  • Derive collision-resistant resource identities from the workflow invocation where gh-aw controls naming.
  • Add ownership metadata and verify ownership before cleanup or replacement.
  • Allocate listener ports safely for simultaneous invocations, or explicitly serialize resources that cannot yet be isolated.
  • Define the compatibility boundary for upstream AWF resources that gh-aw cannot independently rename.
  • Add a regression with two simultaneous jobs sharing one Docker daemon; startup, execution, and cleanup of either job must not corrupt or terminate the other.
  • Cover failed and interrupted jobs, stale resources, retries, and matrix jobs.
  • Update self-hosted runner documentation to state the supported concurrency contract and any remaining upstream limitation.

Related work

  • #75441 described the original filesystem and shared-resource collision problem.
  • #75444 delivered installer/chroot isolation and safer cleanup.
  • #78555 tracks the remaining per-job runtime path migration.
  • #78863 implements runtime path and ownership isolation but explicitly leaves shared-daemon AWF isolation incomplete.

lpcox avatar Nov 18 '26 21:11 lpcox