为Airflow添加额外的芹菜配置

问题描述 投票:4回答:1

谁知道我可以在哪里添加额外的芹菜配置到气流芹菜执行器?例如,我想要http://docs.celeryproject.org/en/latest/userguide/configuration.html#worker-pool-restarts这个属性,但我如何允许额外的芹菜属性..

celery airflow
1个回答
6
投票

使用刚刚发布的Airflow 1.9.0,现在可配置。

在airflow.cfg中有这一行:

# Import path for celery configuration options
celery_config_options = airflow.config_templates.default_celery.DEFAULT_CELERY_CONFIG

它指向导入路径中的python文件。目前的默认版本可以是https://github.com/apache/incubator-airflow/blob/1.9.0/airflow/config_templates/default_celery.py

如果您需要通过该文件无法调整的设置,请创建一个新模块,例如'my_celery_config.py':

CELERY_CONFIG = {
    # ....
}

并将它放在AIRFLOW_HOME目录中(即在dags /文件夹旁边),然后在配置中设置celery_config_options = my_celery_config.CELERY_CONFIG

© www.soinside.com 2019 - 2024. All rights reserved.