This package contains the docker compose to set up Apache Airflow locally or in production. It also contains all the PW DAGs.
- Execute the local_install.sh script:
sh local_install.sh
- Copy the
airflow.cfg.example
intoairflow.cfg
and configure the paths to point to this folder.
cp airflow.cfg.example airflow.cfg
-
Make sure the variable
AIRFLOW_HOME
is configured in your system and it is pointing to this folder. -
From now on, you can start the webserver and scheduler(this one is necessary to scan the DAGs folder and add our custom DAGs) with the next commands:
airflow webserver
airflow scheduler
- Configure
.env
file:
echo -e "AIRFLOW_UID=$(id -u)\nAIRFLOW_GID=0" > .env
- Execute init script:
docker-compose up airflow-init
- Start the docker-compose:
docker-compose up
There is a set of commands to interact with Airflow from the command line. You can use them using docker-compose run airflow-worker airflow [COMMAND]
or the utility shell file ./airflow.sh [COMMAND]
.
Shows the status information of Airflow.
./airflow.sh info
Opens a bash connection on the Airflow container.
./airflow.sh bash
Opens the Python command line in the Airflow container.
./airflow.sh python
- (Airflow Docker setup)[https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html]