Snapshots
Trigger pipelines from the dashboard, SDK, CLI, or REST API.
Last updated
Was this helpful?
Was this helpful?
zenml pipeline snapshot create <PIPELINE-SOURCE-PATH> --name=<SNAPSHOT-NAME>zenml pipeline snapshot create <PIPELINE-SOURCE-PATH> \
--name=<SNAPSHOT-NAME> \
--config=<PATH-TO-CONFIG-YAML> \
--stack=<STACK-ID-OR-NAME>from zenml import pipeline
@pipeline
def my_pipeline():
...
snapshot = my_pipeline.create_snapshot(name="production-training")zenml pipeline snapshot run <SNAPSHOT-NAME-OR-ID>
# With custom configuration
zenml pipeline snapshot run <SNAPSHOT-NAME-OR-ID> --config=config.yamlfrom zenml.client import Client
# Get the snapshot
snapshot = Client().get_snapshot("<NAME-OR-ID>")
# Optionally modify configuration
config = snapshot.config_template
config.steps["my_step"].parameters["my_param"] = new_value
# Trigger the run
Client().trigger_pipeline(
snapshot_name_or_id=snapshot.id,
run_configuration=config,
)curl -X 'POST' \
'<YOUR-ZENML-SERVER>/api/v1/pipeline_snapshots/<SNAPSHOT-ID>/runs' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{
"run_configuration": {
"steps": {
"train_model": {
"parameters": {"model_type": "rf"}
}
}
}
}'zenml pipeline snapshot delete <SNAPSHOT-NAME-OR-ID>from zenml.client import Client
Client().delete_snapshot(name_id_or_prefix="<SNAPSHOT-NAME-OR-ID>")