Expand description
Implementation of the run sub-command.
Design decisions (from design.md):
runspawns a short-lived front-end that forks a_supervisechild.- The supervisor continues logging stdout/stderr after
runreturns. - If
--snapshot-afterelapses beforerunreturns, a snapshot is included in the JSON response.
Structs§
- RunOpts
- Options for the
runsub-command. - Snapshot
Wait Opts - Options controlling the snapshot/wait phase after job launch.
- Spawn
Supervisor Params - Parameters for spawning a supervisor process.
- Supervise
Opts - Options for the
_superviseinternal 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_keyswill 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.