This project demonstrates a basic Apache Airflow workflow using Docker Compose.
The DAG simulates training multiple models in parallel, compares their results using XCom, and conditionally branches based on the best accuracy.
The goal of this project is to practice Airflow orchestration concepts, not machine learning itself.
- Apache Airflow 2.x / 3.x setup using Docker Compose
- Parallel task execution with
PythonOperator - Inter-task communication using XCom
- Conditional branching using
BranchPythonOperator - DAG scheduling and manual triggering via Airflow UI
- Debugging common Airflow issues (DAG parsing, start_date, imports)
- Three model training tasks run in parallel
- Each task returns a random accuracy score
- A branching task selects the best accuracy
- The workflow continues to:
accurateif accuracy > 8inaccurateotherwise
- Apache Airflow
- Docker & Docker Compose
- Python
- BashOperator
- CeleryExecutor (local setup)
- Clone the repository
- Start Airflow:
docker compose up -d
- Apache Airflow
- Docker & Docker Compose
- Python
- BashOperator
- CeleryExecutor (local setup)
- Clone the repository
- Start Airflow:
docker compose up -d
- Open Airflow UI:
http://localhost:8080
- Login:
username: airflow password: airflow
5.Enable or manually trigger the DAG from the UI
- The project focuses on workflow orchestration, not real ML training
- Designed for learning and experimentation
- Easily extendable into a full ETL or ML pipeline