Skip to main content

Module execution_resume

Module execution_resume 

Source
Expand description

Resume tracked detached executions (issue #162).

--resume <id> restarts a stored execution, and --resume <id> -- <command> runs a different command against the same container filesystem. Both keep the original execution UUID so --status, --list and --upload-log keep addressing one logical session across restarts.

Three strategies, chosen from the probed session state:

  • DockerStart: the container still exists. Newly managed containers accept replacement commands through a small handoff script, then restart in place without a snapshot.
  • DockerSnapshot: a legacy container needs a replacement command, or immutable labels need changing. After disk preflight, its filesystem is committed under a host-wide lock and a derived container runs the command.
  • Relaunch: nothing is left of the session, so the command is launched again through the stored isolation options.

Structs§

ExecutionResumeResult
Result of resume_execution.
ResumePlan
How a stored execution will be resumed.
ResumeResultFields
Fields reported after a resume attempt.
ResumeStep
One command run while carrying out a resume plan.
SystemResumeHooks
The real side effects: docker watcher, isolation backends, log evidence.

Enums§

ResumeMode
Strategies build_resume_plan can pick.

Traits§

ResumeHooks
Side effects a resume performs beyond running plan steps.

Functions§

apply_resume_to_record
Apply the resume outcome to the stored record, keeping the original UUID so one logical session stays addressable across restarts.
build_launch_options
Rebuild the isolation options stored on a record so the command can be launched again with the same configuration.
build_resume_plan
Decide how a stored execution should be resumed.
build_resume_plan_with_limits
build_resume_plan with the resource limits read from the stopped container with docker inspect; falls back to the stored ones when None.
build_resumed_session_name
Build the container name for a snapshot-based resume.
build_snapshot_image_name
Build the docker image name used to snapshot a container before running a new command in it. Docker repository names must be lowercase and limited to [a-z0-9._-], so session names are sanitized.
format_resume_result
Format a resume result in the requested output format.
format_resume_result_as_links_notation
Format a resume result as links notation.
keeps_kill_recovery
docker start re-runs the launch-time selector, so a container resumed in place or relaunched through isolation keeps its kill recovery (issue #176); a snapshot-derived container has no selector.
resume_execution
Resume a tracked execution by UUID or session name.
resume_execution_with
Resume with an injectable command runner and hooks, so tests never touch docker.
resume_execution_with_options
resume_execution_with_resources