-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlexis_template.yaml
More file actions
1642 lines (1606 loc) · 59.1 KB
/
lexis_template.yaml
File metadata and controls
1642 lines (1606 loc) · 59.1 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
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.common.LEXISTemplate
template_version: 0.1.0-SNAPSHOT
template_author: lexis
description: "LEXIS Generic Template"
#
# Imports from Alien4Cloud catalog providing definition of data types and node types
#
imports:
- tosca-normative-types:1.0.0-ALIEN20
- yorc-openstack-types:3.1.0
- docker-types:3.0.0
- org.ystia.docker.ansible:3.0.0-SNAPSHOT
- org.ystia.docker.containers.docker.generic:3.0.1-SNAPSHOT
- 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.lexis.common.datatransfer:0.1.8-SNAPSHOT
topology_template:
#
# Input parameters.
# The only required parameter is the OpenID Connect token.
# Other parameters have default values.
#
# Naming convention expected by LEXIS Portal:
# - input parameters used in the pre-processing phase start with preprocessing_
# - input parameters uded in the HPC computation phase start with computation_
# - input parameters used in the postprocessing phase start with postprocessing_
# - Paths of DDI dataset are expect to follow the experession <phase>_dataset_*
# for example: preprocessing_dataset_path_input_path
#
inputs:
token:
type: string
description: "OpenID Connect token"
required: true
project_id:
type: string
description: "LEXIS project identifier"
required: true
preprocessing_dataset_path_input_path:
type: string
description: Dataset containing input data
required: true
preprocessing_container_image:
type: string
description: Preprocessing container repository path
#default: "laurentg/lexistest:1.2"
required: true
postprocessing_container_image:
type: string
description: Postprocessing container repository path
#default: "laurentg/lexistest:1.2"
required: true
postprocessing_ddi_project_path:
type: string
description: "Path where to transfer the post-processing results in DDI"
required: true
preprocessing_decrypt_dataset_input:
type: boolean
description: Should the input dataset be decrypted
default: false
required: false
preprocessing_uncompress_dataset_input:
type: boolean
description: Should the input dataset be uncompressed
default: false
required: false
preprocessing_mount_point_input_dataset:
type: string
description: Directory on the compute instance where to mount the dataset
default: "/mnt/lexis_test"
required: false
preprocessing_container_env_vars:
type: map
description: Preprocessing container environment variables
entry_schema:
type: string
default:
INPUT_DIR: "/input_dataset"
RESULT_DIR: "/output"
RESULT_FILE_NAME: "preprocessing_result.txt"
required: false
preprocessing_container_published_ports:
type: list
entry_schema:
type: string
description: >
List of ports to publish from the container to the host.
Use docker CLI syntax: 8000, 9000:8000, or 0.0.0.0:9000:8000, where 8000 is a container port, 9000 is a host port, and 0.0.0.0 is a host interface.
required: false
preprocessing_container_volumes:
type: list
entry_schema:
type: string
description: |
List of volumes to mount within the preprocessing container.
Use docker CLI-style syntax: /host:/container[:mode]
default:
- "/mnt/lexis_test:/input_dataset"
- "/lexistest/output:/output"
required: false
preprocessing_output_directory:
type: string
description: Preprocessing output directory
default: "/lexistest/output"
required: false
computation_heappe_command_template_name:
type: string
description: HEAppE Command Template Name
required: false
default: GenericCommandTemplate
computation_heappe_job:
type: org.lexis.common.heappe.types.JobSpecification
description: Description of the HEAppE job/tasks
required: false
default:
Name: GenericJob
Project: "Set by orchestrator"
ClusterId: 1
Tasks:
- Name: GenericCommandTemplate
ClusterNodeTypeId: 1
CommandTemplateId: 1
TemplateParameterValues:
- CommandParameterIdentifier: userScriptPath
ParameterValue: ""
WalltimeLimit: 3600
MinCores: 1
MaxCores: 1
Priority: 4
StandardOutputFile: "stdout"
StandardErrorFile: "stderr"
ProgressFile: "stdprog"
LogFile: "stdlog"
computation_hpc_subdirectory_to_stage:
description: Relative path to a subddirectoy on the HPC job cluster file system, to stage
type: string
required: false
computation_metadata_dataset_result:
type: org.lexis.common.ddi.types.Metadata
description: Metadata for the Computation results dataset to create in DDI
default:
creator:
- "LEXIS worflow"
contributor:
- "LEXIS worflow"
publisher:
- "LEXIS worflow"
resourceType: "Dataset"
title: "LEXIS computation results"
required: false
postprocessing_container_env_vars:
type: map
description: Postprocessing container environment variables
entry_schema:
type: string
default:
INPUT_DIR: "/input_dataset"
RESULT_DIR: "/output"
RESULT_FILE_NAME: "postprocessing_result.txt"
required: false
postprocessing_container_volumes:
type: list
entry_schema:
type: string
description: |
List of volumes to mount within the postprocessing container.
Use docker CLI-style syntax: /host:/container[:mode]
default:
- "/input_computation_results:/input_dataset"
- "/output_postprocessing:/output"
required: false
postprocessing_container_published_ports:
type: list
entry_schema:
type: string
description: >
List of ports to publish from the container to the host.
Use docker CLI syntax: 8000, 9000:8000, or 0.0.0.0:9000:8000, where 8000 is a container port, 9000 is a host port, and 0.0.0.0 is a host interface.
required: false
postprocessing_input_directory:
type: string
description: Postprocessing input directory
default: "/input_computation_results"
required: false
postprocessing_output_directory:
type: string
description: Postprocessing output directory
default: "/output_postprocessing"
required: false
postprocessing_metadata_dataset_result:
type: org.lexis.common.ddi.types.Metadata
description: Metadata for the postprocessing results dataset to create in DDI
default:
creator:
- "LEXIS worflow"
contributor:
- "LEXIS worflow"
publisher:
- "LEXIS worflow"
resourceType: "Dataset"
title: "LEXIS workflow results"
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: false
required: false
postprocessing_result_dataset_replication_sites:
description: "List of sites where the result dataset should be available - WARNING: a replicated dataset can't be deleted - (example of values: it4i, lrz)"
type: list
entry_schema:
type: string
required: false
default: []
#
# Components instantiating the types imported, and using the input values above
# in properties definitions.
# Relationships between these components describing which requirement of a commponent
# is fulfilled by which capability of another component
#
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_input_path}
# DDI job managing the transfer of an input dataset from DDI to cloud staging area
DDIToCloudInputDatasetJob:
type: org.lexis.common.ddi.nodes.DDIToCloudJob
properties:
token: {get_input: token}
decrypt: {get_input: preprocessing_decrypt_dataset_input}
uncompress: {get_input: preprocessing_uncompress_dataset_input}
ddi_dataset_path: { get_input: preprocessing_dataset_path_input_path }
cloud_staging_area_directory_path: "lexis_test_preprocessing"
timestamp_cloud_staging_area_directory: true
requirements:
- sameSite:
type_requirement: os
node: ComputeInstance
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
# Floating IP address network
Network:
type: yorc.nodes.openstack.FloatingIP
# Cloud Compute Instance
ComputeInstance:
type: tosca.nodes.Compute
requirements:
- networkPublicNetConnection:
type_requirement: network
node: Network
capability: yorc.capabilities.openstack.FIPConnectivity
relationship: tosca.relationships.Network
capabilities:
host:
properties:
num_cpus: 2
disk_size: "20 GB"
os:
properties:
type: linux
# 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: ComputeInstance
capability: tosca.capabilities.Node
relationship: tosca.relationships.DependsOn
# Find the best cloud location depending on the input dataset and needed cloud resources
FindCloudLocation:
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: ComputeInstance
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.dynamic.orchestration.relationships.CloudResource
# Component retrieving access details to the DDI REST APIs from the compute
# instance where it running
# Needed by component MountInputDataset below
GetDDIAccess:
type: org.lexis.common.ddi.nodes.DDIAccess
requirements:
- hostedOnComputeHost:
type_requirement: os
node: ComputeInstance
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
# Component managing the SSH-mount of the input dataset in cloud staging area
# on the compute instance
MountInputDataset:
type: org.lexis.common.ddi.nodes.SSHFSMountStagingAreaDataset
properties:
token: {get_input: token}
mount_point_directory: { get_input: preprocessing_mount_point_input_dataset }
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: DDIToCloudInputDatasetJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
- hostedOnComputeHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Create the output directory expected by the preprocessing container
CreatePreProcessDirs:
type: org.lexis.common.datatransfer.nodes.CreateDirectories
properties:
directories: {concat: ["[\"", get_input: preprocessing_output_directory, "\"]"]}
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Docker service
Docker:
type: org.ystia.docker.ansible.nodes.Docker
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Preprocessing docker container
PreprocessingContainer:
type: org.ystia.docker.containers.docker.generic.nodes.GenericContainer
metadata:
task: preprocessing
properties:
auto_remove: false
cleanup: false
detach: false
image: {get_input: preprocessing_container_image}
keep_volumes: true
restart_policy: no
cpu_share: 1.0
volumes: {get_input: preprocessing_container_volumes}
docker_env_vars: {get_input: preprocessing_container_env_vars}
published_ports: {get_input: preprocessing_container_published_ports}
requirements:
- hostedOnContainerRuntimeDockerHost:
type_requirement: host
node: Docker
capability: org.alien4cloud.extended.container.capabilities.ApplicationHost
relationship: org.alien4cloud.extended.container.relationships.HostedOnContainerRuntime
# Get pre-processing results details (size, number of files)
GetPreprocessDatasetInfo:
type: org.lexis.common.ddi.nodes.GetComputeInstanceDatasetInfo
properties:
dataset_path: { get_input: preprocessing_output_directory }
requirements:
- host:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Find the best HPC location depending on the input dataset and needed HPC resources
FindHPCLocationJob:
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
- HPCResourceHPCJob:
type_requirement: heappe_job
node: HPCJob
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.dynamic.orchestration.relationships.HeappeJob
# HPC computation job
HPCJob:
type: org.lexis.common.heappe.nodes.Job
metadata:
task: computation
properties:
token: { get_input: token }
listChangedFilesWhileRunning: false
JobSpecification: { get_input: computation_heappe_job }
# Create a directory in staging area for HPC job inputs
CreateStagingAreaHPCInputDir:
type: org.lexis.common.datatransfer.nodes.CreateStagingAreaDirectory
properties:
directory: "lexis_test_hpc_inputs"
requirements:
- mountedCloudStagingArea:
type_requirement: mounted_staging_area
node: MountInputDataset
capability: org.lexis.common.ddi.capabilities.MountedStagingAreaAccess
relationship: org.lexis.common.datatransfer.relationships.MountedCloudStagingArea
- hostedOnComputeHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Stage HPC inputs in cloud staging area
StageHPCInputs:
type: org.lexis.common.datatransfer.nodes.CopyToStagingAreaDirectory
properties:
source_directory: {get_input: preprocessing_output_directory}
requirements:
- staging_area_directory:
type_requirement: cloud_area_directory_provider
node: CreateStagingAreaHPCInputDir
capability: org.lexis.common.ddi.capabilities.CloudAreaDirectoryProvider
relationship: org.lexis.common.ddi.relationships.CloudAreaDirectoryProvider
- hostedOnComputeHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Transfer these inputs to the HPC job
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: CreateStagingAreaHPCInputDir
capability: org.lexis.common.ddi.capabilities.CloudAreaDirectoryProvider
relationship: org.lexis.common.ddi.relationships.CloudAreaDirectoryProvider
- job:
type_requirement: job
node: HPCJob
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.heappe.relationships.SendInputsToJob
# DDI job managing the transfer of a HPC job task results to DDI
HPCToDDIJob:
type: org.lexis.common.ddi.nodes.HPCToDDIJob
properties:
token: {get_input: token}
encrypt: {get_input: postprocessing_encrypt_dataset_result}
compress: {get_input: postprocessing_compress_dataset_result}
metadata: { get_input: computation_metadata_dataset_result }
ddi_path: { get_input: postprocessing_ddi_project_path }
task_name: { get_input: computation_heappe_command_template_name }
source_subdirectory: { get_input: computation_hpc_subdirectory_to_stage }
requirements:
- job:
type_requirement: job
node: HPCJob
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.ddi.relationships.SendJobOutputs
# Transfer HPC results to cloud staging area as well
HPCToCloudJob:
type: org.lexis.common.ddi.nodes.HPCToCloudJob
properties:
token: { get_input: token }
task_name: { get_input: computation_heappe_command_template_name }
cloud_staging_area_directory_path: "lexis_test_hpc_results"
timestamp_cloud_staging_area_directory: true
source_subdirectory: { get_input: computation_hpc_subdirectory_to_stage }
requirements:
- sameSite:
type_requirement: os
node: ComputeInstance
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
- job:
type_requirement: job
node: HPCJob
capability: org.lexis.common.heappe.capabilities.HeappeJob
relationship: org.lexis.common.ddi.relationships.SendJobOutputs
MountHPCResultsDataset:
type: org.lexis.common.ddi.nodes.SSHFSMountStagingAreaDataset
properties:
token: { get_input: token }
mount_point_directory: "/mnt/lexis_test_hpc_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: HPCToCloudJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
- hostedOnComputeHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Create directories expected by the postprocessing container
CreatePostProcessDirs:
type: org.lexis.common.datatransfer.nodes.CreateDirectories
properties:
directories: { get_input: postprocessing_container_volumes }
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Move HPC results to the directory expected by the post-processing
MoveHPCResults:
type: org.lexis.common.datatransfer.nodes.MoveFile
properties:
source_file: "/mnt/lexis_test_hpc_results/*/*"
destination: { get_input: postprocessing_input_directory }
as_user: "root"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Postprocessing docker container
PostprocessingContainer:
type: org.ystia.docker.containers.docker.generic.nodes.GenericContainer
metadata:
task: postprocessing
properties:
auto_remove: false
cleanup: false
detach: false
image: {get_input: postprocessing_container_image}
keep_volumes: true
restart_policy: no
cpu_share: 1.0
volumes: {get_input: postprocessing_container_volumes}
docker_env_vars: {get_input: postprocessing_container_env_vars}
published_ports: {get_input: postprocessing_container_published_ports}
requirements:
- hostedOnContainerRuntimeDockerHost:
type_requirement: host
node: Docker
capability: org.alien4cloud.extended.container.capabilities.ApplicationHost
relationship: org.alien4cloud.extended.container.relationships.HostedOnContainerRuntime
# Component creating a directory on cloud staging area where to store results
CreateStagingAreaResultDir:
type: org.lexis.common.datatransfer.nodes.CreateStagingAreaDirectory
properties:
directory: "lexis_test_postprocessing"
requirements:
- mountedCloudStagingArea:
type_requirement: mounted_staging_area
node: MountInputDataset
capability: org.lexis.common.ddi.capabilities.MountedStagingAreaAccess
relationship: org.lexis.common.datatransfer.relationships.MountedCloudStagingArea
- hostedOnComputeHost:
type_requirement: host
node: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Copy postprocessing results to the staging area
StagePostProcessingResults:
type: org.lexis.common.datatransfer.nodes.CopyToStagingAreaDirectory
properties:
source_directory: { get_input: postprocessing_output_directory }
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: ComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# DDI job transferring results from the cloud staging area to DDI
CloudToDDIJob:
type: org.lexis.common.ddi.nodes.CloudToDDIJob
properties:
metadata: { get_input: postprocessing_metadata_dataset_result }
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
# Replicate result dataset to other sites if requested
ReplicateDatasetJob:
type: org.lexis.common.ddi.nodes.ReplicateDatasetJob
properties:
token: { get_input: token }
replication_sites: {get_input: postprocessing_result_dataset_replication_sites}
requirements:
- dataset_provider:
type_requirement: dataset_provider
node: CloudToDDIJob
capability: org.lexis.common.ddi.capabilities.DataTransferDDI
relationship: tosca.relationships.DependsOn
# DDI job cleaning up the cloud staging area containing inputs
CleanupCloudStagingAreaInputsJob:
type: org.lexis.common.ddi.nodes.DeleteCloudDataJob
properties:
token: {get_input: token}
requirements:
- cloud_area_dataset_provider:
type_requirement: cloud_area_dataset_provider
node: DDIToCloudInputDatasetJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
# DDI job cleaning up the cloud staging area containing HPC results
CleanupCloudStagingAreaHPCJob:
type: org.lexis.common.ddi.nodes.DeleteCloudDataJob
properties:
token: {get_input: token}
requirements:
- cloud_area_dataset_provider:
type_requirement: cloud_area_dataset_provider
node: HPCToCloudJob
capability: org.lexis.common.ddi.capabilities.DataTransferCloud
relationship: org.lexis.common.ddi.relationships.CloudAreaDatasetProvider
#
# Component attribute values that will be exposed in the front-end
#
outputs:
computation_dataset_result_path:
description: DDI path to HPC results
value: { get_attribute: [ HPCToDDIJob, destination_path ] }
postprocessing_dataset_result_path:
description: DDI path to post-processing results
value: { get_attribute: [ CloudToDDIJob, destination_path ] }
#
# Sequences of operations on components
#
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
#
# Workflow executed by LEXIS Portal
#
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:
- FindCloudLocation_submit
# Submit the computation to find the best location from these inputs
FindCloudLocation_submit:
target: FindCloudLocation
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- FindCloudLocation_run
FindCloudLocation_run:
target: FindCloudLocation
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- FindCloudLocation_executed
FindCloudLocation_executed:
target: FindCloudLocation
activities:
- set_state: executed
on_success:
- DDIToCloudInputDatasetJob_create
- Network_install
# Transfer the input dataset to cloud staging area
DDIToCloudInputDatasetJob_create:
target: DDIToCloudInputDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- DDIToCloudInputDatasetJob_submit
DDIToCloudInputDatasetJob_submit:
target: DDIToCloudInputDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- DDIToCloudInputDatasetJob_submitted
DDIToCloudInputDatasetJob_submitted:
target: DDIToCloudInputDatasetJob
activities:
- set_state: submitted
on_success:
- DDIToCloudInputDatasetJob_run
DDIToCloudInputDatasetJob_run:
target: DDIToCloudInputDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- DDIToCloudInputDatasetJob_executed
DDIToCloudInputDatasetJob_executed:
target: DDIToCloudInputDatasetJob
activities:
- set_state: executed
on_success:
- MountInputDataset_create
# Get a floating IP address for the Cloud Compute instance
Network_install:
target: Network
activities:
- delegate: install
on_success:
- ComputeInstance_install
# Create the compute instance
ComputeInstance_install:
target: ComputeInstance
activities:
- delegate: install
on_success:
- GetDDIAccess_start
- CreatePreProcessDirs_start
# Get details on DDI needed to mount cloud staging area filesystems on
# the Compute instance
GetDDIAccess_start:
target: GetDDIAccess
activities:
- call_operation: Standard.start
on_success:
- GetDDIAccess_started
GetDDIAccess_started:
target: GetDDIAccess
activities:
- set_state: started
on_success:
- MountInputDataset_create
# Create directories needed by the pre-processing container
CreatePreProcessDirs_start:
target: CreatePreProcessDirs
activities:
- call_operation: Standard.start
on_success:
- CreatePreProcessDirs_started
CreatePreProcessDirs_started:
target: CreatePreProcessDirs
activities:
- set_state: started
on_success:
- MountInputDataset_create
# Mount the cloud staging are on the Cloud compute instance
MountInputDataset_create:
target: MountInputDataset
activities:
- call_operation: Standard.create
on_success:
- MountInputDataset_created
MountInputDataset_created:
target: MountInputDataset
activities:
- set_state: created
on_success:
- MountInputDataset_refresh_token
MountInputDataset_refresh_token:
target: MountInputDataset
activities:
- call_operation: custom.refresh_token
on_success:
- MountInputDataset_start
MountInputDataset_start:
target: MountInputDataset
activities:
- call_operation: Standard.start
on_success:
- MountInputDataset_started
MountInputDataset_started:
target: MountInputDataset
activities:
- set_state: started
on_success:
- Docker_create
# Install Docker
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:
- PreprocessingContainer_create
# Create and run the pre-processing container
PreprocessingContainer_create:
target: PreprocessingContainer
activities:
- call_operation: Standard.create
on_success:
- PreprocessingContainer_start
PreprocessingContainer_start:
target: PreprocessingContainer
activities:
- call_operation: Standard.start
on_success:
- PreprocessingContainer_started
PreprocessingContainer_started:
target: PreprocessingContainer
activities:
- set_state: started
on_success:
- GetPreprocessDatasetInfo_create
GetPreprocessDatasetInfo_create:
target: GetPreprocessDatasetInfo
activities:
- call_operation: Standard.create
on_success:
- GetPreprocessDatasetInfo_start
GetPreprocessDatasetInfo_start:
target: GetPreprocessDatasetInfo
activities:
- call_operation: Standard.start
on_success:
- GetPreprocessDatasetInfo_started
GetPreprocessDatasetInfo_started:
target: GetPreprocessDatasetInfo
activities:
- set_state: started
on_success:
- FindHPCLocationJob_submit
# Submit the computation to find the best location from these inputs
FindHPCLocationJob_submit:
target: FindHPCLocationJob
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- FindHPCLocationJob_run
FindHPCLocationJob_run:
target: FindHPCLocationJob
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- FindHPCLocationJob_executed
FindHPCLocationJob_executed:
target: FindHPCLocationJob
activities:
- set_state: executed
on_success:
- HPCJob_create
# Create the HPC job
HPCJob_create:
target: HPCJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- HPCJob_enable_file_transfer
# Enable file transfers on this job to provide input files
HPCJob_enable_file_transfer:
target: HPCJob
operation_host: ORCHESTRATOR
activities:
- call_operation: custom.enable_file_transfer
on_success:
- CreateStagingAreaHPCInputDir_start
# Create a directory in cloud staging area and copy HPC inputs there
CreateStagingAreaHPCInputDir_start:
target: CreateStagingAreaHPCInputDir
activities:
- call_operation: Standard.start
on_success:
- CreateStagingAreaHPCInputDir_started
CreateStagingAreaHPCInputDir_started:
target: CreateStagingAreaHPCInputDir
activities:
- set_state: started
on_success:
- StageHPCInputs_start
# Stage HPC inputs to cloud staging area
StageHPCInputs_start:
target: StageHPCInputs
activities:
- call_operation: Standard.start
on_success:
- StageHPCInputs_started
StageHPCInputs_started:
target: StageHPCInputs
activities:
- set_state: started
on_success:
- CloudToHPCTaskJob_create
# Transfer HPC inputs from Cloud staging area to HPC
CloudToHPCTaskJob_create:
target: CloudToHPCTaskJob
operation_host: ORCHESTRATOR
activities: