Multiple Dag directories

4,354 views
Skip to first unread message

Saurabh Saxena

unread,
Oct 29, 2015, 3:13:03 PM10/29/15
to Airflow
Hi,

Is there a way to have multiple dag directories ?
We have a requirement to segregate dags based on project names, we don't want to put all dags in one directory.
It would be nice to have different folders based on project names and having all dags related to the project in their respective directory.
If that is not possible, what can be other ways to segregate dags.

Regards,
Saurabh

Arthur Wiedmer

unread,
Oct 29, 2015, 3:18:00 PM10/29/15
to Airflow
Hi,

You can have one dags folder with subfolders for DAGs based on projects (For instance ./dags/search/search_dag.py, ./dags/growth/growth.py, with DAGS_FOLDER = ./dags ). The scheduler does an os.walk which will recurse through the subfolders.

Let me know if that does not answer your question.

Best,
Arthur

Saurabh Saxena

unread,
Oct 29, 2015, 4:31:39 PM10/29/15
to Airflow
Thanks Arthur. That answers my questions, I will give it a try.

Regards,
Saurabh

Maxime Beauchemin

unread,
Oct 29, 2015, 4:37:34 PM10/29/15
to Airflow
Note that it will also follow symlinks, so that can be a way to integrate pipelines coming from different code repos for instance. Here's the related line of code:

Saurabh Saxena

unread,
Oct 29, 2015, 5:35:40 PM10/29/15
to Airflow
Thats great !! Thanks Maxime.

-Saurabh
Reply all
Reply to author
Forward
0 new messages