Skip to content

Commit b302b18

Browse files
committed
feat(bqetl_artifact_deployment): [DENG-10456] Deploy tables and views together
1 parent ccd5bc6 commit b302b18

1 file changed

Lines changed: 11 additions & 30 deletions

File tree

dags/bqetl_artifact_deployment.py

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -138,33 +138,16 @@ def should_run_deployment(dag_id: str, generate_sql: bool) -> bool:
138138
image=docker_image,
139139
)
140140

141-
publish_new_tables = GKEPodOperator(
142-
task_id="publish_new_tables",
141+
publish_tables_and_views = GKEPodOperator(
142+
task_id="publish_tables_and_views",
143143
cmds=["bash", "-x", "-c"],
144144
execution_timeout=timedelta(hours=6),
145145
arguments=[
146146
generate_sql_cmd_template
147+
+ "script/bqetl generate derived_view_schemas --use-cloud-function=false && "
147148
+ "script/bqetl query initialize '*' --skip-existing --project-id=moz-fx-data-shared-prod --project-id=moz-fx-data-experiments --project-id=moz-fx-data-marketing-prod --project-id=moz-fx-data-bq-people && "
148149
"script/bqetl query schema update '*' --use-cloud-function=false --skip-existing --ignore-dryrun-skip --project-id=moz-fx-data-shared-prod --project-id=moz-fx-data-experiments --project-id=moz-fx-data-marketing-prod --project-id=moz-fx-glam-prod --project-id=moz-fx-data-bq-people && "
149-
"script/bqetl query schema deploy '*' --use-cloud-function=false --force --ignore-dryrun-skip --project-id=moz-fx-data-shared-prod --project-id=moz-fx-data-experiments --project-id=moz-fx-data-marketing-prod --project-id=moz-fx-glam-prod --project-id=moz-fx-data-bq-people"
150-
],
151-
image=docker_image,
152-
container_resources=generate_sql_container_resources,
153-
)
154-
155-
publish_views = GKEPodOperator(
156-
task_id="publish_views",
157-
cmds=["bash", "-x", "-c"],
158-
execution_timeout=timedelta(hours=2),
159-
arguments=[
160-
generate_sql_cmd_template
161-
+ "script/bqetl generate derived_view_schemas --use-cloud-function=false && "
162-
"script/bqetl view publish --add-managed-label --skip-authorized --project-id=moz-fx-data-shared-prod && "
163-
"script/bqetl view publish --add-managed-label --skip-authorized --project-id=moz-fx-data-experiments && "
164-
"script/bqetl view publish --add-managed-label --skip-authorized --project-id=moz-fx-data-marketing-prod && "
165-
"script/bqetl view publish --add-managed-label --skip-authorized --project-id=moz-fx-glam-prod && "
166-
"script/bqetl view publish --add-managed-label --skip-authorized --project-id=moz-fx-data-shared-prod --target-project=mozdata --user-facing-only && "
167-
"script/bqetl view publish --add-managed-label --skip-authorized --project-id=moz-fx-data-bq-people && "
150+
"script/bqetl deploy '*' --tables --views --use-cloud-function=false --force --ignore-dryrun-skip --add-managed-label --skip-authorized --project-id=moz-fx-data-shared-prod --project-id=moz-fx-data-experiments --project-id=moz-fx-data-marketing-prod --project-id=moz-fx-glam-prod --project-id=moz-fx-data-bq-people"
168151
"script/bqetl view clean --skip-authorized --target-project=moz-fx-data-shared-prod && "
169152
"script/bqetl view clean --skip-authorized --target-project=moz-fx-data-experiments --project-id=moz-fx-data-experiments && "
170153
"script/bqetl view clean --skip-authorized --target-project=moz-fx-data-marketing-prod --project-id=moz-fx-data-marketing-prod && "
@@ -176,7 +159,6 @@ def should_run_deployment(dag_id: str, generate_sql: bool) -> bool:
176159
],
177160
image=docker_image,
178161
container_resources=generate_sql_container_resources,
179-
get_logs=False,
180162
trigger_rule=TriggerRule.ALL_DONE,
181163
)
182164

@@ -220,15 +202,14 @@ def should_run_deployment(dag_id: str, generate_sql: bool) -> bool:
220202
[
221203
publish_public_udfs,
222204
publish_persistent_udfs,
223-
publish_new_tables,
205+
publish_tables_and_views,
224206
]
225207
)
226-
publish_views.set_upstream(publish_public_udfs)
227-
publish_views.set_upstream(publish_persistent_udfs)
228-
publish_views.set_upstream(publish_new_tables)
229-
publish_metadata.set_upstream(publish_views)
230-
publish_bigeye_monitors.set_upstream(publish_views)
208+
publish_tables_and_views.set_upstream(publish_public_udfs)
209+
publish_tables_and_views.set_upstream(publish_persistent_udfs)
210+
publish_metadata.set_upstream(publish_tables_and_views)
211+
publish_bigeye_monitors.set_upstream(publish_tables_and_views)
231212
# trigger dryrun
232213
# doesn't block downstream tasks
233-
trigger_dryrun.set_upstream(publish_views)
234-
trigger_looker.set_upstream(publish_views)
214+
trigger_dryrun.set_upstream(publish_tables_and_views)
215+
trigger_looker.set_upstream(publish_tables_and_views)

0 commit comments

Comments
 (0)