Simple way to create dags using YAML for airflow
This guide assumes that you have basic working knowledge of linux commands and python
- Install docker by following instructions in https://docs.docker.com/get-docker/
- Install airflow using puckel version
- Download repo https://github.com/puckel/docker-airflow by clicking code->download zip
- Unzip repo
- Open terminal at the unzipped folder path
- Execute
docker-compose -f docker-compose-LocalExecutor.yml up -d
- Log in to airflow webserver instance using
docker exec -u root -it <name of airflow webserver> /bin/bash
. You can find out the name of the webserver instance usingdocker ps -a
- install git by running
apt-get update
andapt-get install git
- Navigate to default airflow dags folder
/usr/local/airflow/dags
- Clone into default airflow dags folder by running
git clone https://github.com/reivaxteo/airflow_yaml_dag.git
- Install PyYaml by running
pip install PyYAML==5.3.1
- put yaml files and other scripts in
/usr/local/airflow/dags/yaml_scheduler
- examples have been included
Have fun! :)