首页 > 解决方案 > 无法让 ECSOperator (Fargate) 与 Airflow 一起工作

问题描述

在 Airflow 1.10.1 中使用 ECSOperator 通过 ECS Fargate 运行任务时出现此错误。此处提供 DAG 代码

[2019-04-15 15:57:36,960] {{models.py:1788}} ERROR - An error occurred 
(InvalidParameterException) when calling the RunTask operation: Network 
Configuration must be provided when networkMode 'awsvpc' is specified.

不确定那里有什么问题,正如network_configuration在 args 字典中传递的那样,类似于这里所做的https://github.com/apache/airflow/blob/master/tests/contrib/operators/test_ecs_operator.py#L61

标签: airflowaws-fargate

解决方案


自Airflow v1.10.3起, network_configuration已添加到ESCOperator 。我建议将 Airflow 版本升级到v1.10.3

参考: https ://github.com/apache/airflow/blob/1.10.3/airflow/contrib/operators/ecs_operator.py#L69


推荐阅读