From 77a9d0ad34fc9cdadef17d0e85c0f1ba5d41d8bf Mon Sep 17 00:00:00 2001 From: Anthony Lin Date: Mon, 11 Sep 2017 22:03:43 +0000 Subject: [PATCH] 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 --- shipyard_airflow/dags/update_site.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shipyard_airflow/dags/update_site.py b/shipyard_airflow/dags/update_site.py index 57a8bdea..bc4e2ca4 100644 --- a/shipyard_airflow/dags/update_site.py +++ b/shipyard_airflow/dags/update_site.py @@ -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)