Fetch metadata within steps
Accessing meta information in real-time within your pipeline.
Using the StepContext
StepContext
To find information about the pipeline or step that is currently running, you can use the zenml.get_step_context()
function to access the StepContext
of your step:
Furthermore, you can also use the StepContext
to find out where the outputs of your current step will be stored and which Materializer class will be used to save them:
See the API Docs for more information on which attributes and methods the StepContext
provides.
Getting artifact and model metadata
As described in the metadata guide, the metadata can be fetched with the client, and this is how you would use it to fetch it within a step.
You can also use the active model to get the model metadata, or the associated artifacts directly as described in the starter guide:
Fetching secret values in a step
ZenML secrets are groupings of key-value pairs which are securely stored in the ZenML secrets store. Additionally, a secret always has a name that allows you to fetch or reference them in your pipelines and stacks. In order to learn more about how to configure and create secrets, please refer to the platform guide on secrets.
You can access secrets directly from within your steps through the ZenML Client
API. This allows you to use your secrets for querying APIs from within your step without hard-coding your access keys:
Last updated