15 — Pipeline & Automation

Orchestration & Scheduling#

Infrastructure✓ Mathematical
◆ The PatternDAGs, retries, backfills, and trigger strategies

Orchestrators manage the when, how, and what-if of ML workflows. Airflow, Prefect, and Dagster define DAGs with dependency resolution, automatic retries, and backfill capabilities. Good orchestration means your retraining runs reliably at 2 AM without you.

// Interactive — DAG dependency graph
# Python — Airflow DAG for retraining
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime

dag = DAG("retrain_model",
          schedule_interval="0 2 * * *",
          start_date=datetime(2025, 1, 1))

ingest = PythonOperator(task_id="ingest", python_callable=ingest_data, dag=dag)
train  = PythonOperator(task_id="train",  python_callable=train_model,  dag=dag)
eval_  = PythonOperator(task_id="eval",   python_callable=evaluate,     dag=dag)
deploy = PythonOperator(task_id="deploy", python_callable=deploy_model, dag=dag)

ingest >> train >> eval_ >> deploy
Pattern bridge: Orchestration DAGs structure ML workflows the same way computation graphs structure neural networks — directed, acyclic, and dependency-ordered. In markets, systematic trading rules follow the same sequential logic.
← Previous
CI/CD for ML
Open in the full reader, with the topic sidebar →