【问题标题】:Clear cloud composer all Successful dag run states清除云作曲家所有成功的 dag 运行状态
【发布时间】:2019-09-12 15:34:47
【问题描述】:

我读过a question on clearing DAG run states in Composer,但并不明显,
如何清除所有 DAG 运行状态包括成功的运行状态
即我有一个回填工作,我想从头开始。

我还阅读了Airflow clear CLI Docs,它似乎没有显示我如何也只能选择成功

【问题讨论】:

    标签: google-cloud-composer


    【解决方案1】:

    我发现,你需要将--upstream--downstream部分添加到gcloud的命令中,然后它也会清除任务状态。例如:

    gcloud composer 环境运行 jido --location=asia-northeast1 clear -- --dag_regex 'val' -c -s 2018-12-31 -e 2020-01-01 --upstream --下游

    $ gcloud composer environments run <environment> \
        --location=asia-northeast1 clear -- <DAG_ID> \
          -c \
          -s <dag run start date> \
          -e <dag run end date> \
          --upstream \
          --downstream
    

    字段填写示例:

    $ gcloud composer environments run mycomposerenvironment \
        --location=asia-northeast1 clear -- my_important_dag \
          -c \
          -s 2019-08-20 \
          -e 2019-08-31 \
          --upstream \
          --downstream
    

    您也可以使用dag_regex,如果您有动态 dag,这非常有用:

    $ gcloud composer environments run mycomposerenvironment \
        --location=asia-northeast1 clear -- --dag_regex '_val_' \
          -c \
          -s 2019-08-20 \
          -e 2019-08-31 \
          --upstream \
          --downstream
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-07
      • 1970-01-01
      • 1970-01-01
      • 2018-11-10
      • 2019-01-29
      • 1970-01-01
      • 2012-12-10
      • 2022-07-22
      相关资源
      最近更新 更多