How airflow can pick up dags from a dag folder in a git branch using git sync

Viewed 4765

My company uses git-sync to sync zipped dags to airflow. We use airflow helm charts to deploy airflow. I wonder if I can let airflow only pick up zipped dags in a specific folder such as dags-dev in a git branch, not all the zipped dags?

Here are some reference might be useful.

The airflow helm chart value file. https://github.com/helm/charts/blob/master/stable/airflow/values.yaml

Our dags code looks like this:

dags:
      doNotPickle: true
      git:
        url: <git url>
        ref: master
        gitSync:
          enabled: true
          image:
            repository: <some repo>
            tag: 1.0.7
          refreshTime: 60
      initContainer:
        enabled: true
        image:
          repository: <some repo>
          tag: 1.0.7

Airflow git sync configuration looks like this:

AIRFLOW__KUBERNETES__DAGS_VOLUME_SUBPATH: repo # must match AIRFLOW__KUBERNETES__GIT_SUBPATH
AIRFLOW__KUBERNETES__GIT_REPO: <git repo>
AIRFLOW__KUBERNETES__GIT_BRANCH: master
AIRFLOW__KUBERNETES__GIT_DAGS_FOLDER_MOUNT_POINT: /opt/airflow/dags
AIRFLOW__KUBERNETES__GIT_USER: <some user>
AIRFLOW__KUBERNETES__GIT_PASSWORD: <some password>
AIRFLOW__KUBERNETES__GIT_SYNC_CONTAINER_REPOSITORY: gitlab.beno.ai:4567/eng/external-images/k8s.gcr.io/git-sync
AIRFLOW__KUBERNETES__GIT_SYNC_CONTAINER_TAG: v3.1.1
1 Answers
Related