httk.workflow.executors¶
Define runner-executor contracts used by the workflow manager.
Classes¶
Paths and context needed to construct an attempt command. |
|
Describe a published outcome being committed by the authoritative manager. |
|
Execution behavior selected by |
|
Execute the runner path directly from the payload or staged copy. |
Module Contents¶
- class httk.workflow.executors.AttemptLaunch[source]¶
Paths and context needed to construct an attempt command.
runneris the executable the manager resolved for this attempt. A payload runner is the file insidepayload; a shared runner is the verified copy the manager staged belowcontrol, never the original.- Parameters:
job – Immutable job definition being attempted.
marker – Authoritative marker for the attempt.
payload – Immutable job payload directory.
workdir – Directory in which the runner executes.
control – Attempt-control directory.
context_path – Path of the serialized runner context.
context – Runner context members.
runner – Resolved executable, or no value to use the payload runner.
workflow_prelude – Shell text run in a login shell before the runner, or empty for none.
- payload: pathlib.Path[source]¶
- workdir: pathlib.Path[source]¶
- control: pathlib.Path[source]¶
- context_path: pathlib.Path[source]¶
- context: collections.abc.Mapping[str, Any][source]¶
- runner: pathlib.Path | None = None[source]¶
- property runner_command: pathlib.Path[source]¶
Return the executable to run, defaulting to the payload runner.
- class httk.workflow.executors.OutcomeCommit[source]¶
Describe a published outcome being committed by the authoritative manager.
- Parameters:
job – Immutable job definition producing the outcome.
marker – Authoritative marker being committed.
payload – Immutable job payload directory.
outcome_path – Path of the published outcome.
outcome – Outcome members.
- payload: pathlib.Path[source]¶
- outcome_path: pathlib.Path[source]¶
- outcome: collections.abc.Mapping[str, Any][source]¶
- class httk.workflow.executors.RunnerExecutor[source]¶
Bases:
ProtocolExecution behavior selected by
runner.executorinjob.json.- commit_outcome(commit)[source]¶
Complete executor-specific idempotent work before the marker advances.
- class httk.workflow.executors.PathRunnerExecutor[source]¶
Execute the runner path directly from the payload or staged copy.
- validate(job, payload)[source]¶
Validate the payload runner when the job runs one.
- Parameters:
job (httk.workflow.models.JobDefinition) – Job definition whose runner is checked.
payload (pathlib.Path) – Immutable job payload directory.
- Returns:
None.- Raises:
httk.workflow.errors.FormatError – If a payload runner is missing or not a file.
- Return type:
None
- command(launch)[source]¶
Build the command for one path-runner attempt.
When the launch carries a workflow prelude, the runner is wrapped in a login shell that runs the prelude (under
set -e) then execs the runner, so a failing prelude line aborts before the runner starts and the runner inherits the initialized environment.- Parameters:
launch (AttemptLaunch) – Attempt paths and runner context.
- Returns:
Argument vector for the runner process.
- Return type:
- commit_outcome(commit)[source]¶
Complete path-executor outcome work before the marker advances.
- Parameters:
commit (OutcomeCommit) – Published outcome and its job context.
- Returns:
None.- Return type:
None