Execution Model#
How pypeline executes your pipeline steps.
Execution Flow#
sequenceDiagram
participant CLI as pypeline run
participant Slurp as ProjectSlurper
participant Sched as PipelineScheduler
participant Load as PipelineLoader
participant Exec as PipelineStepsExecutor
participant Step as PipelineStep
CLI->>Slurp: Read pypeline.yaml
Slurp-->>CLI: PipelineConfig
CLI->>Sched: Filter steps (--step, --single)
Sched-->>CLI: Step references
CLI->>Load: Load step classes
Load-->>CLI: Instantiated steps
CLI->>Exec: Execute steps
loop For each step
Exec->>Step: Check dependencies
alt Outdated or forced
Exec->>Step: run()
end
Exec->>Step: update_execution_context()
end
ExecutionContext Lifecycle#
The ExecutionContext flows through all steps:
Created by the CLI with project root and inputs
Passed to each step constructor
Updated by
update_execution_context()after every step (even skipped ones)Used by subsequent steps for shared state
Key Properties#
Property |
Purpose |
|---|---|
|
PATH directories for subprocesses |
|
Type-safe key-value store |
|
User-provided parameters |
|
Environment for subprocesses |
Dependency Management#
Steps declare inputs and outputs:
def get_inputs(self) -> list[Path]:
return [self.project_root_dir / "src"]
def get_outputs(self) -> list[Path]:
return [self.output_dir / "build"]
The executor skips steps when:
All outputs exist
Outputs are newer than inputs
--force-runis not set
Subprocess Execution#
Steps run external commands via create_process_executor():
executor = self.execution_context.create_process_executor(
["gcc", "-o", "main", "main.c"],
cwd=self.project_root_dir
)
executor.execute()
The executor automatically:
Adds
install_dirsto PATHInjects
env_varsHandles Windows/Unix shell differences