Airflow封装的 DAG似乎是合理的生产气流部署的重要组成部分。
我有一个由配置文件驱动的带有动态 subDAG 的 DAG,例如:
配置.yaml:
imports:
- project_foo
- project_bar`
这会产生 subdag 任务,例如imports.project_{foo|bar}.step{1|2|3}
.
我通常使用 python 的open
函数读取配置文件,a laconfig = open(os.path.join(os.path.split(__file__)[0], 'config.yaml')
不幸的是,在使用打包的 DAG 时,这会导致错误:
Broken DAG: [/home/airflow/dags/workflows.zip] [Errno 20] Not a directory: '/home/airflow/dags/workflows.zip/config.yaml'
有什么想法/最佳实践可以在这里推荐吗?