Skip to main content

Module runner

Module runner 

Source
Expand description

Messages between the worker agent and the Python runner (python -m schedr.runner).

They travel over the runner’s inherited socket (SCHEDR_AGENT_FD), each one as a 4-byte big-endian length followed by that many bytes of UTF-8 JSON (see archive/PROJECT.md, Rust/Python integration: the agent <-> runner channel). Every message is an object tagged by type.

Structs§

CleanupHandle
A handle registered by an attempt: what its cleanup needs that only existed in it.
DagFile
Where a DAG file is.
ErrorSummary
A structured error summary: why a DAG file couldn’t be imported, or why a task failed.
ForkRequest
A request to the fork server: start a runner process.
ForkServerRequest
What the fork server preloads.
ParseRequest
A parse job: the files of one root to import.
ParsedFile
One file of a parse job: the DAGs it defines, or why it couldn’t be imported. The agent builds it from file_parsed, uploads it to the master, which stores it as is.
ProcessUsage
What a process used, with the children it reaped: its parent’s view at its exit (rusage).
RunInfo
The run information a task gets (dag_ctx and the SCHEDR_* variables).
ScriptCleanupDeclaration
A declaration’s [cleanup]: what its script runs, and only the settings its schedr.toml gives.
ScriptDeclaration
A declared script, as the agent answers a ScriptOperator (decision 293): what its task runs, and only the settings its schedr.toml gives (the DAG’s defaults apply to the others).
SecretValue
A secret’s value, fetched by the agent for an attempt.
TaskRequest
One task attempt for the runner to run.
TriggerStart
How a trigger starts.
WatchersRequest
A watcher host’s request: what it holds for its whole life (decision 320).

Enums§

AgentMessage
A message from the agent to the runner.
OutputStream
A process’s output stream.
RunnerMessage
A message from the runner to the agent.
RunnerMode
What the runner was started to do.

Constants§

BLOCKED_EVENT_LOOP
The error kind of a wait step that held its host’s event loop past [watchers] block_limit.
CONNECTION_DENIED
The error kind of a connection a task opens without declaring it in connections= (decision 179).
CONNECTION_NOT_FOUND
The error kind of a connection a task opens that its root’s registry doesn’t have (decision 174): not defined in the DAG folder, defined twice, or invalid.
DAG_FILE_MISSING
The error kind of an attempt whose DAG file is missing although the worker has the root at the hash the master expects (the newest code): the file is gone, not on its way.
INVALID_DAG_EXCEPTION
The exception name of the import error the master records for a file that imported but defines a DAG its checks refuse.
INVALID_PATH_EXCEPTION
The exception name of the import error the master records for a file whose path isn’t inside its root.
MAX_MESSAGE_SIZE
The largest message either side accepts, in bytes (the cap on inputs per task, 64 MiB).
PARSE_RESULT_TOO_LARGE_EXCEPTION
The exception name of the import error the agent records for a file whose parse result (all its DAGs’ JSON together) is larger than the master accepts (B35).
PARSE_TIMEOUT_EXCEPTION
The exception name of the import error the agent records for a file that took longer than the parse timeout.
RUNNER_DIED_EXCEPTION
The exception name of the import error the agent records for a file whose runner died.
SWITCHED_OFF
The error kind of a wait step switched off for getting its host killed (decision 338).
TASK_NOT_FOUND
The error kind of a task its DAG file no longer defines (the runner’s task_not_found).
WATCHER_HOST_LOST
The error kind of a wait step whose host ended with no wait step to blame.

Functions§

check_runner_version
Whether the agent accepts a runner: the versions must be equal (the binary and the Python package are released together, see archive/PROJECT.md, Packaging and releases). The agent’s Cargo version is compared as the Python package writes it: a release candidate 0.1.0-rc1 is the package’s 0.1.0rc1 (decision 163).
python_version
A Cargo version as the Python package’s metadata writes it (PEP 440, as maturin normalizes it): X.Y.Z-rcN is X.Y.ZrcN; a release is unchanged. The release workflow allows no other pre-release form (scripts/release.py).