气流集群策略未被调用 [英] Airflow Cluster Policy is not getting invoked

查看:22
本文介绍了气流集群策略未被调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置和了解自定义策略.但是,不确定我做错了什么,以下是行不通的.

I am trying to setup and understand custom policy. Not sure what I am doing wrong however, following this is not working.

气流版本:1.10.10

预期结果:如果我尝试使用 default_owner

实际结果:没有这样的例外

/root/airflow/config/airflow_local_settings.py

class PolicyError(Exception):
    pass


def cluster_policy(task):
    print("task_instance_mutation_hook")
    raise PolicyError


def task_instance_mutation_hook(ti):
    print("task_instance_mutation_hook")
    raise PolicyError

  • /root/airflow/config/airflow_local_settings.pyc 文件正在创建,所以我知道这个文件正在被气流处理.
  • 如果此文件中有任何编译错误,我所有的 dag 都会失败.但不适用于上述文件.
  • 不确定我做错了什么.

    推荐答案

    此功能仅从 1.10.12 版本开始提供.

    This feature is available from 1.10.12 version only.

    这篇关于气流集群策略未被调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆