14198: Federation feature and testing
[arvados.git] / sdk / cwl / tests / federation / main.cwl
1 #!/usr/bin/env cwl-runner
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: Apache-2.0
5
6 cwlVersion: v1.0
7 class: Workflow
8 $namespaces:
9   arv: "http://arvados.org/cwl#"
10   cwltool: "http://commonwl.org/cwltool#"
11 hints:
12   cwltool:Secrets:
13     secrets: [arvados_api_token]
14 requirements:
15   StepInputExpressionRequirement: {}
16   InlineJavascriptRequirement: {}
17   SubworkflowFeatureRequirement: {}
18 inputs:
19   arvados_api_token: string
20   arvado_api_host_insecure:
21     type: boolean
22     default: false
23   arvados_api_hosts: string[]
24   arvados_cluster_ids: string[]
25   acr: string?
26   testcases:
27     type: string[]
28     default:
29       - base-case
30       - runner-home-step-remote
31       - runner-remote-step-home
32 outputs:
33   base-case-success:
34     type: Any
35     outputSource: base-case/success
36   runner-home-step-remote-success:
37     type: Any
38     outputSource: runner-home-step-remote/success
39   runner-remote-step-home-success:
40     type: Any
41     outputSource: runner-remote-step-home/success
42
43 steps:
44   base-case:
45     in:
46       arvados_api_token: arvados_api_token
47       arvado_api_host_insecure: arvado_api_host_insecure
48       arvados_api_hosts: arvados_api_hosts
49       arvados_cluster_ids: arvados_cluster_ids
50       acr: acr
51       wf:
52         default:
53           class: File
54           location: cases/base-case.cwl
55           secondaryFiles:
56             - class: File
57               location: cases/md5sum.cwl
58       obj:
59         default:
60           inp:
61             class: File
62             location: data/base-case-input.txt
63         valueFrom: |-
64           ${
65           self["runOnCluster"] = inputs.arvados_cluster_ids[0];
66           return self;
67           }
68       scrub_image: {default: "arvados/fed-test:base-case"}
69       scrub_collections:
70         default:
71           - 031a4ced0aa99de90fb630568afc6e9b+67   # input collection
72           - eb93a6718eb1a1a8ee9f66ee7d683472+51   # md5sum output collection
73           - f654d4048612135f4a5e7707ec0fcf3e+112  # final output json
74     out: [out, success]
75     run: framework/testcase.cwl
76
77   runner-home-step-remote:
78     in:
79       arvados_api_token: arvados_api_token
80       arvado_api_host_insecure: arvado_api_host_insecure
81       arvados_api_hosts: arvados_api_hosts
82       arvados_cluster_ids: arvados_cluster_ids
83       acr: acr
84       wf:
85         default:
86           class: File
87           location: cases/runner-home-step-remote.cwl
88           secondaryFiles:
89             - class: File
90               location: cases/md5sum.cwl
91       obj:
92         default:
93           inp:
94             class: File
95             location: data/runner-home-step-remote-input.txt
96         valueFrom: |-
97           ${
98           self["runOnCluster"] = inputs.arvados_cluster_ids[1];
99           return self;
100           }
101       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[0])" }
102       scrub_image: {default: "arvados/fed-test:runner-home-step-remote"}
103       scrub_collections:
104         default:
105           - 3bc373e38751fe13dcbd62778d583242+81   # input collection
106           - 428e6d91e41a3af3ae287b453949e7fd+51   # md5sum output collection
107           - a4b0ddd866525655e8480f83a1ca83c6+112  # runner output json
108     out: [out, success]
109     run: framework/testcase.cwl
110
111   runner-remote-step-home:
112     in:
113       arvados_api_token: arvados_api_token
114       arvado_api_host_insecure: arvado_api_host_insecure
115       arvados_api_hosts: arvados_api_hosts
116       arvados_cluster_ids: arvados_cluster_ids
117       acr: acr
118       wf:
119         default:
120           class: File
121           location: cases/runner-remote-step-home.cwl
122           secondaryFiles:
123             - class: File
124               location: cases/md5sum.cwl
125       obj:
126         default:
127           inp:
128             class: File
129             location: data/runner-remote-step-home-input.txt
130         valueFrom: |-
131           ${
132           self["runOnCluster"] = inputs.arvados_cluster_ids[0];
133           return self;
134           }
135       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[1])" }
136       scrub_image: {default: "arvados/fed-test:runner-remote-step-home"}
137       scrub_collections:
138         default:
139           - 25fe10d8e8530329a738de69d9bc8ab5+81   # input collection
140           - 7f052d1a04b851b6f73fba77c7802e1d+51   # md5sum output collection
141           - ecb639201f454b6493757f5117f540df+112  # runner output json
142     out: [out, success]
143     run: framework/testcase.cwl