Overview
Metaflow 2.11, released on January 15, 2024, introduces the Deployer to simplify production workflow deployment.
Main Features
Deployer
The Deployer lets you deploy Metaflow flows to orchestrators (Argo, Step Functions) directly from Python.
python
from metaflow import FlowSpec, step
class TrainFlow(FlowSpec):
@step
def start(self):
self.data = [1, 2, 3]
self.next(self.train)
@step
def train(self):
self.model = sum(self.data)
self.next(self.end)
@step
def end(self):
print(f'Result: {self.model}')
Programmatic deployment
Deployment is done via the Python API, without the CLI, making CI/CD integration easier.
python
from metaflow.runner import Deployer
# Programmatic deployment
deployer = Deployer('train_flow.py')
deployment = deployer.argo_workflows().create()
# Trigger a run
run = deployment.trigger()
run.wait_for_completion()
print(f'Status: {run.status}')
