0

My Airflow's Git repository has the following structure:

├── dags/                    
│   └── example-dag1.py  
│   └── example-dag2.py              
├── include/             
│   ├── operators/
│   │   └── my_operator.py
│   └── sensors/
│       └── my_sensor.py
│   └── dag_utils.py
└── tests/  

I know I can sync DAGs from a Git repository as described here in the following way:

dags:
  gitSync:
    enabled: true
    repo: git@github.com/<username>/<private-repo-name>.git
    branch: <branch-name>
    subPath: ""
    sshKeySecret: airflow-ssh-secret
extraSecrets:
  airflow-ssh-secret:
    data: |
      gitSshKey: '<base64-converted-ssh-private-key>'

What if I also want to sync custom operators, sensors and generally any other custom, reusable code from the include folder? How can I do it? Seems to be impossible right now but that's hard to believe as writing custom operators is standard in Airflow.

tomomomo
  • 157
  • 2
  • 13
  • 1
    Ended up moving operators, sensors and utils inside the dags folder and puting an .airflowignore file inside as described here: https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/modules_management.html – tomomomo Jan 24 '23 at 12:19

0 Answers0