How do I clear the state of a dag run with the CLI in airflow/composer?

别来无恙 提交于 2019-12-23 00:52:12

问题


I thought I could use the command:

g beta composer environments run <env> --location=us-central1 clear -- <dag_id> -s 2018-05-13 -e 2018-05-14

the clear the state of the dag runs on 2018-05-13. For some reason it doesn't work. What happens is that the CLI hangs on a message like:

kubeconfig entry generated for <kube node name>.

What is the expected behavior of the command above? I would expect it to clear the dag run for the interval, but I might be doing something wrong.


回答1:


Running clear on Cloud Composer requires you to add -c parameter to the command like so:

g beta composer environments run <env> --location=us-central1 clear -- <dag_id> -c -s 2018-05-13 -e 2018-05-14




回答2:


The behavior of the command you wrote is the same as running airflow clear on a local installation. Maybe the command is just running slow? Are you able to observe any changes to the task instances displayed in the Airflow web UI?




回答3:


You can use:

gcloud composer environments run instance-id --location us-central clear -- -s 2018-05-13 -e 2018-05-14 -dx DagID

where -dx will find all the dags with similar names to your dag, and -c will run the command without waiting your confirmation.



来源:https://stackoverflow.com/questions/50613766/how-do-i-clear-the-state-of-a-dag-run-with-the-cli-in-airflow-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!