Expand description
One authority for docker container lifecycle mechanics ([[RFC-0003:C-RUNTIME-WORKFLOWS]]): bounded client invocation with concurrently drained pipes, and confirmed container removal on the launch machine. Callers own their argv assembly, evidence shapes, and operator-facing messages — this module owns only the mechanics that have actually failed in the field: the pipe-capacity deadlock, the deadline kill, and the container that outlives its docker client.
Structs§
Enums§
- Bounded
Error - Where a bounded invocation failed before producing a wait outcome.
- Bounded
Wait - A bounded invocation that ran to an observable end.
- Command
Cleanup Trigger - Removal
- The outcome of a confirmed-removal attempt.
- Removal
Failure - Why a removal stayed unconfirmed; callers format their own messages.
Constants§
- REMOVAL_
TIMEOUT - How long a removal may take before it is reported as unconfirmed: a wedged daemon is a plausible cause of the original deadline miss, and a cleanup path must not hang on its own cleanup.
Functions§
- docker_
device_ args - The
--gpusargv pair for a device spec (a single index or a comma-joined list). The literal quotes are part of the value: docker’s--gpusparser splits an unquoteddevice=0,1on the comma and exposes only the first device (verified on real hardware in v1.5). - remove_
container docker rm -fon the container’s launch machine, always underREMOVAL_TIMEOUT: the SSH client itself runs through the bounded invocation, because the transport’s connect and keepalive options detect dead connections but cannot bound a live connection to a wedged remote daemon. A container the daemon no longer knows is the confirmation, not a failure ([[RFC-0003:C-RUNTIME-WORKFLOWS]]).- run_
cleanup_ with_ bound - run_
with_ bound - Spawn
argv, optionally writestdin_payload, and wait under the operation’s remaining budget and optional attempt cap while draining stdout and stderr concurrently: a child whose output exceeds the pipe capacity would otherwise block writing and never exit, turning a large response or traceback into a timeout.