This repository contains the code for the Airflow training environment.
- In the terminal (ctrl + ` ) check you have more than 4GB of allocated memory:
docker run --rm "debian:bullseye-slim" bash -c 'numfmt --to iec $(echo $(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE))))'
An no, 3.9 is not enough. If you see 3.9 means that you did not selected the right machine in step 2.
You need to run database migrations and create the first user account. It is all defined in the docker compose file so just run:
docker compose up airflow-init
docker compose up
this will make Airflow available at: http:https://localhost:8080
If for some reason its not possible to you to run Airflow using docker, you can also do it using python.
- Install airflow
pip install apache-airflow
or
poetry add apache-airflow
make sure you have a virtual environment activated in which you can isolate your code/dependencies
- initialize the database
airflow db init
- Create a new user
airflow users create --username airflow --password airflow --firstname anon --lastname nymus --role Admin --email [email protected]
- Copy your dags to the dags/ folder
cp dags/mydag.py ~/airflow/dags/
- In a termnial initialize the webserver
airflow webserver -p 8080
- In a second terminal initialize the scheduler
airflow scheduler