The material in this section (kata) is intended to provide a basic understanding of Apache Airflow. The exercises are designed to be completed in order, as they build on each other.
You should set aside 1-3 hours to complete the exercises and get familiar with the documentation, tooling and concepts.
- text editor
- Docker (and optionally docker compose)
- web browser
There are relatively few hints next to the exercises. Use any resource you want to find a solution, there are many different ways to solve the exercises below.
- Run Airflow in a Docker container and log in
- Enable the example DAGs and run one
- Create a new DAG that prints "Hello, World!" to the logs
- Create a new dynamic DAG. The dag should create all permutations of
[a, b, c]
tasks. - Modify the previously created DAG to always skip the task
c
if it comes after taksa
. - Create a new DAG that queries data from a server
hints
- Set up docker compose to also run a database alongside Airflow (recommended to use docker compose and to extend the compose file)
- Create the connection in the Airflow UI
- Create a new DAG that queries data from the database
Get familiar with the Dockerfile and build the image.
docker build -t airflow-ds:latest .
Run the image and mount your dags folder, so you will have a quick feedback loop while working on the exercises.
docker run -it -p 8080:8080 airflow-ds:latest --volume ./dags:/opt/airflow/dags
with compose:
docker compose up -d
log in: airflow
password: airflow
log in: admin
password: cat standalone_admin_password.txt