Hello World
Your first ML pipeline with ZenML - from local development to cloud deployment in minutes.
1
pip install 'zenml[server]'
zenml login2
from zenml import step, pipeline
@step
def basic_step() -> str:
"""A simple step that returns a greeting message."""
return "Hello World!"
@pipeline
def basic_pipeline() -> str:
"""A simple pipeline with just one step."""
greeting = basic_step()
return greeting
if __name__ == "__main__":
basic_pipeline()python run.py3
# Create a snapshot of your pipeline
zenml pipeline snapshot create run.basic_pipeline --name my_snapshot4
# Deploy your pipeline directly
zenml pipeline deploy run.basic_pipeline --name my_deployment
# OR deploy a snapshot (if you created one above)
zenml pipeline snapshot deploy my_snapshot --deployment my_deployment5
zenml login
zenml project set <PROJECT_NAME>6

# Create a remote stack using the deployment wizard
zenml stack register <STACK_NAME> \
--deployer <DEPLOYER_NAME> \
--orchestrator <ORCHESTRATOR_NAME> \
--artifact-store <ARTIFACT_STORE_NAME>7
zenml stack set <REMOTE_STACK_NAME>
zenml pipeline deploy run.basic_pipeline --name my_production_deploymentzenml stack set <REMOTE_STACK_NAME>
python run.py # Automatically runs on cloud infrastructure
8
Last updated
Was this helpful?