Understanding Stacks
A stack consists of:- Orchestrator (required): Manages pipeline execution
- Artifact Store (required): Stores pipeline artifacts
- Container Registry (optional): Stores Docker images
- Step Operator (optional): Runs specific steps on different infrastructure
- Experiment Tracker (optional): Tracks experiments and metrics
- Model Deployer (optional): Deploys trained models
- And more: Alerters, annotators, data validators, etc.
Viewing Your Current Stack
Creating Your First Custom Stack
# Local artifact store
zenml artifact-store register local_store \
--flavor=local \
--path=/path/to/artifacts
# S3 artifact store
zenml artifact-store register s3_store \
--flavor=s3 \
--path=s3://my-bucket/zenml-artifacts
# GCS artifact store
zenml artifact-store register gcs_store \
--flavor=gcp \
--path=gs://my-bucket/zenml-artifacts
# Azure Blob Storage
zenml artifact-store register azure_store \
--flavor=azure \
--path=az://my-container/zenml-artifacts
# Local orchestrator (default)
zenml orchestrator register local_orchestrator \
--flavor=local
# Kubernetes orchestrator
zenml orchestrator register k8s_orchestrator \
--flavor=kubernetes \
--kubernetes_context=my-k8s-cluster
# Airflow orchestrator
zenml orchestrator register airflow_orchestrator \
--flavor=airflow \
--airflow_home=/path/to/airflow
# Kubeflow orchestrator
zenml orchestrator register kubeflow_orchestrator \
--flavor=kubeflow \
--kubeflow_hostname=https://kubeflow.example.com
zenml stack register my_custom_stack \
--orchestrator=local_orchestrator \
--artifact-store=s3_store
Common Stack Configurations
Local Development Stack
Perfect for local development and testing:Cloud Production Stack
Production stack with cloud infrastructure:Experiment Tracking Stack
Stack with MLflow for experiment tracking:Complete ML Stack
Full-featured stack for end-to-end ML:Managing Stack Components
List Components
View all registered components of a type:Describe Components
Get details about a specific component:Update Components
Modify component configuration:Delete Components
Remove a component (must not be in use):Stack Validation
ZenML validates stacks before use:- Missing required components
- Incompatible component combinations
- Unreachable infrastructure
- Missing credentials
Using Stacks in Code
Access Current Stack
Access stack components in your steps:Programmatic Stack Access
Use the Client to work with stacks:Stack Recipes
ZenML provides stack recipes for quick setup:Environment-Specific Stacks
Manage stacks for different environments:Stack Sharing
Share stacks across team members:Best Practices
Use Descriptive Names
Name stacks and components clearly (e.g.,
prod_stack, dev_stack)Separate Environments
Maintain separate stacks for dev, staging, and production
Version Infrastructure
Track stack configurations in version control
Validate Before Use
Always validate stacks after configuration changes
Use Stack Recipes
Leverage pre-built recipes for common configurations
Document Dependencies
Document any special setup or credentials needed for stacks
Stack Configuration Files
Export and import stack configurations:prod_stack.yaml
Troubleshooting
Stack Component Not Found
Connection Issues
Stack Validation Fails
Next Steps
Stack Switching
Learn how to switch between stacks efficiently
Creating Pipelines
Build pipelines that run on your configured stacks
Deploying Pipelines
Deploy pipelines to production stacks
