Skip to main content

Module execution_env

Module execution_env 

Source
Expand description

START_* variables that tell a launched command which execution it belongs to (issue #230). Every backend exports the same three variables, next to the kill-recovery START_COMMAND_RECOVERY_ATTEMPT:

  • START_EXECUTION_ID: the execution UUID (--session-id)
  • START_SESSION_NAME: the isolation session/container name (--session); empty for direct runs, which have no session
  • START_ATTEMPT: 1 for the first run, n for the n-th attempt (--resume, kill recovery or --append-attempt), the same number --status shows

Constants§

ATTEMPT_ENV
EXECUTION_ID_ENV
SESSION_NAME_ENV

Functions§

build_execution_env
Build the START_* variables for one attempt.
build_execution_env_export
POSIX export statement for the variables, without a trailing separator.
execution_env_assignments
KEY=value assignments, e.g. for docker run -e.
execution_env_from_options
Variables of an isolated launch: its execution UUID, the session or container name and the attempt number.
inherited_attempt
START_ATTEMPT inherited by a nested level, when it is a positive number.
is_nested_launch_of
True when this process was itself started by execution execution_id, i.e. it is the next level of a stacked isolation that passes --session-id down.
prefix_with_execution_env
Prefix a shell command with the export statement. Used by the backends whose command runs through a shell that does not inherit our environment: a running tmux server, ssh, and sudo (which resets the environment).

Type Aliases§

ExecutionEnv
Variables of one attempt, in a stable order; empty without an execution id.