如何解决气流如何使用git sync从git分支中的dag文件夹中拾取dag
我的公司使用git-sync
将压缩的dag同步到气流。我们使用气流舵图来部署气流。我想知道是否可以让气流只在git分支中的特定文件夹(例如dags-dev
)中拾取压缩的dag,而不是所有压缩的dag?
有些参考可能有用。
气流头盔图表值文件。 https://github.com/helm/charts/blob/master/stable/airflow/values.yaml
我们的问题代码如下:
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
气流git同步配置如下:
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
解决方法
您可以定义要忽略的文件夹/文件列表,使用 .airflowignore
文件
https://airflow.apache.org/docs/apache-airflow/stable/concepts.html#airflowignore
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。