Once a pipeline run has completed, we can access it using the post-execution utilities. Each pipeline can have multiple runs associated with it, and for each run there might be several outputs for each step. Thus, to inspect a specific output, we first need to access the respective pipeline, then fetch the respective run, and then choose the step output of that specific run. The overall hierarchy looks like this:Documentation Index
Fetch the complete documentation index at: https://zenml.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Pipelines
ZenML keeps a collection of all created pipelines with at least one run sorted by the time of their first run from oldest to newest. You can either access this collection via theget_pipelines() method or query a specific pipeline by name using get_pipeline(pipeline=...):
Be careful when accessing pipelines by index. Even if you just ran a pipeline
it might not be at index
-1, due to the fact that the pipelines are sorted
by time of first run. Instead, it is recommended to access the pipeline
using the pipeline class, an instance of the class or even the name of the
pipeline as a string: get_pipeline(pipeline=...).Using the CLI
Using the CLI
You can also access your pipelines through the CLI by executing the following command on the terminal:
Runs
Getting runs from a fetched pipeline
Each pipeline can be executed many times. You can get a list of all runs using theruns attribute of a pipeline.
Getting runs from a pipeline instance:
Alternatively, you can also access the runs from the pipeline class/instance itself:Directly getting a run
Finally, you can also access a run directly with theget_run(run_name=...):
Using the CLI
Using the CLI
You can also access your runs through the CLI by executing the following command on the terminal:
Runs Configuration
Each run has a collection of useful metadata which you can access to ensure all runs are reproducible:git_sha
The Git commit SHA that the pipeline run was performed on. This will only be set if the pipeline code is in a git repository and there are no uncommitted files when running the pipeline.status
The status of a pipeline run can also be found here. There are four possible states: failed, completed, running, cached:pipeline_configuration
Thepipeline_configuration is a super object that contains all configuration of the pipeline and pipeline run, including pipeline-level BaseSettings, which we will learn more about later. You can also access the settings directly via the settings variable.
docstring
The docstring of the step.Steps
Within a given pipeline run you can now further zoom in on individual steps using thesteps attribute or by querying a specific step using the get_step(step=...) method.
The steps are ordered by time of execution. Depending on the
orchestrator, steps can be run in
parallel. Thus, accessing steps by index can be unreliable across different
runs, and it is recommended to access steps by the step class, an instance of
the class or even the name of the step as a string:
get_step(step=...)
instead.step object to access:
- BaseParameters via
step.parameters: The parameters used to run the step. - Step-level BaseSettings via
step.step_configuration - Input and output artifacts.
Outputs
Finally, this is how you can inspect the output of a step:- If there only is a single output, use the
outputattribute - If there are multiple outputs, use the
outputsattribute, which is a dictionary that can be indexed using the name of an output:
Output typing of your steps: