Expand description
One attempt on the worker, from AssignTask to Finished: what to run and how it ended.
Pure: AttemptSpec::from_assign reads the assignment, plan decides how to run it (a
Python task through the runner, a command rendered here) or why not (a rejection, or a failure
such as a reference that can’t be rendered), and finished turns how the process ended into
the Finished message (see archive/PROJECT.md, Task assignment). Starting processes is
crate::launch’s job.
Structs§
- Attempt
Spec - An assignment, read.
- Cleanup
Gate - The agent’s
Gatefor one attempt, and when the master’s word runs out: the last word plus the worker lease (Nonebefore the master told its lease). - Invalid
Assignment - Why an assignment can’t be read.
- Ran
- How a started attempt ended.
- Start
Times - How long a Python task’s process took to start, by phase.
- Worker
Setup - What the worker knows to run tasks.
- Worker
Timeouts - How long what a worker starts may take (
[worker]).
Enums§
- Gate
- Whether a task’s cleanup may start here, with
cleanup_anywhere: while the worker is cut off, the cleanup may be on another worker already. - NotRun
- Why an attempt isn’t run as planned.
- Pass
- What a cleanup passing its
CleanupGateruns on. - Plan
- How to run an attempt.
Constants§
- PROCESS_
STATUS_ UNKNOWN - The error kind of a forked task whose end isn’t known: its shim ended before reporting it.
- RENDER_
FAILED - The error kind of a command whose templates can’t be rendered (a missing or truncated input, a value with no text form).
- RESOURCE_
NOT_ REPORTED - The error kind of a
CommandResourcesetup that exited 0 without reporting its value. - RUNNER_
FAILED - The error kind of a Python task whose runner ended without reporting a result.
Functions§
- failed_
before_ start - The
Finishedmessage for an attempt that failed before starting. - finished
- The
Finishedmessage for an attempt oftaskthat ran. A command succeeds with an exit code of one of its outcomes (SUCCESSfor 0 unless it declares others), which becomes its outcome; any other code is a failure. - plan
- Plans an attempt on this worker.
- plan_at
- As
plan, with the task’s root atroot_dir: the agent’s copy of the code whose hash it reported (decision 102), so the code that runs is the code hashed whatever happens to the configured root meanwhile (git-sync moving its link and deleting the old checkout, an edit in place). - use_
cleanup_ script - Makes a script task run its cleanup script instead (with the task’s environment and working directory); any other task is left as it is. A setup’s own cleanup reports no value.
- with_
resource_ value - A
CommandResourcesetup’s result: on success its output is the value it reported, not itsProcessResult; with nothing reported (and a value declared) it fails.