Skip to main content

Module container

Module container 

Source
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§

CommandCleanupEvidence

Enums§

BoundedError
Where a bounded invocation failed before producing a wait outcome.
BoundedWait
A bounded invocation that ran to an observable end.
CommandCleanupTrigger
Removal
The outcome of a confirmed-removal attempt.
RemovalFailure
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_bind_mount_readonly
The --mount argv pair for a read-only host bind. The explicit long form, not the -v shorthand: at least one site docker proxy mis-parses the shorthand’s :ro suffix on same-path binds and silently drops the mount (verified on real hardware), while the long form passes through.
docker_device_args
The --gpus argv pair for a device spec (a single index or a comma-joined list). The literal quotes are part of the value: docker’s --gpus parser splits an unquoted device=0,1 on the comma and exposes only the first device (verified on real hardware in v1.5).
remove_container
docker rm -f on the container’s launch machine, always under REMOVAL_TIMEOUT: the SSH client itself runs through the bounded invocation, because transport liveness configuration 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 write stdin_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. env_remove names inherited environment variables the child must not see (for example crate::ssh::SSH_ENV_REMOVE for a host SSH client).