-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrisico_observations_template.yaml
1558 lines (1550 loc) · 56.8 KB
/
risico_observations_template.yaml
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
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
tosca_definitions_version: alien_dsl_3_0_0
metadata:
template_name: org.lexis.wp7.RisicoObservationsTemplate
template_version: 0.1.0-SNAPSHOT
template_author: lexis
description: RISICO template with a post-processing using observations data in input
imports:
- yorc-types:1.1.0
- yorc-openstack-types:3.1.0
- tosca-normative-types:1.0.0-ALIEN20
- docker-types:3.0.0
- alien-base-types:3.0.0
- org.lexis.common.heappe-types:1.0.8
- org.lexis.common.ddi-types:1.0.4
- org.lexis.common.dynamic-orchestration-types:1.0.4
- org.ystia.docker.containers.docker.generic:3.0.1-SNAPSHOT
- org.ystia.docker.ansible:3.0.0-SNAPSHOT
- org.lexis.common.datatransfer:0.1.8-SNAPSHOT
- org.lexis.wp7.wps:0.1.5-SNAPSHOT
- org.lexis.wp7.dewetra:0.1.0
topology_template:
inputs:
token:
type: string
description: "OpenID Connect token"
required: true
project_id:
type: string
description: "LEXIS project identifier"
required: true
preprocessing_start_date:
type: string
description: Start date of the simulation, format YYYYMMDDHH (warmup data from the 2 previous days will be also downloaded)
required: true
preprocessing_docker_image_gfs:
type: string
description: Pre-processing container repository path
default: "cimafoundation/wps-da.gfs:v2.0.3"
required: false
preprocessing_docker_image_observation_data:
type: string
description: Repository path of container downloading observation data
default: "cimafoundation/lexis-download-docker:v1.2.5"
required: false
preprocessing_dataset_path_geographical_data_path:
type: string
description: Dataset containing geographical data
default: project/proj2bdfd9ccf5a78c3ec68ee9e1d90d2c1c/055b25ea-ba60-11eb-a44e-0050568fc9b5/static_geog_data.tar.gz
# default: "project/proj2bdfd9ccf5a78c3ec68ee9e1d90d2c1c/69c0f740-33f0-11eb-8f85-0050568fcecc"
required: false
preprocessing_decrypt_dataset_geographical_data:
type: boolean
description: Should the input dataset be decrypted
default: false
required: false
preprocessing_uncompress_dataset_geographical_data:
type: boolean
description: Should the input dataset be uncompressed
default: true
required: false
preprocessing_volumes:
type: list
entry_schema:
type: string
description: |
List of volumes to mount within the pre-processing container.
Use docker CLI-style syntax: /host:/container[:mode]
default: ["/wps_data/gfs:/input", "/wps_data/output/inputs:/output", "/mnt/cloud_staging_area/risico:/geogrid"]
preprocessing_observation_data_volumes:
type: list
entry_schema:
type: string
description: |
List of volumes to mount within the post-processing container downloading observation data.
Use docker CLI-style syntax: /host:/container[:mode]
default: ["/wps_data/observations:/output"]
computation_heappe_command_template_name:
type: string
description: HEAppE Command Template Name
required: false
default: "WRF Generic"
computation_email_for_HEAppE_notifications:
type: string
description: E-mail where to receive notifications from HEAppE about the computation job (default, no email)
required: false
default: ""
postprocessing_dewetra_sftp_server_ip:
type: string
description: IP address of a Dewetra SPTP server where to store results (default, no sftp server upload)
required: false
default: ""
postprocessing_image:
type: string
description: Post-processing container repository path
default: "laurentg/risico:1.0.1"
required: false
postprocessing_ddi_project_path:
type: string
description: "Path where to transfer the post-processing results in DDI"
default: "project/proj2bdfd9ccf5a78c3ec68ee9e1d90d2c1c"
required: false
postprocessing_encrypt_dataset_result:
type: boolean
description: Encrypt the result dataset
default: false
required: false
postprocessing_compress_dataset_result:
type: boolean
description: Compress the result dataset
default: true
required: false
node_templates:
# Validation of the token provided in input
# Exchanging this token to have an access and refresh tokens
# for any component needing it in the workflow
ValidateExchangeToken:
type: org.lexis.common.dynamic.orchestration.nodes.ValidateAndExchangeToken
properties:
token: {get_input: token}
project_id: { get_input: project_id }
# Job gathering info on the input dataset:
# - on which locations it is available
# - size
# - number of files
# to take placement decisions on computing resources using this dataset
InputDatasetInfoJob:
type: org.lexis.common.ddi.nodes.GetDDIDatasetInfoJob
properties:
token: {get_input: token}
dataset_path: {get_input: preprocessing_dataset_path_geographical_data_path}
# Find the best cloud location depending on the input dataset and needed cloud resources
FindCloudLocationJob:
type: org.lexis.common.dynamic.orchestration.nodes.SetLocationsJob
metadata:
task: dynamic_orchestration
properties:
token: { get_input: token }
project_id: { get_input: project_id }
requirements:
- InputDataset:
type_requirement: input_dataset
node: InputDatasetInfoJob
capability: org.lexis.common.ddi.capabilities.DatasetInfo
relationship: org.lexis.common.dynamic.orchestration.relationships.Dataset
- CloudResourceVM:
type_requirement: cloud_instance
node: RisicoVM
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.dynamic.orchestration.relationships.CloudResource
# Floating IP address network
PublicNet:
type: yorc.nodes.openstack.FloatingIP
RisicoVM:
type: tosca.nodes.Compute
requirements:
- networkPublicNetConnection:
type_requirement: network
node: PublicNet
capability: tosca.capabilities.Connectivity
relationship: tosca.relationships.Network
capabilities:
host:
properties:
num_cpus: 10
disk_size: "150 GB"
os:
properties:
type: linux
distribution: ubuntu
scalable:
properties:
min_instances: 1
max_instances: 1
default_instances: 1
endpoint:
properties:
secure: true
protocol: tcp
network_name: PRIVATE
initiator: source
# At the end of the workflow, the Cloud instance token should be refreshed
# before attempting to uninstall the compute instance
RefreshVMToken:
type: org.lexis.common.dynamic.orchestration.nodes.RefreshTargetTokens
requirements:
- target:
type_requirement: target
node: RisicoVM
capability: tosca.capabilities.Node
relationship: tosca.relationships.DependsOn
GetDDIAccess:
type: org.lexis.common.ddi.nodes.DDIAccess
requirements:
- hostedOnComputeHost:
type_requirement: os
node: RisicoVM
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
DDIToCloudGEOGDatasetJob:
type: org.lexis.common.ddi.nodes.DDIToCloudJob
properties:
token: { get_input: token }
decrypt: {get_input: preprocessing_decrypt_dataset_geographical_data}
uncompress: {get_input: preprocessing_uncompress_dataset_geographical_data}
ddi_dataset_path: { get_input: preprocessing_dataset_path_geographical_data_path }
cloud_staging_area_directory_path: "risico_preprocessing_geog"
timestamp_cloud_staging_area_directory: true
requirements:
- sameSite:
type_requirement: os
node: RisicoVM
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
MountGEOGDataset:
type: org.lexis.common.ddi.nodes.SSHFSMountStagingAreaDataset
properties:
token: { get_input: token }
mount_point_directory: "/mnt/cloud_staging_area/risico"
requirements:
- ddi_access:
type_requirement: ddi_access
node: GetDDIAccess
capability: org.lexis.common.ddi.capabilities.DDIAccess
relationship: org.lexis.common.ddi.relationships.DDIAccessProvider
- data_transfer:
type_requirement: data_transfer
node: DDIToCloudGEOGDatasetJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
CreatePreProcessDirs:
type: org.lexis.common.datatransfer.nodes.CreateDirectories
properties:
directories: ["/wps_data/gfs", "/wps_data/output/inputs", "/wps_data/observations", "/wps_data/output/observations"]
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
Docker:
type: org.ystia.docker.ansible.nodes.Docker
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
CreatePostProcessDirs:
type: org.lexis.common.datatransfer.nodes.CreateDirectories
properties:
directories:
- "/risico_data/wrf"
- "/risico_data/output"
- "/risico_data/results"
- "/risico_data/observations"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
WPS_GFS:
type: org.ystia.docker.containers.docker.generic.nodes.GenericContainer
metadata:
task: preprocessing
properties:
auto_remove: false
cleanup: false
detach: false
image: {get_input: preprocessing_docker_image_gfs}
keep_volumes: true
restart_policy: no
cpu_share: 1.0
shm_size: "64 GB"
volumes: {get_input: preprocessing_volumes}
docker_env_vars: {concat: ["{\"WPS_START_DATE\": \"", get_input: preprocessing_start_date, "\", \"WPS_END_DATE\": \"", get_input: preprocessing_start_date, "\", \"WPS_MODE\": \"WARMUPDA\"}"]}
requirements:
- hostedOnContainerRuntimeDockerHost:
type_requirement: host
node: Docker
capability: org.alien4cloud.extended.container.capabilities.ApplicationHost
relationship: org.alien4cloud.extended.container.relationships.HostedOnContainerRuntime
capabilities:
scalable:
properties:
min_instances: 1
max_instances: 1
default_instances: 1
GFSData_D_day:
type: org.lexis.wp7.nodes.GFSData
properties:
start_date: {get_input: preprocessing_start_date}
end_date: {get_input: preprocessing_start_date}
past_day_number: 0
with_data_assimilation: true
left_longitude: "-19.0"
right_longitude: "48.0"
top_latitude: "64.0"
bottom_latitude: "24.0"
output_directory: "/wps_data/gfs"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
GFSData_day_before:
type: org.lexis.wp7.nodes.GFSData
properties:
start_date: {get_input: preprocessing_start_date}
end_date: {get_input: preprocessing_start_date}
past_day_number: 1
with_data_assimilation: true
left_longitude: "-19.0"
right_longitude: "48.0"
top_latitude: "64.0"
bottom_latitude: "24.0"
output_directory: "/wps_data/gfs"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
GFSData_2_days_before:
type: org.lexis.wp7.nodes.GFSData
properties:
start_date: {get_input: preprocessing_start_date}
end_date: {get_input: preprocessing_start_date}
past_day_number: 2
with_data_assimilation: true
left_longitude: "-19.0"
right_longitude: "48.0"
top_latitude: "64.0"
bottom_latitude: "24.0"
output_directory: "/wps_data/gfs"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Download observation data needed by RISICO
ObservationsData:
type: org.ystia.docker.containers.docker.generic.nodes.GenericContainer
properties:
auto_remove: false
cleanup: false
detach: false
image: {get_input: preprocessing_docker_image_observation_data}
keep_volumes: true
restart_policy: no
cpu_share: 1.0
shm_size: "64 GB"
volumes: {get_input: preprocessing_observation_data_volumes}
docker_env_vars: {concat: ["{\"START_DATE\": \"", get_input: preprocessing_start_date, "\", \"DOWNLOAD_TYPE\": \"RISICO\", \"WEBDROPS_USER\": \"", get_secret: ["/secret/wp7/webdrops/creds", "data=user"], "\", \"WEBDROPS_PWD\": \"", get_secret: ["/secret/wp7/webdrops/creds", "data=password"], "\"}"]}
requirements:
- hostedOnContainerRuntimeDockerHost:
type_requirement: host
node: Docker
capability: org.alien4cloud.extended.container.capabilities.ApplicationHost
relationship: org.alien4cloud.extended.container.relationships.HostedOnContainerRuntime
capabilities:
scalable:
properties:
min_instances: 1
max_instances: 1
default_instances: 1
# Move results to match WRF inputs structure expectations
MoveObservationData:
type: org.lexis.common.datatransfer.nodes.MoveFile
properties:
source_file: "/wps_data/observations/WRFDA/*"
destination: "/wps_data/output/observations"
as_user: "root"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Get pre-processing results details (size, number of files)
GetPreprocessDatasetInfo:
type: org.lexis.common.ddi.nodes.GetComputeInstanceDatasetInfo
properties:
dataset_path: "/wps_data/output"
requirements:
- host:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Find the best HPC location depending on the input dataset and needed HPC resources
FindHPCLocationsJob:
type: org.lexis.common.dynamic.orchestration.nodes.SetLocationsJob
metadata:
task: dynamic_orchestration
properties:
token: { get_input: token }
project_id: { get_input: project_id }
requirements:
- InputDataset:
type_requirement: input_dataset
node: GetPreprocessDatasetInfo
capability: org.lexis.common.ddi.capabilities.DatasetInfo
relationship: org.lexis.common.dynamic.orchestration.relationships.Dataset
- HPCResourceWRFJob:
type_requirement: heappe_job
node: WRF
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.dynamic.orchestration.relationships.HeappeJob
WRF:
type: org.lexis.common.heappe.nodes.Job
metadata:
task: computation
properties:
token: { get_input: token }
JobSpecification: {concat: ["{\"Name\":\"WRFJob\",\"Project\":\"MyProject\",\"ClusterId\":\"2\",\"NotificationEmail\":\"", get_input: computation_email_for_HEAppE_notifications ,"\",\"NotifyOnAbort\":\"true\",\"NotifyOnFinish\":\"true\",\"NotifyOnStart\":\"true\",\"Tasks\":[{\"Name\":\"", get_input: computation_heappe_command_template_name ,"\",\"MinCores\":\"512\",\"MaxCores\":\"512\",\"WalltimeLimit\":\"27000\",\"Priority\":\"4\",\"StandardOutputFile\":\"stdout\",\"StandardErrorFile\":\"stderr\",\"ProgressFile\":\"stdprog\",\"LogFile\":\"stdlog\",\"ClusterNodeTypeId\":\"1\",\"CommandTemplateId\":\"1\"}]}"]}
# Create a directory in staging area for WRF inputs
CreateStagingAreaWRFInputDir:
type: org.lexis.common.datatransfer.nodes.CreateStagingAreaDirectory
properties:
directory: "risico_wrf_inputs"
requirements:
- mountedCloudStagingArea:
type_requirement: mounted_staging_area
node: MountGEOGDataset
capability: org.lexis.common.ddi.capabilities.MountedStagingAreaAccess
relationship: org.lexis.common.datatransfer.relationships.MountedCloudStagingArea
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
StageWRFInputs:
type: org.lexis.common.datatransfer.nodes.CopyToStagingAreaDirectory
properties:
source_directory: "/wps_data/output/"
requirements:
- staging_area_directory:
type_requirement: cloud_area_directory_provider
node: CreateStagingAreaWRFInputDir
capability: org.lexis.common.ddi.capabilities.CloudAreaDirectoryProvider
relationship: org.lexis.common.ddi.relationships.CloudAreaDirectoryProvider
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Transfer these inputs to WRF
CloudToHPCTaskJob:
type: org.lexis.common.ddi.nodes.CloudToHPCJob
properties:
token: { get_input: token }
task_name: { get_input: computation_heappe_command_template_name }
requirements:
- cloud_area_directory_provider:
type_requirement: cloud_area_directory_provider
node: CreateStagingAreaWRFInputDir
capability: org.lexis.common.ddi.capabilities.CloudAreaDirectoryProvider
relationship: org.lexis.common.ddi.relationships.CloudAreaDirectoryProvider
- job:
type_requirement: job
node: WRF
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.heappe.relationships.SendInputsToJob
# Transfer HPC job results to the cloud staging area
HPCToCloudWRFJob:
type: org.lexis.common.ddi.nodes.HPCToCloudJob
properties:
token: { get_input: token }
task_name: { get_input: computation_heappe_command_template_name }
source_subdirectory: "results"
cloud_staging_area_directory_path: "risico_wrf_results"
timestamp_cloud_staging_area_directory: true
requirements:
- sameSite:
type_requirement: os
node: RisicoVM
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
- job:
type_requirement: job
node: WRF
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.ddi.relationships.SendJobOutputs
MountWRFDataset:
type: org.lexis.common.ddi.nodes.SSHFSMountStagingAreaDataset
properties:
token: { get_input: token }
mount_point_directory: "/mnt/cloud_staging_area/wrf_results"
requirements:
- ddi_access:
type_requirement: ddi_access
node: GetDDIAccess
capability: org.lexis.common.ddi.capabilities.DDIAccess
relationship: org.lexis.common.ddi.relationships.DDIAccessProvider
- data_transfer:
type_requirement: data_transfer
node: HPCToCloudWRFJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Move only the WRF auxhist results needed by post-processing
MoveWRFAuxhistResults:
type: org.lexis.common.datatransfer.nodes.MoveFile
properties:
source_file: "/mnt/cloud_staging_area/wrf_results/*/aux/*"
destination: "/risico_data/wrf/"
as_user: "root"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Move the WRF lexis result to be uploaded to dewetra
MoveWRFLexisResult:
type: org.lexis.common.datatransfer.nodes.MoveFile
properties:
source_file: "/mnt/cloud_staging_area/wrf_results/*/dewetra/lexis*"
destination: "/risico_data/results"
as_user: "root"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Transfer HEAppE WRF job results to DDI
HPCToDDIJob:
type: org.lexis.common.ddi.nodes.HPCToDDIJob
metadata:
task: preprocessing
properties:
token: { get_input: token }
metadata: {concat: ["{\"creator\": [\"RISICO workflow\"], \"contributor\": [\"RISICO workflow\"], \"publisher\": [\"RISICO workflow\"], \"resourceType\": \"Dataset\", \"title\": \"RISICO Workflow WRF result - ", get_input: preprocessing_start_date, "\"}"]}
encrypt: {get_input: postprocessing_encrypt_dataset_result}
compress: {get_input: postprocessing_compress_dataset_result}
ddi_path: { get_input: postprocessing_ddi_project_path }
task_name: { get_input: computation_heappe_command_template_name }
source_subdirectory: "results"
requirements:
- job:
type_requirement: job
node: WRF
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.ddi.relationships.SendJobOutputs
# Move observations data to match RISICO inputs structure expectations
MoveObservationRISICOData:
type: org.lexis.common.datatransfer.nodes.MoveFile
properties:
source_file: "/wps_data/observations/*/SENSORS/*"
destination: "/risico_data/observations"
as_user: "root"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
RISICO:
type: org.ystia.docker.containers.docker.generic.nodes.GenericContainer
metadata:
task: postprocessing
properties:
auto_remove: false
cleanup: false
detach: false
image: {get_input: postprocessing_image}
keep_volumes: true
restart_policy: no
cpu_share: 1.0
volumes: ["/risico_data/:/home/risico/data"]
docker_env_vars: {concat: ["{\"RISICO_RUN_DATE\": \"", get_input: preprocessing_start_date, "00\"}"]}
requirements:
- hostedOnContainerRuntimeDockerHost:
type_requirement: host
node: Docker
capability: org.alien4cloud.extended.container.capabilities.ApplicationHost
relationship: org.alien4cloud.extended.container.relationships.HostedOnContainerRuntime
capabilities:
scalable:
properties:
min_instances: 1
max_instances: 1
default_instances: 1
CreateStagingAreaResultDir:
type: org.lexis.common.datatransfer.nodes.CreateStagingAreaDirectory
properties:
directory: "risico_results"
requirements:
- mountedCloudStagingArea:
type_requirement: mounted_staging_area
node: MountGEOGDataset
capability: org.lexis.common.ddi.capabilities.MountedStagingAreaAccess
relationship: org.lexis.common.datatransfer.relationships.MountedCloudStagingArea
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
StageRISICOResults:
type: org.lexis.common.datatransfer.nodes.CopyToStagingAreaDirectory
properties:
source_directory: "/risico_data/output"
requirements:
- staging_area_directory:
type_requirement: cloud_area_directory_provider
node: CreateStagingAreaResultDir
capability: org.lexis.common.ddi.capabilities.CloudAreaDirectoryProvider
relationship: org.lexis.common.ddi.relationships.CloudAreaDirectoryProvider
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
CloudToDDIJob:
type: org.lexis.common.ddi.nodes.CloudToDDIJob
properties:
metadata: {concat: ["{\"creator\": [\"RISICO workflow\"], \"contributor\": [\"RISICO workflow\"], \"publisher\": [\"RISICO workflow\"], \"resourceType\": \"Dataset\", \"title\": \"RISICO Workflow result - ", get_input: preprocessing_start_date, "\"}"]}
token: { get_input: token }
encrypt: {get_input: postprocessing_encrypt_dataset_result}
compress: {get_input: postprocessing_compress_dataset_result}
ddi_path: { get_input: postprocessing_ddi_project_path }
requirements:
- cloud_area_directory_provider:
type_requirement: cloud_area_directory_provider
node: CreateStagingAreaResultDir
capability: org.lexis.common.ddi.capabilities.CloudAreaDirectoryProvider
relationship: org.lexis.common.ddi.relationships.CloudAreaDirectoryProvider
DewetraUpload:
type: org.lexis.wp7.nodes.DewetraUpload
properties:
start_date: { get_input: preprocessing_start_date }
computation_type: RISICO
wrf_results_dir: "/risico_data/results"
postprocessing_results_dir: "/risico_data/output"
sftp_server_ip: { get_input: postprocessing_dewetra_sftp_server_ip }
requirements:
- hostedOnComputeHost:
type_requirement: host
node: RisicoVM
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
DeleteCloudWRFDataJob:
type: org.lexis.common.ddi.nodes.DeleteCloudDataJob
properties:
token: { get_input: token }
requirements:
- cloud_area_dataset_provider:
type_requirement: cloud_area_dataset_provider
node: HPCToCloudWRFJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
DeleteCloudGEOGDataJob:
type: org.lexis.common.ddi.nodes.DeleteCloudDataJob
properties:
token: { get_input: token }
requirements:
- cloud_area_dataset_provider:
type_requirement: cloud_area_dataset_provider
node: DDIToCloudGEOGDatasetJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
outputs:
computation_dataset_wrf_result_path:
description: DDI path to RISICO WRF results
value: { get_attribute: [ HPCToDDIJob, destination_path ] }
postprocessing_ddi_project_path:
description: DDI path to RISICO post-processing results
value: { get_attribute: [ CloudToDDIJob, destination_path ] }
workflows:
# At deployment time, validating the input token and exchanging it
# to get an access/refresh token for the orchestrator
install:
steps:
ValidateExchangeToken_start:
target: ValidateExchangeToken
activities:
- call_operation: Standard.start
on_success:
- ValidateExchangeToken_started
ValidateExchangeToken_started:
target: ValidateExchangeToken
activities:
- set_state: started
uninstall:
steps:
DeleteCloudGEOGDataJob_create:
target: DeleteCloudGEOGDataJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- DeleteCloudGEOGDataJob_submit
DeleteCloudGEOGDataJob_submit:
target: DeleteCloudGEOGDataJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- DeleteCloudWRFDataJob_create
DeleteCloudWRFDataJob_create:
target: DeleteCloudWRFDataJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- DeleteCloudWRFDataJob_submit
DeleteCloudWRFDataJob_submit:
target: DeleteCloudWRFDataJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- WRF_delete
WRF_delete:
target: WRF
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.delete
on_success:
- RefreshVMToken_start
RefreshVMToken_start:
target: RefreshVMToken
activities:
- call_operation: Standard.start
on_success:
- RefreshVMToken_started
RefreshVMToken_started:
target: RefreshVMToken
activities:
- set_state: started
on_success:
- Compute_uninstall
Compute_uninstall:
target: RisicoVM
activities:
- delegate: uninstall
on_success:
- Network_uninstall
Network_uninstall:
target: PublicNet
activities:
- delegate: uninstall
Run:
steps:
# Submit DDI job to get info on dataset (DDI location where it is available, size...)
InputDatasetInfoJob_submit:
target: InputDatasetInfoJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- InputDatasetInfoJob_run
InputDatasetInfoJob_run:
target: InputDatasetInfoJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- InputDatasetInfoJob_executed
InputDatasetInfoJob_executed:
target: InputDatasetInfoJob
activities:
- set_state: executed
on_success:
- FindCloudLocationJob_submit
# Submit the computation to find the best location from these inputs
FindCloudLocationJob_submit:
target: FindCloudLocationJob
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- FindCloudLocationJob_run
FindCloudLocationJob_run:
target: FindCloudLocationJob
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- FindCloudLocationJob_executed
FindCloudLocationJob_executed:
target: FindCloudLocationJob
activities:
- set_state: executed
on_success:
- DDIToCloudGEOGDatasetJob_create
- Network_install
# Get a floating IP address for the Cloud Compute instance
Network_install:
target: PublicNet
activities:
- delegate: install
on_success:
- Compute_install
Compute_install:
target: RisicoVM
activities:
- delegate: install
on_success:
- GetDDIAccess_start
- CreatePreProcessDirs_start
- Docker_create
GetDDIAccess_start:
target: GetDDIAccess
activities:
- call_operation: Standard.start
on_success:
- GetDDIAccess_started
GetDDIAccess_started:
target: GetDDIAccess
activities:
- set_state: started
on_success:
- MountGEOGDataset_create
DDIToCloudGEOGDatasetJob_create:
target: DDIToCloudGEOGDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- DDIToCloudGEOGDatasetJob_submit
DDIToCloudGEOGDatasetJob_submit:
target: DDIToCloudGEOGDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- DDIToCloudGEOGDatasetJob_submitted
DDIToCloudGEOGDatasetJob_submitted:
target: DDIToCloudGEOGDatasetJob
activities:
- set_state: submitted
on_success:
- DDIToCloudGEOGDatasetJob_run
DDIToCloudGEOGDatasetJob_run:
target: DDIToCloudGEOGDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- DDIToCloudGEOGDatasetJob_executed
DDIToCloudGEOGDatasetJob_executed:
target: DDIToCloudGEOGDatasetJob
activities:
- set_state: executed
on_success:
- MountGEOGDataset_create
MountGEOGDataset_create:
target: MountGEOGDataset
activities:
- call_operation: Standard.create
on_success:
- MountGEOGDataset_created
MountGEOGDataset_created:
target: MountGEOGDataset
activities:
- set_state: created
on_success:
- MountGEOGDataset_refresh_token
MountGEOGDataset_refresh_token:
target: MountGEOGDataset
activities:
- call_operation: custom.refresh_token
on_success:
- MountGEOGDataset_start
MountGEOGDataset_start:
target: MountGEOGDataset
activities:
- call_operation: Standard.start
on_success:
- MountGEOGDataset_started
MountGEOGDataset_started:
target: MountGEOGDataset
activities:
- set_state: started
on_success:
- WPS_GFS_start
CreatePreProcessDirs_start:
target: CreatePreProcessDirs
activities:
- call_operation: Standard.start
on_success:
- CreatePreProcessDirs_started
CreatePreProcessDirs_started:
target: CreatePreProcessDirs
activities:
- set_state: started
on_success:
- GFSData_D_day_start
- GFSData_day_before_start
- GFSData_2_days_before_start
GFSData_D_day_start:
target: GFSData_D_day
activities:
- call_operation: Standard.start
on_success:
- GFSData_D_day_started
GFSData_D_day_started:
target: GFSData_D_day
activities:
- set_state: started
on_success:
- WPS_GFS_start
GFSData_day_before_start:
target: GFSData_day_before
activities:
- call_operation: Standard.start
on_success:
- GFSData_day_before_started
GFSData_day_before_started:
target: GFSData_day_before
activities:
- set_state: started
on_success:
- WPS_GFS_start
GFSData_2_days_before_start:
target: GFSData_2_days_before
activities:
- call_operation: Standard.start
on_success:
- GFSData_2_days_before_started
GFSData_2_days_before_started:
target: GFSData_2_days_before
activities:
- set_state: started
on_success:
- WPS_GFS_start
Docker_create:
target: Docker
activities:
- call_operation: Standard.create
on_success:
- Docker_configure
Docker_configure:
target: Docker
activities:
- call_operation: Standard.configure
on_success:
- Docker_start
Docker_start:
target: Docker
activities:
- call_operation: Standard.start
on_success:
- Docker_started
Docker_started:
target: Docker
activities:
- set_state: started
on_success:
- ObservationsData_create
ObservationsData_create:
target: ObservationsData
activities:
- call_operation: Standard.create
on_success:
- ObservationsData_start
- WPS_GFS_create
WPS_GFS_create:
target: WPS_GFS
activities:
- call_operation: Standard.create
on_success:
- MountGEOGDataset_create
WPS_GFS_start:
target: WPS_GFS
activities:
- call_operation: Standard.start
on_success:
- WPS_GFS_started
WPS_GFS_started:
target: WPS_GFS
activities:
- set_state: started
on_success:
- WPS_GFS_delete
WPS_GFS_delete:
target: WPS_GFS
activities:
- call_operation: Standard.delete
on_success: