Update update_site Dag

Update the flow for DryDock.  The flow for update site will be
similar to the one for deploy_site as far as DryDock is concenred
as DryDock will only be used for deploying nodes.

A possible use case where we can use drydock with this dag will
be when we are trying to add nodes to an existing site. The flow
for drydock will be the same as that of deploy_site in such scenario.

Change-Id: Icfb0e80ca926fe3a42e88db75e9dec18f073b4c8
This commit is contained in:
Anthony Lin 2017-09-11 22:03:43 +00:00
parent 38e7622323
commit 77a9d0ad34

View File

@ -17,6 +17,7 @@ import airflow
from airflow import DAG
import failure_handlers
from preflight_checks import all_preflight_checks
from drydock_deploy_site import deploy_site_drydock
from validate_site_design import validate_site_design
from airflow.operators.subdag_operator import SubDagOperator
from airflow.operators import ConcurrencyCheckOperator
@ -33,6 +34,7 @@ DAG_CONCURRENCY_CHECK_DAG_NAME = 'dag_concurrency_check'
ALL_PREFLIGHT_CHECKS_DAG_NAME = 'preflight'
DECKHAND_GET_DESIGN_VERSION = 'deckhand_get_design_version'
VALIDATE_SITE_DESIGN_DAG_NAME = 'validate_site_design'
DRYDOCK_BUILD_DAG_NAME = 'drydock_build'
default_args = {
'owner': 'airflow',
@ -71,7 +73,7 @@ preflight = SubDagOperator(
PARENT_DAG_NAME, ALL_PREFLIGHT_CHECKS_DAG_NAME, args=default_args),
task_id=ALL_PREFLIGHT_CHECKS_DAG_NAME,
on_failure_callback=failure_handlers.step_failure_handler,
dag=dag, )
dag=dag)
get_design_version = DeckhandOperator(
task_id=DECKHAND_GET_DESIGN_VERSION,
@ -85,8 +87,10 @@ validate_site_design = SubDagOperator(
on_failure_callback=failure_handlers.step_failure_handler,
dag=dag)
drydock_build = PlaceholderOperator(
task_id='drydock_build',
drydock_build = SubDagOperator(
subdag=deploy_site_drydock(
PARENT_DAG_NAME, DRYDOCK_BUILD_DAG_NAME, args=default_args),
task_id=DRYDOCK_BUILD_DAG_NAME,
on_failure_callback=failure_handlers.step_failure_handler,
dag=dag)