Skip to content

Pipelines

Pipelines generate, run and postprocess a model in one step.

Local pipeline backend for model execution.

This module provides the local pipeline backend implementation.

logger module-attribute

logger = logging.getLogger(__name__)

LocalPipelineBackend

Local pipeline backend that executes the full workflow locally.

This backend uses the existing generate(), run() and postprocess() methods to execute the complete pipeline locally.

execute

execute(
    model_run: ModelRun,
    backend_config: Union[
        LocalConfig, DockerConfig, SlurmConfig
    ] = None,
    processor: BasePostprocessorConfig = None,
    run_kwargs: Optional[Dict[str, Any]] = None,
    process_kwargs: Optional[Dict[str, Any]] = None,
    cleanup_on_failure: bool = False,
    validate_stages: bool = True,
    **kwargs: Any,
) -> Dict[str, Any]

Execute the model pipeline locally.

Parameters:

Name Type Description Default
model_run ModelRun

The ModelRun instance to execute

required
backend_config Union[LocalConfig, DockerConfig, SlurmConfig]

Backend configuration object (LocalConfig, DockerConfig, etc.)

None
processor BasePostprocessorConfig

Processor configuration for the postprocess stage

None
run_kwargs Optional[Dict[str, Any]]

Additional parameters for the run stage (deprecated, use backend_config)

None
process_kwargs Optional[Dict[str, Any]]

Additional parameters for the postprocess stage

None
cleanup_on_failure bool

Whether to cleanup outputs on pipeline failure

False
validate_stages bool

Whether to validate each stage before proceeding

True
**kwargs Any

Additional parameters (for backward compatibility)

{}

Returns:

Type Description
Dict[str, Any]

Combined results from the pipeline execution

Raises:

Type Description
ValueError

If model_run is invalid or parameters are invalid

TypeError

If processor is not a BasePostprocessorConfig instance