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 and the stored command is re-run by docker start (its original entrypoint).
  • DockerSnapshot: the container still exists but a new command was given, so its filesystem is committed to an image and a derived container runs the new command. This avoids docker start -ai, which would re-run the original entrypoint from scratch.
  • 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_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.
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.