Understanding Pipeline Deployment
When you deploy a pipeline:- It becomes a long-running service that can be invoked multiple times
- The pipeline code is registered with ZenML server
- You can trigger runs via CLI, API, or webhook
- Each invocation creates a new pipeline run with unique parameters
Deploying Your First Pipeline
from typing import Optional, Annotated
from zenml import pipeline, step
@step
def simple_step(name: Optional[str] = None) -> str:
"""A simple step that returns a greeting."""
if name:
message = f"Hello {name}! Welcome to ZenML"
else:
message = "Hello from ZenML!"
print(message)
return message
@pipeline
def simple_pipeline(name: Optional[str] = None) -> Annotated[str, "greeting"]:
"""A pipeline that can be deployed and invoked.
Args:
name: Optional name to personalize the greeting
Returns:
A greeting message as an artifact
"""
greeting = simple_step(name=name)
return greeting
Deployment Settings
Configure deployment behavior with settings:Updating Deployed Pipelines
Update an existing deployment:Managing Deployments
List All Deployments
Describe a Deployment
Delete a Deployment
Deployment Patterns
Inference Service
Deploy a model inference pipeline:Data Processing Service
Deploy a data processing pipeline:Batch Processing Service
Deploy a pipeline for batch processing:Invoking Deployed Pipelines
Deployment Configuration Files
Use configuration files for complex deployments:config.yaml
Monitoring Deployments
Track deployment health and runs:Best Practices
Parameterize Everything
Make all deployment-specific values configurable via parameters
Add Input Validation
Validate parameters at the start of pipeline execution
Use Deployment Settings
Configure CORS, authentication, and other settings properly
Version Your Deployments
Use clear naming conventions and version tags for deployments
Monitor Performance
Track invocation frequency, execution time, and success rates
Handle Errors Gracefully
Implement proper error handling and logging in deployed pipelines
Troubleshooting
Deployment Fails
Check pipeline syntax and imports:Invocation Errors
Verify parameter types and names:Connection Issues
Ensure you’re connected to the right ZenML server:Next Steps
Scheduling Pipelines
Automate pipeline execution with schedules
Stack Configuration
Configure stacks for different deployment environments
Creating Pipelines
Learn more about building pipelines
