@@ -35,10 +35,16 @@ executors:
35
35
machine :
36
36
image : ubuntu-2404:current
37
37
38
+ # environment variables for caching
39
+ environment : &cache_environment
40
+ DRYRUN_CACHE_ENABLED : " true"
41
+ DRYRUN_CACHE_DIR : " /tmp/workspace/dryrun_cache"
42
+
38
43
jobs :
39
44
build :
40
45
docker : &docker
41
46
- image : python:<< pipeline.parameters.python-version >>
47
+ environment : *cache_environment
42
48
steps :
43
49
- checkout
44
50
- &restore_venv_cache
@@ -166,7 +172,7 @@ jobs:
166
172
- checkout
167
173
- *restore_venv_cache
168
174
- *build
169
- - &attach_generated_sql
175
+ - &attach_workspace_artifacts
170
176
attach_workspace :
171
177
at : /tmp/workspace
172
178
- ©_staged_sql
@@ -181,6 +187,11 @@ jobs:
181
187
name : Run SQL tests
182
188
command : |
183
189
PATH="venv/bin:$PATH" script/entrypoint -m sql -n 8 -p no:bigquery_etl.pytest_plugin.routine
190
+ - &persist_dryrun_cache
191
+ persist_to_workspace :
192
+ root : /tmp/workspace
193
+ paths :
194
+ - dryrun_cache
184
195
- ©_debug_sql
185
196
run :
186
197
name : Copy generated SQL to save for debugging
@@ -214,7 +225,7 @@ jobs:
214
225
- checkout
215
226
- *restore_venv_cache
216
227
- *build
217
- - *attach_generated_sql
228
+ - *attach_workspace_artifacts
218
229
- *copy_staged_sql
219
230
- *authenticate
220
231
- run :
@@ -244,6 +255,7 @@ jobs:
244
255
echo $PATHS
245
256
PATH="venv/bin:$PATH" script/bqetl dryrun --validate-schemas $PATHS
246
257
# yamllint enable rule:line-length
258
+ - *persist_dryrun_cache
247
259
- *copy_debug_sql
248
260
- *store_debug_artifacts
249
261
- unless :
@@ -262,7 +274,7 @@ jobs:
262
274
- checkout
263
275
- *restore_venv_cache
264
276
- *build
265
- - *attach_generated_sql
277
+ - *attach_workspace_artifacts
266
278
- ©_generated_sql
267
279
run :
268
280
name : Move generated-sql into place
@@ -293,7 +305,7 @@ jobs:
293
305
name : Validate workgroup access configuration on main
294
306
command : |
295
307
PATH="venv/bin:$PATH" script/bqetl metadata validate-workgroups sql/
296
- - *attach_generated_sql
308
+ - *attach_workspace_artifacts
297
309
- *copy_staged_sql
298
310
- *authenticate
299
311
- run :
@@ -341,7 +353,7 @@ jobs:
341
353
- checkout
342
354
- *restore_venv_cache
343
355
- *build
344
- - *attach_generated_sql
356
+ - *attach_workspace_artifacts
345
357
- *authenticate
346
358
- &add_private_bigquery_etl_ssh_keys
347
359
add_ssh_keys :
@@ -391,7 +403,7 @@ jobs:
391
403
name : Pull telemetry-airflow
392
404
command : |
393
405
git clone https://github.com/mozilla/telemetry-airflow.git ~/telemetry-airflow
394
- - *attach_generated_sql
406
+ - *attach_workspace_artifacts
395
407
- *copy_generated_sql
396
408
- run :
397
409
name : Replace telemetry-airflow DAGs with BigQuery ETL DAGs
@@ -441,7 +453,7 @@ jobs:
441
453
- checkout
442
454
- *restore_venv_cache
443
455
- *build
444
- - *attach_generated_sql
456
+ - *attach_workspace_artifacts
445
457
- *copy_staged_sql
446
458
- run :
447
459
name : Run routine tests
@@ -468,7 +480,7 @@ jobs:
468
480
- checkout
469
481
- *restore_venv_cache
470
482
- *build
471
- - *attach_generated_sql
483
+ - *attach_workspace_artifacts
472
484
- *copy_staged_sql
473
485
- *authenticate
474
486
- run :
@@ -491,7 +503,7 @@ jobs:
491
503
- checkout
492
504
- *restore_venv_cache
493
505
- *build
494
- - *attach_generated_sql
506
+ - *attach_workspace_artifacts
495
507
- add_ssh_keys :
496
508
fingerprints :
497
509
- " 22:b9:3c:1b:82:ab:3f:e4:b5:79:70:d1:7b:b9:28:d2"
@@ -520,6 +532,7 @@ jobs:
520
532
- *restore_venv_cache
521
533
- *build
522
534
- *authenticate
535
+ - *attach_workspace_artifacts
523
536
- run :
524
537
name : Generate SQL content
525
538
command : |
@@ -614,6 +627,7 @@ jobs:
614
627
root : /tmp/workspace
615
628
paths :
616
629
- generated-sql
630
+ - dryrun_cache
617
631
- unless :
618
632
condition : *validate-sql-or-routines
619
633
steps :
@@ -628,7 +642,7 @@ jobs:
628
642
- checkout
629
643
- *restore_venv_cache
630
644
- *build
631
- - *attach_generated_sql
645
+ - *attach_workspace_artifacts
632
646
- *copy_generated_sql
633
647
- add_ssh_keys :
634
648
fingerprints :
@@ -664,6 +678,7 @@ jobs:
664
678
root : /tmp/workspace
665
679
paths :
666
680
- staged-generated-sql
681
+ - dryrun_cache
667
682
- *copy_debug_sql
668
683
- *store_debug_artifacts
669
684
- unless :
@@ -678,7 +693,7 @@ jobs:
678
693
or :
679
694
- << pipeline.parameters.deploy >>
680
695
steps :
681
- - *attach_generated_sql
696
+ - *attach_workspace_artifacts
682
697
- add_ssh_keys :
683
698
fingerprints :
684
699
- " 22:b9:3c:1b:82:ab:3f:e4:b5:79:70:d1:7b:b9:28:d2"
@@ -790,7 +805,7 @@ jobs:
790
805
- checkout
791
806
- *restore_venv_cache
792
807
- *build
793
- - *attach_generated_sql
808
+ - *attach_workspace_artifacts
794
809
- *authenticate
795
810
- *add_private_bigquery_etl_ssh_keys
796
811
- run :
@@ -824,6 +839,7 @@ jobs:
824
839
paths :
825
840
- private-generated-sql
826
841
- PRIVATE_BIGQUERY_ETL_SHA
842
+ - dryrun_cache
827
843
- unless :
828
844
condition : *validate-sql
829
845
steps :
@@ -834,7 +850,7 @@ jobs:
834
850
- when :
835
851
condition : *deploy
836
852
steps :
837
- - *attach_generated_sql
853
+ - *attach_workspace_artifacts
838
854
- *add_private_bigquery_etl_ssh_keys
839
855
- run :
840
856
name : Push to private-generated-sql branch
@@ -871,7 +887,7 @@ jobs:
871
887
condition : *deploy
872
888
steps :
873
889
- checkout
874
- - *attach_generated_sql
890
+ - *attach_workspace_artifacts
875
891
- run :
876
892
name : Move generated-sql into place
877
893
command : |
0 commit comments