问题
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