Skip to main content

Module run

Module run 

Source
Expand description

Implementation of the run sub-command.

Design decisions (from design.md):

  • run spawns a short-lived front-end that forks a _supervise child.
  • The supervisor continues logging stdout/stderr after run returns.
  • If --snapshot-after elapses before run returns, a snapshot is included in the JSON response.

Structs§

RunOpts
Options for the run sub-command.
SnapshotWaitOpts
Options controlling the snapshot/wait phase after job launch.
SpawnSupervisorParams
Parameters for spawning a supervisor process.
SuperviseOpts
Options for the _supervise internal sub-command.

Functions§

execute
Execute run: spawn job, possibly wait for snapshot, return JSON.
mask_env_vars
Mask the values of specified keys in a list of KEY=VALUE strings. Keys listed in mask_keys will have their value replaced with “***”.
now_rfc3339_pub
Public alias so other modules can call the timestamp helper.
pre_create_log_files
Pre-create empty log files (stdout.log, stderr.log, full.log) so they exist immediately after job creation, before the supervisor starts writing.
resolve_effective_cwd
Resolve the effective working directory for a job.
run_snapshot_wait
Run the snapshot/wait phase and return (final_state_str, exit_code, finished_at, snapshot, final_snapshot, waited_ms).
spawn_supervisor_process
Spawn the supervisor process and write the initial running state to state.json.
supervise
Internal supervisor sub-command.