[英]How to run independent requirements.txt file in apache airflow DAG
[英]How to install dependencies from requirements.txt in Apache Airflow
我有一個部署了 Apache Airflow 的 kube.netes 集群。 我使用官方的 helm chart來部署它。 DAG 存儲在 git 存儲庫中,Apache Airflow 與之同步(使用 dags.gitSync 選項)。 問題:如何從 requirements.txt 本身獲取 Apache Airflow 來安裝依賴項? 該文件位於以下路徑:
dags
└── repo
└── accounting
├── dag.py
└── requirements
└── requirements.txt
Apache Airflow 版本:2.3.0
我使用了 docker 自定義圖像。
FROM apache/airflow
COPY ./requirements.txt ./requirements.txt
RUN pip install -r ./requirements.txt
並推送 docker 存儲庫(我使用 aws ecr)。
編輯 helm 部署文件(如 values.yaml)
images:
airflow:
repository: {docker image repository uri}
tag: latest
pullPolicy: IfNotPresent
您可以像 Jongwho Park 提到的那樣擴展 Airflow 圖像,或者您可以使用PythonVirtualenvOperator並在 Operator 中指定您的 pip 包。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.