-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication_template.yaml
911 lines (891 loc) · 32.7 KB
/
application_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
tosca_definitions_version: alien_dsl_3_0_0
metadata:
template_name: org.lexis.common.CloudComputationTemplate
template_version: 0.1.0-SNAPSHOT
template_author: lexis
description: "LEXIS Cloud Computation"
#
# 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.lexis.common.ddi-types:1.0.4
- org.lexis.common.dynamic-orchestration-types:1.0.4
- org.lexis.common.datatransfer:0.1.8-SNAPSHOT
- org.lexis.common.examples.exec:0.1.0
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 expression <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
computation_dataset_path_input_path:
type: string
description: Dataset containing input data
required: true
computation_script_content:
type: string
description: Content of the script to execute
required: true
computation_output_directory:
type: string
description: Path of the directory of results on the Compute Instance to store to DDI
required: true
computation_ddi_project_path:
type: string
description: "Path where to transfer the computation results in DDI"
required: true
computation_environment_variables:
type: map
description: Environment variables for the script
entry_schema:
type: string
default: {}
required: false
computation_input_directory:
type: string
description: Local directory on the compute instance where the input dataset is accessible to non-root user
default: "/lexis_input"
required: false
computation_compute_instance_image_name:
type: string
description: Name of the Openstack image for the Compute Instance to create
default: "Ubuntu-18.04"
required: false
computation_compute_instance_user:
type: string
description: User used to connect to the compute instance
default: "ubuntu"
required: false
computation_mount_point_input_dataset:
type: string
description: Directory on the compute instance where to mount the dataset (accessible to root only)
default: "/mnt/lexis_input"
required: false
computation_decrypt_dataset_input:
type: boolean
description: Should the input dataset be decrypted
default: false
required: false
computation_uncompress_dataset_input:
type: boolean
description: Should the input dataset be uncompressed
default: false
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:
- "Cloud Computation worflow"
contributor:
- "Cloud Computation worflow"
publisher:
- "Cloud Computation worflow"
resourceType: "Dataset"
title: "Cloud Computation workflow results"
required: false
computation_encrypt_dataset_result:
type: boolean
description: Encrypt the result dataset
default: false
required: false
computation_compress_dataset_result:
type: boolean
description: Compress the result dataset
default: false
required: false
computation_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: computation_dataset_path_input_path}
# 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: CloudComputeInstance
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.dynamic.orchestration.relationships.CloudResource
# 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: computation_decrypt_dataset_input}
uncompress: {get_input: computation_uncompress_dataset_input}
ddi_dataset_path: { get_input: computation_dataset_path_input_path }
cloud_staging_area_directory_path: "lexis_cloud_computation"
timestamp_cloud_staging_area_directory: true
requirements:
- sameSite:
type_requirement: os
node: CloudComputeInstance
capability: tosca.capabilities.OperatingSystem
relationship: org.lexis.common.ddi.relationships.SameSite
# Floating IP address network
Network:
type: yorc.nodes.openstack.FloatingIP
# Cloud Compute Instance
CloudComputeInstance:
type: yorc.nodes.openstack.Compute
properties:
imageName: {get_input: computation_compute_instance_image_name}
boot_volume:
source: image
requirements:
- networkPublicNetConnection:
type_requirement: network
node: Network
capability: yorc.capabilities.openstack.FIPConnectivity
relationship: tosca.relationships.Network
capabilities:
host:
properties:
num_cpus: 4
disk_size: "40 GB"
os:
properties:
type: linux
distribution: custom
endpoint:
properties:
credentials:
user: {get_input: computation_compute_instance_user}
token_type: key
keys:
0: "/var/yorc/.ssh/yorc.pem"
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: CloudComputeInstance
capability: tosca.capabilities.Node
relationship: tosca.relationships.DependsOn
# TOSCA component executing the script provided in input
ExecScript:
type: org.lexis.common.examples.exec.Script
metadata:
task: computation
properties:
script_content: { get_input: computation_script_content }
environment_variables: { get_input: computation_environment_variables }
requirements:
- hostedOnComputeHost:
type_requirement: host
node: CloudComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# 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: CloudComputeInstance
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: computation_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: CloudComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Create directories expected by the computation
CreateComputationDirs:
type: org.lexis.common.datatransfer.nodes.CreateDirectories
properties:
directories: {concat: ["[\"", get_input: computation_mount_point_input_dataset, "\",", "\"", get_input: computation_output_directory, "\",", "\"", get_input: computation_input_directory,"\"]"]}
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: CloudComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Move inputs from the SSHFS mount point accessible to root, to local file system accessible to non-root
MoveInputData:
type: org.lexis.common.datatransfer.nodes.MoveFile
properties:
source_file: { concat: [get_input: computation_mount_point_input_dataset, "/*" ] }
destination: { get_input: computation_input_directory }
as_user: "root"
requirements:
- hostedOnVirtualMachineHost:
type_requirement: host
node: CloudComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Component creating a directory on cloud staging area where to store results
CreateStagingAreaResultDir:
type: org.lexis.common.datatransfer.nodes.CreateStagingAreaDirectory
properties:
directory: "lexis_cloud_computation_results"
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: CloudComputeInstance
capability: tosca.capabilities.Container
relationship: tosca.relationships.HostedOn
# Copy computation results to the staging area
StageComputationResults:
type: org.lexis.common.datatransfer.nodes.CopyToStagingAreaDirectory
properties:
source_directory: { get_input: computation_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: CloudComputeInstance
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: computation_metadata_dataset_result }
token: {get_input: token}
encrypt: {get_input: computation_encrypt_dataset_result}
compress: {get_input: computation_compress_dataset_result}
ddi_path: { get_input: computation_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
metadata:
task: computation
properties:
token: { get_input: token }
replication_sites: {get_input: computation_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
CleanupCloudStagingAreaJob:
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
#
# Component attribute values that will be exposed in the front-end
#
outputs:
computation_dataset_result_path:
description: DDI path to computation results
value: { get_attribute: [ CloudToDDIJob, destination_path ] }
computation_script_output:
description: Script stdout
value: { get_attribute: [ ExecScript, stdout ] }
computation_script_error:
description: Script stderr
value: { get_attribute: [ ExecScript, stderr ] }
#
# 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:
- CloudComputeInstance_install
# Create the compute instance
CloudComputeInstance_install:
target: CloudComputeInstance
activities:
- delegate: install
on_success:
- GetDDIAccess_start
- CreateComputationDirs_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 computation
CreateComputationDirs_start:
target: CreateComputationDirs
activities:
- call_operation: Standard.start
on_success:
- CreateComputationDirs_started
CreateComputationDirs_started:
target: CreateComputationDirs
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:
- MoveInputData_start
MoveInputData_start:
target: MoveInputData
activities:
- call_operation: Standard.start
on_success:
- MoveInputData_started
MoveInputData_started:
target: MoveInputData
activities:
- set_state: started
on_success:
- ExecScript_create
ExecScript_create:
target: ExecScript
activities:
- call_operation: Standard.create
on_success:
- ExecScript_created
ExecScript_created:
target: ExecScript
activities:
- set_state: created
on_success:
- ExecScript_start
ExecScript_start:
target: ExecScript
activities:
- call_operation: Standard.start
on_success:
- ExecScript_started
ExecScript_started:
target: ExecScript
activities:
- set_state: started
on_success:
- CreateStagingAreaResultDir_start
# Create a directory in cloud staging area and copy computation
# results there
CreateStagingAreaResultDir_start:
target: CreateStagingAreaResultDir
activities:
- call_operation: Standard.start
on_success:
- CreateStagingAreaResultDir_started
CreateStagingAreaResultDir_started:
target: CreateStagingAreaResultDir
activities:
- set_state: started
on_success:
- StageComputationResults_start
StageComputationResults_start:
target: StageComputationResults
activities:
- call_operation: Standard.start
on_success:
- StageComputationResults_started
StageComputationResults_started:
target: StageComputationResults
activities:
- set_state: started
on_success:
- CloudToDDIJob_create
# Transfer computation results from Cloud staging area to DDI
CloudToDDIJob_create:
target: CloudToDDIJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- CloudToDDIJob_submit
CloudToDDIJob_submit:
target: CloudToDDIJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- CloudToDDIJob_submitted
CloudToDDIJob_submitted:
target: CloudToDDIJob
activities:
- set_state: submitted
on_success:
- CloudToDDIJob_run
CloudToDDIJob_run:
target: CloudToDDIJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- CloudToDDIJob_executed
CloudToDDIJob_executed:
target: CloudToDDIJob
activities:
- set_state: executed
on_success:
- ReplicateDatasetJob_create
# Replicate dataset to other sites
ReplicateDatasetJob_create:
target: ReplicateDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- ReplicateDatasetJob_submit
ReplicateDatasetJob_submit:
target: ReplicateDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- ReplicateDatasetJob_run
ReplicateDatasetJob_run:
target: ReplicateDatasetJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- ReplicateDatasetJob_executed
ReplicateDatasetJob_executed:
target: ReplicateDatasetJob
activities:
- set_state: executed
on_success:
- MountInputDataset_refresh_token_before_stop
MountInputDataset_refresh_token_before_stop:
target: MountInputDataset
activities:
- call_operation: custom.refresh_token
on_success:
- MountInputDataset_stop
# Cleanup of ssh access to cloud staging area
MountInputDataset_stop:
target: MountInputDataset
activities:
- call_operation: Standard.stop
on_success:
- MountInputDataset_stopped
MountInputDataset_stopped:
target: MountInputDataset
activities:
- set_state: stopped
on_success:
- CleanupCloudStagingAreaJob_create
# Cleanup of cloud staging area files created by this workflow
CleanupCloudStagingAreaJob_create:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- CleanupCloudStagingAreaJob_created
CleanupCloudStagingAreaJob_created:
target: CleanupCloudStagingAreaJob
activities:
- set_state: created
on_success:
- CleanupCloudStagingAreaJob_submit
CleanupCloudStagingAreaJob_submit:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- CleanupCloudStagingAreaJob_submitted
CleanupCloudStagingAreaJob_submitted:
target: CleanupCloudStagingAreaJob
activities:
- set_state: submitted
on_success:
- CleanupCloudStagingAreaJob_run
CleanupCloudStagingAreaJob_run:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- CleanupCloudStagingAreaJob_executed
CleanupCloudStagingAreaJob_executed:
target: CleanupCloudStagingAreaJob
activities:
- set_state: executed
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:
- CloudComputeInstance_uninstall
# Delete Cloud Compute Instance
CloudComputeInstance_uninstall:
target: CloudComputeInstance
activities:
- delegate: uninstall
on_success:
- Network_uninstall
# Release Cloud floating IP address
Network_uninstall:
target: Network
activities:
- delegate: uninstall
#
# Worflow executed at undeployment time
# Deleting infrastructure resources if not yet dene
# (if the Run workflow failed before the cleanup phase)
#
uninstall:
steps:
CleanupCloudStagingAreaJob_create:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- CleanupCloudStagingAreaJob_submit
CleanupCloudStagingAreaJob_submit:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
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:
- CloudComputeInstance_uninstall
CloudComputeInstance_uninstall:
target: CloudComputeInstance
activities:
- delegate: uninstall
on_success:
- Network_uninstall
Network_uninstall:
target: Network
activities:
- delegate: uninstall
#
# Test workflow to only execute a SSH-unmount
#
cleanupMountPoint:
steps:
MountInputDataset_refresh_token:
target: MountInputDataset
activities:
- call_operation: custom.refresh_token
on_success:
- MountInputDataset_stop
MountInputDataset_stop:
target: MountInputDataset
activities:
- call_operation: Standard.stop
on_success:
- MountInputDataset_stopped
MountInputDataset_stopped:
target: MountInputDataset
activities:
- set_state: stopped
#
# Test workflow to only execute the cloud staging area cleanup
#
cleanupStagingArea:
steps:
CleanupCloudStagingAreaJob_create:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: Standard.create
on_success:
- CleanupCloudStagingAreaJob_created
CleanupCloudStagingAreaJob_created:
target: CleanupCloudStagingAreaJob
activities:
- set_state: created
on_success:
- CleanupCloudStagingAreaJob_submit
CleanupCloudStagingAreaJob_submit:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.submit
on_success:
- CleanupCloudStagingAreaJob_submitted
CleanupCloudStagingAreaJob_submitted:
target: CleanupCloudStagingAreaJob
activities:
- set_state: submitted
on_success:
- CleanupCloudStagingAreaJob_run
CleanupCloudStagingAreaJob_run:
target: CleanupCloudStagingAreaJob
operation_host: ORCHESTRATOR
activities:
- call_operation: tosca.interfaces.node.lifecycle.Runnable.run
on_success:
- CleanupCloudStagingAreaJob_executed
CleanupCloudStagingAreaJob_executed:
target: CleanupCloudStagingAreaJob
activities:
- set_state: executed
#
# Test workflow to unmount the SSHFS filesystem
#
unmountSSHFS:
steps:
MountInputDataset_refresh_token_before_stop:
target: MountInputDataset
activities:
- call_operation: custom.refresh_token
on_success:
- MountInputDataset_stop
# Cleanup of ssh access to cloud staging area
MountInputDataset_stop:
target: MountInputDataset
activities:
- call_operation: Standard.stop
on_success:
- MountInputDataset_stopped
MountInputDataset_stopped:
target: MountInputDataset
activities:
- set_state: stopped