-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig_ppp.yaml
More file actions
630 lines (622 loc) · 23.6 KB
/
config_ppp.yaml
File metadata and controls
630 lines (622 loc) · 23.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
---
# Platform Output Support Configuration File - PPP
work_path: ./work
log_level: DEBUG
release_uri: gs://open-targets-pipeline-runs/sz/26.03-ppp.1 # e.g gs://open-targets-pipeline-runs/szsz/25.06-testrun-4
scratchpad:
# ================================= SET THESE VALUES ====================================
release: 26.03 # e.g. 25.12
data_source: gs://open-targets-pipeline-runs/sz/26.03-ppp.1 # same as release_uri
database_namespace: ppp2603 # e.g. ppp2603
# Google disk snapshot variables
opensearch_disk_name: ppp-2603-os
opensearch_disk_snapshot_name: ppp-2603-os
clickhouse_disk_name: ppp-2603-ch
clickhouse_disk_snapshot_name: ppp-2603-ch
# ========================= THESE VALUES RARELY NEED CHANGING ===========================
disk_snapshot_project_id: open-targets-eu-dev
release_gcs_bucket: gs://open-targets-ppp-data-releases
aws_address: s3://open-targets-public-data-releases/platform
# temp file locations
local_data: release_data
prepared_data: prepared_data
# opensearch
opensearch_version: 3.5.0
opensearch_java_opts: -Xms60g -Xmx300g
opensearch_data: /mnt/opensearch/data
opensearch_logs: /var/log/pos/opensearch
opensearch_snapshot_repository: ot-os-snapshots
opensearch_snapshot_bucket: open-targets-data-backends
opensearch_snapshot_base_path: opensearch
opensearch_indices_to_restore: '*,-.*' # e.g. '*,-.*' to restore all except hidden indices
# clickhouse
clickhouse_version: 25.8.18.1
clickhouse_data: /mnt/clickhouse/data
clickhouse_logs: /var/log/pos/clickhouse
clickhouse_backup_base_path: https://storage.googleapis.com/open-targets-data-backends/clickhouse/
steps:
##################################################################################################
# Full PPP backend
##################################################################################################
backend:
# sync data
- name: sync_bucket etl output files
source: ${data_source}/output
destination: ${local_data}/output
- name: sync_bucket etl view files
source: ${data_source}/view
destination: ${local_data}/view
# ot croissant
- name: ot_croissant generate release metadata
requires:
- sync_bucket etl output files
ftp_address:
gcp_address: ${release_gcs_bucket}/${release}/output/
aws_address:
dataset_path: ${local_data}/output
output: croissant.json
prepared_data_parent: ${prepared_data}
# opensearch
- name: open_search_start data loading instance
volume_data: ${opensearch_data}
volume_logs: ${opensearch_logs}
opensearch_version: ${opensearch_version}
opensearch_java_opts: ${opensearch_java_opts}
startup_wait: '60'
- name: explode prep and load all datasets
requires:
- sync_bucket etl output files
- sync_bucket etl view files
- ot_croissant generate release metadata
- open_search_start data loading instance
foreach: &opensearch_datasets
- croissant
- facet_search_disease
- facet_search_target
- search_disease
- search_drug
- search_study
- search_target
- search_variant
do:
- name: explode_data_prep ${each}
dataset: ${each}
parquet_parent: ${local_data}
json_parent: ${prepared_data}
step: opensearch
- name: open_search_create_index ${each}
requires:
- explode_data_prep ${each}
dataset: ${each}
prefix: ${database_namespace}
- name: open_search_load dataset ${each}
requires:
- open_search_create_index ${each}
dataset: ${each}
prefix: ${database_namespace}
json_parent: ${prepared_data}
- name: open_search_snapshot data loading instance
requires:
- explode prep and load all datasets
snapshot_repository_name: ${opensearch_snapshot_repository}
snapshot_name: ${database_namespace}
snapshot_bucket: ${opensearch_snapshot_bucket}
snapshot_base_path: ${opensearch_snapshot_base_path}/${database_namespace}
- name: open_search_stop data loading instance
requires:
- open_search_snapshot data loading instance
service_name: os-pos
- name: create_gcp_disk_snapshot opensearch
gcp_project_id: ${disk_snapshot_project_id}
gcp_disk_name: ${opensearch_disk_name}
gcp_snapshot_name: ${opensearch_disk_snapshot_name}
gcp_disk_zone: europe-west1-d
mount_point: ${opensearch_data}
requires:
- open_search_stop data loading instance
# clickhouse
- name: clickhouse_start data loading instance
volume_data: ${clickhouse_data}
volume_logs: ${clickhouse_logs}
clickhouse_version: ${clickhouse_version}
clickhouse_database: ${database_namespace}
- name: explode load all datasets
requires:
- sync_bucket etl output files
- sync_bucket etl view files
- clickhouse_start data loading instance
foreach: &clickhouse_datasets
- baseline_expression
- biosample
- credible_sets
- colocalisation
- disease_hpo
- drug
- drug_warnings
- enhancer_to_gene
- evidence
- expression
- go
- hpo
- interaction_evidence
- l2g_predictions
- literature
- mechanism_of_action
- mouse_phenotypes
- novelty
- openfda_faers
- otar_projects
- pharmacogenomics
- protein_coding_coords
- so
- target_essentiality
- variants
- w2v
- clinical_indication
- clinical_report
- clinical_target
do:
- name: clickhouse_load clickhouse load ${each}
dataset: ${each}
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse target_prioritisation
requires:
- clickhouse_load clickhouse load target_essentiality
dataset: target_prioritisation
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load interaction
requires:
- clickhouse_load clickhouse load interaction_evidence
dataset: interaction
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load studies
requires:
- clickhouse_load clickhouse load credible_sets
dataset: studies
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load targets
requires:
- clickhouse_load clickhouse load studies
dataset: targets
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load disease
requires:
- clickhouse_load clickhouse load studies
dataset: disease
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load aotf
requires:
- clickhouse_load clickhouse load disease
dataset: aotf
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: explode backup clickhouse tables
requires:
- explode load all datasets
- clickhouse_load clickhouse target_prioritisation
- clickhouse_load clickhouse load interaction
- clickhouse_load clickhouse load studies
- clickhouse_load clickhouse load disease
- clickhouse_load clickhouse load aotf
- clickhouse_load clickhouse load targets
foreach: &clickhouse_tables
- associations_otf_target
- associations_otf_disease
- baseline_expression
- biosample
- colocalisation
- credible_sets
- credible_sets_by_variant
- credible_sets_by_region
- credible_sets_locus
- disease_hpo
- disease
- drug_warnings
- drug
- enhancer_to_gene
- evidence
- evidence_by_variant
- evidence_by_disease_and_target
- expression
- gene_ontology
- hpo
- interaction
- l2g_predictions
- literature
- mechanism_of_action
- ml_w2v
- mouse_phenotypes
- novelty
- openfda_faers
- otar_projects
- pharmacogenomics_by_drug
- pharmacogenomics_by_target
- pharmacogenomics_by_variant
- protein_coding_coords_by_target
- protein_coding_coords_by_variant
- sequence_ontology
- studies
- target_essentiality
- target_prioritisation
- targets
- variants
- clinical_indication_disease
- clinical_indication_drug
- clinical_report
- clinical_target
do:
- name: clickhouse_backup table ${each}
clickhouse_database: ${database_namespace}
table: ${each}
gcs_base_path: ${clickhouse_backup_base_path}
- name: clickhouse_stop data loading instance
requires:
- explode backup clickhouse tables
clickhouse_database_name: ${database_namespace}
- name: create_gcp_disk_snapshot clickhouse
requires:
- clickhouse_stop data loading instance
gcp_project_id: ${disk_snapshot_project_id}
gcp_disk_name: ${clickhouse_disk_name}
gcp_snapshot_name: ${clickhouse_disk_snapshot_name}
gcp_disk_zone: europe-west1-d
mount_point: ${clickhouse_data}
# Tarballs
################################################################################################
tarballs:
- name: tarball opensearch
source: /mnt/opensearch
destination: disk_images/opensearch.tgz
- name: tarball clickhouse
source: /mnt/clickhouse
destination: disk_images/clickhouse.tgz
################################################################################################
# Sync data only
################################################################################################
sync_data:
- name: sync_bucket etl output files
source: ${data_source}/output
destination: ${local_data}/output
- name: sync_bucket etl view files
source: ${data_source}/view
destination: ${local_data}/view
################################################################################################
# OT Croissant
################################################################################################
ot_croissant:
- name: sync_bucket etl output files
source: ${data_source}/output
destination: ${local_data}/output
- name: ot_croissant generate release metadata
requires:
- sync_bucket etl output files
ftp_address:
gcp_address: ${release_gcs_bucket}/${release}/output/
aws_address:
dataset_path: ${local_data}/output
output: croissant.json
prepared_data_parent: ${prepared_data}
################################################################################################
# OpenSearch
################################################################################################
opensearch:
- name: sync_bucket etl output files
source: ${data_source}/output
destination: ${local_data}/output
- name: sync_bucket etl view files
source: ${data_source}/view
destination: ${local_data}/view
- name: ot_croissant generate release metadata
requires:
- sync_bucket etl output files
ftp_address:
gcp_address: ${release_gcs_bucket}/${release}/output/
aws_address:
dataset_path: ${local_data}/output
output: croissant.json
prepared_data_parent: ${prepared_data}
- name: open_search_start data loading instance
volume_data: ${opensearch_data}
volume_logs: ${opensearch_logs}
opensearch_version: ${opensearch_version}
opensearch_java_opts: ${opensearch_java_opts}
startup_wait: '60'
- name: explode prep and load all datasets
requires:
- sync_bucket etl output files
- sync_bucket etl view files
- ot_croissant generate release metadata
- open_search_start data loading instance
foreach: *opensearch_datasets
do:
- name: explode_data_prep ${each}
dataset: ${each}
parquet_parent: ${local_data}
json_parent: ${prepared_data}
step: opensearch
- name: open_search_create_index ${each}
requires:
- explode_data_prep ${each}
dataset: ${each}
prefix: ${database_namespace}
- name: open_search_load dataset ${each}
requires:
- open_search_create_index ${each}
dataset: ${each}
prefix: ${database_namespace}
json_parent: ${prepared_data}
- name: open_search_stop data loading instance
requires:
- explode prep and load all datasets
service_name: os-pos
- name: create_gcp_disk_snapshot opensearch
gcp_project_id: ${disk_snapshot_project_id}
gcp_disk_name: ${opensearch_disk_name}
gcp_snapshot_name: ${opensearch_disk_snapshot_name}
gcp_disk_zone: europe-west1-d
mount_point: ${opensearch_data}
requires:
- open_search_stop data loading instance
################################################################################################
# OpenSearch - Modular Steps
################################################################################################
opensearch_start:
- name: open_search_start data loading instance
service_name: os-pos
volume_data: ${opensearch_data}
volume_logs: ${opensearch_logs}
opensearch_version: ${opensearch_version}
opensearch_java_opts: ${opensearch_java_opts}
opensearch_disk_snapshot:
- name: create_gcp_disk_snapshot opensearch
gcp_project_id: ${disk_snapshot_project_id}
gcp_disk_name: ${opensearch_disk_name}
gcp_snapshot_name: ${opensearch_disk_snapshot_name}
gcp_disk_zone: europe-west1-d
mount_point: ${opensearch_data}
opensearch_snapshot: # create a snapshot of the opensearch data NOT the disk.
- name: open_search_start data loading instance
volume_data: ${opensearch_data}
volume_logs: ${opensearch_logs}
opensearch_version: ${opensearch_version}
opensearch_java_opts: ${opensearch_java_opts}
startup_wait: '60'
- name: open_search_snapshot data loading instance
requires:
- open_search_start data loading instance
snapshot_repository_name: ${opensearch_snapshot_repository}
snapshot_name: ${database_namespace}
snapshot_bucket: ${opensearch_snapshot_bucket}
snapshot_base_path: ${opensearch_snapshot_base_path}/${database_namespace}
opensearch_restore:
- name: open_search_restore indices
snapshot_repository_name: ${opensearch_snapshot_repository}
snapshot_name: ${database_namespace}
snapshot_bucket: ${opensearch_snapshot_bucket}
snapshot_base_path: ${opensearch_snapshot_base_path}/${database_namespace}
indices: ${opensearch_indices_to_restore}
opensearch_stop:
- name: open_search_stop data loading instance
service_name: os-pos
opensearch_tarball:
- name: tarball opensearch
source: /mnt/opensearch
destination: disk_images/opensearch.tgz
opensearch_prep_all:
- name: sync_bucket pipeline output files
source: ${data_source}/output
destination: ${local_data}/output
- name: sync_bucket pipeline view files
source: ${data_source}/view/
destination: ${local_data}/view
- name: explode prep all datasets
requires:
- sync_bucket pipeline output files
- sync_bucket pipeline view files
foreach: *opensearch_datasets
do:
- name: explode_data_prep ${each}
dataset: ${each}
parquet_parent: ${local_data}
json_parent: ${prepared_data}
step: opensearch
opensearch_load_all:
- name: open_search_start data loading instance
volume_data: ${opensearch_data}
volume_logs: ${opensearch_logs}
opensearch_version: ${opensearch_version}
opensearch_java_opts: ${opensearch_java_opts}
- name: explode load all datasets
foreach: *opensearch_datasets
do:
- name: open_search_create_index ${each}
requires:
- open_search_start data loading instance
dataset: ${each}
prefix: ${database_namespace}
- name: open_search_load dataset ${each}
requires:
- open_search_create_index ${each}
dataset: ${each}
prefix: ${database_namespace}
json_parent: ${prepared_data}
################################################################################################
# ClickHouse
################################################################################################
clickhouse:
- name: sync_bucket etl output files
source: ${data_source}/output
destination: ${local_data}/output
- name: sync_bucket etl view files
source: ${data_source}/view
destination: ${local_data}/view
- name: clickhouse_start data loading instance
volume_data: ${clickhouse_data}
volume_logs: ${clickhouse_logs}
clickhouse_version: ${clickhouse_version}
clickhouse_database: ${database_namespace}
- name: explode load all datasets
requires:
- sync_bucket etl output files
- sync_bucket etl view files
- clickhouse_start data loading instance
foreach: *clickhouse_datasets
do:
- name: clickhouse_load clickhouse load ${each}
dataset: ${each}
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse target_prioritisation
requires:
- clickhouse_load clickhouse load target_essentiality
dataset: target_prioritisation
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load interaction
requires:
- clickhouse_load clickhouse load interaction_evidence
dataset: interaction
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load studies
requires:
- clickhouse_load clickhouse load credible_sets
dataset: studies
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load targets
requires:
- clickhouse_load clickhouse load studies
dataset: targets
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load disease
requires:
- clickhouse_load clickhouse load studies
dataset: disease
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load aotf
requires:
- clickhouse_load clickhouse load disease
dataset: aotf
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_stop data loading instance
requires:
- explode load all datasets
- clickhouse_load clickhouse target_prioritisation
- clickhouse_load clickhouse load interaction
- clickhouse_load clickhouse load studies
- clickhouse_load clickhouse load disease
- clickhouse_load clickhouse load aotf
- clickhouse_load clickhouse load targets
clickhouse_database_name: ${database_namespace}
- name: create_gcp_disk_snapshot clickhouse
requires:
- clickhouse_stop data loading instance
gcp_project_id: ${disk_snapshot_project_id}
gcp_disk_name: ${clickhouse_disk_name}
gcp_snapshot_name: ${clickhouse_disk_snapshot_name}
gcp_disk_zone: europe-west1-d
mount_point: ${clickhouse_data}
################################################################################################
# ClickHouse - Modular Steps
################################################################################################
clickhouse_start:
- name: clickhouse_start data loading instance
volume_data: ${clickhouse_data}
volume_logs: ${clickhouse_logs}
clickhouse_version: ${clickhouse_version}
clickhouse_database: ${database_namespace}
clickhouse_tarball:
- name: tarball clickhouse
source: /mnt/clickhouse
destination: disk_images/clickhouse.tgz
clickhouse_disk_snapshot:
- name: create_gcp_disk_snapshot clickhouse
gcp_project_id: ${disk_snapshot_project_id}
gcp_disk_name: ${clickhouse_disk_name}
gcp_snapshot_name: ${clickhouse_disk_snapshot_name}
gcp_disk_zone: europe-west1-d
mount_point: ${clickhouse_data}
clickhouse_backup_all:
- name: clickhouse_start data loading instance
volume_data: ${clickhouse_data}
volume_logs: ${clickhouse_logs}
clickhouse_version: ${clickhouse_version}
clickhouse_database: ${database_namespace}
- name: explode backup clickhouse tables
requires:
- clickhouse_start data loading instance
foreach: *clickhouse_tables
do:
- name: clickhouse_backup table ${each}
requires:
- clickhouse_start data loading instance
clickhouse_database: ${database_namespace}
table: ${each}
gcs_base_path: ${clickhouse_backup_base_path}
clickhouse_restore_all:
- name: clickhouse_create_database for restoration
clickhouse_database: ${database_namespace}
- name: explode restore clickhouse tables
requires:
- clickhouse_create_database for restoration
foreach: *clickhouse_tables
do:
- name: clickhouse_restore table ${each}
clickhouse_database: ${database_namespace}
table: ${each}
gcs_base_path: ${clickhouse_backup_base_path}
clickhouse_stop:
- name: clickhouse_stop data loading instance
clickhouse_database_name: ${database_namespace}
clickhouse_load_all:
- name: sync_bucket pipeline output files
source: ${data_source}/output
destination: ${local_data}/output
- name: sync_bucket pipeline view files
source: ${data_source}/view
destination: ${local_data}/view
- name: clickhouse_start data loading instance
volume_data: ${clickhouse_data}
volume_logs: ${clickhouse_logs}
clickhouse_version: ${clickhouse_version}
clickhouse_database: ${database_namespace}
- name: explode load all datasets
foreach: *clickhouse_datasets
do:
- name: clickhouse_load clickhouse load ${each}
requires:
- clickhouse_start data loading instance
- sync_bucket pipeline output files
- sync_bucket pipeline view files
dataset: ${each}
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load aotf
requires:
- clickhouse_load clickhouse load disease
dataset: aotf
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
- name: clickhouse_load clickhouse load targets
requires:
- clickhouse_load clickhouse load credible_sets
- clickhouse_load clickhouse load studies
dataset: targets
clickhouse_database: ${database_namespace}
data_dir_parent: ${local_data}
################################################################################################
# gcs_sync
gcs_sync:
- name: sync_bucket gcs release data
source: ${data_source}/
destination: ${release_gcs_bucket}/${release}/