Airflow Packaged Dag (Zip) not recognized

I am trying to pack my repository using my Dag in a zip file, for example , in the documentation here . Thus, I followed the agreement in the documentation, which is to keep the dag in the root of the zip, and subdirectories are treated as packets using airflow.

My zip file has the following contents:

$ unzip -l $AIRFLOW_HOME/dags/test_with_zip.zip 
Archive:  /home/arjunc/Tutorials/airflow/dags/test_with_zip.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2018-03-29 17:46   helloworld/
      189  2018-03-29 17:22   helloworld/hello.py
        0  2018-03-29 17:18   helloworld/__init__.py
      461  2018-03-29 17:24   test_with_zip_dag.py
---------                     -------
      650                     4 files

Where test_with_zip_dag.pyis the file in the root directory with the Dag definitions as follows:

from datetime import datetime

from airflow import DAG
from airflow.operators.python_operator import PythonOperator

from helloworld.hello import HelloWorld


def run():
    return HelloWorld().run()


dag = DAG('test_with_zip', description='Test Dependencies With Zipping',
          schedule_interval='0 12 * * *',
          start_date=datetime(2017, 3, 20), catchup=False)

hello_operator = PythonOperator(task_id='hello_task', python_callable=run, dag=dag)

I placed this zip in the default dags directory of $ AIRFLOW_HOME / dags, but my dag is not recognized!

What am I doing wrong?

Update

-, test_with_zip , , , , . ( -):

DAG, -, . , , .

0
1

-.

airflow scheduler.

, . , : Airflow 1.9.0 ,

0

Source: https://habr.com/ru/post/1614360/


All Articles