我从 this 运行 Airflow官方 docker-compose。我想在网络应用程序中隐藏默认 DAG。通常可以在airflow.cfg中做到这一点,如何在docker-compose中隐藏默认的DAG?
干杯。
最佳答案
您可以通过使用遵循此语法 AIRFLOW__{SECTION}__{KEY}
的环境变量来设置 airflow.cfg
中存在的任何选项:
Sets options in the Airflow configuration. This takes priority over the value in the airflow.cfg file. Replace the {SECTION} placeholder with any section and the {KEY} placeholder with any key in that specified section.
检查您从 Airflow 获得的 docker-compose.yaml
文件,并将 AIRFLOW__CORE__LOAD_EXAMPLES
var 的值更改为 false
,如下所示:
---
version: '3'
x-airflow-common:
&airflow-common
images.
image: ${AIRFLOW_IMAGE_NAME:-apache/airflow:2.1.4}
# build: .
environment:
&airflow-common-env
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
AIRFLOW__CORE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@postgres/airflow
AIRFLOW__CELERY__RESULT_BACKEND: db+postgresql://airflow:airflow@postgres/airflow
AIRFLOW__CELERY__BROKER_URL: redis://:@redis:6379/0
AIRFLOW__CORE__FERNET_KEY: ''
AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true'
AIRFLOW__CORE__LOAD_EXAMPLES: 'false'
AIRFLOW__API__AUTH_BACKEND: 'airflow.api.auth.backend.basic_auth'
_PIP_ADDITIONAL_REQUIREMENTS: ${_PIP_ADDITIONAL_REQUIREMENTS:-}
volumes:
文档 here .
关于docker - 官方 Airflow docker-compose 中的自定义airflow.cfg,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69416963/