[Fix] Update 'trigger_rule' for Airflow Upgrade

The current 'trigger_rule' is set to 'all_done' which means
that this task will run even if one of the upstream tasks,
e.g. 'drydock_build' failed (see [0] on how task is triggered).

This is an incorrect behavior as task should only run if all
upstream tasks have succeeded. This patch set is meant to
correct this behavior.

[0] https://airflow.incubator.apache.org/concepts.html#trigger-rules

all_success: (default) all parents have succeeded
all_failed: all parents are in a failed or upstream_failed state
all_done: all parents are done with their execution
one_failed: fires as soon as at least one parent has failed, it does not wait for all parents to be done
one_success: fires as soon as at least one parent succeeds, it does not wait for all parents to be done
dummy: dependencies are just for show, trigger at will

Change-Id: I571271b79cece268ae039420e12327f187e8f35c
This commit is contained in:
Anthony Lin 2018-04-14 00:49:06 +00:00 committed by Bryan Strassner
parent 31b4dc373f
commit 6b0100ab00
1 changed files with 1 additions and 1 deletions

View File

@ -207,7 +207,7 @@ class CommonStepFactory(object):
return BranchPythonOperator(task_id=task_id,
python_callable=upgrade_airflow_check,
trigger_rule="all_done",
trigger_rule="all_success",
dag=self.dag)
def get_upgrade_airflow(self, task_id=dn.UPGRADE_AIRFLOW):