14198: Add more twostep tests
[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   twostep-home-to-remote-success:
43     type: Any
44     outputSource: twostep-home-to-remote/success
45   twostep-remote-to-home-success:
46     type: Any
47     outputSource: twostep-remote-to-home/success
48   twostep-both-remote:
49     type: Any
50     outputSource: twostep-both-remote/success
51
52 steps:
53   base-case:
54     in:
55       arvados_api_token: arvados_api_token
56       arvado_api_host_insecure: arvado_api_host_insecure
57       arvados_api_hosts: arvados_api_hosts
58       arvados_cluster_ids: arvados_cluster_ids
59       acr: acr
60       wf:
61         default:
62           class: File
63           location: cases/base-case.cwl
64           secondaryFiles:
65             - class: File
66               location: cases/md5sum.cwl
67       obj:
68         default:
69           inp:
70             class: File
71             location: data/base-case-input.txt
72         valueFrom: |-
73           ${
74           self["runOnCluster"] = inputs.arvados_cluster_ids[0];
75           return self;
76           }
77       scrub_image: {default: "arvados/fed-test:base-case"}
78       scrub_collections:
79         default:
80           - 031a4ced0aa99de90fb630568afc6e9b+67   # input collection
81           - eb93a6718eb1a1a8ee9f66ee7d683472+51   # md5sum output collection
82           - f654d4048612135f4a5e7707ec0fcf3e+112  # final output json
83     out: [out, success]
84     run: framework/testcase.cwl
85
86   runner-home-step-remote:
87     in:
88       arvados_api_token: arvados_api_token
89       arvado_api_host_insecure: arvado_api_host_insecure
90       arvados_api_hosts: arvados_api_hosts
91       arvados_cluster_ids: arvados_cluster_ids
92       acr: acr
93       wf:
94         default:
95           class: File
96           location: cases/runner-home-step-remote.cwl
97           secondaryFiles:
98             - class: File
99               location: cases/md5sum.cwl
100       obj:
101         default:
102           inp:
103             class: File
104             location: data/runner-home-step-remote-input.txt
105         valueFrom: |-
106           ${
107           self["runOnCluster"] = inputs.arvados_cluster_ids[1];
108           return self;
109           }
110       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[0])" }
111       scrub_image: {default: "arvados/fed-test:runner-home-step-remote"}
112       scrub_collections:
113         default:
114           - 3bc373e38751fe13dcbd62778d583242+81   # input collection
115           - 428e6d91e41a3af3ae287b453949e7fd+51   # md5sum output collection
116           - a4b0ddd866525655e8480f83a1ca83c6+112  # runner output json
117     out: [out, success]
118     run: framework/testcase.cwl
119
120   runner-remote-step-home:
121     in:
122       arvados_api_token: arvados_api_token
123       arvado_api_host_insecure: arvado_api_host_insecure
124       arvados_api_hosts: arvados_api_hosts
125       arvados_cluster_ids: arvados_cluster_ids
126       acr: acr
127       wf:
128         default:
129           class: File
130           location: cases/runner-remote-step-home.cwl
131           secondaryFiles:
132             - class: File
133               location: cases/md5sum.cwl
134       obj:
135         default:
136           inp:
137             class: File
138             location: data/runner-remote-step-home-input.txt
139         valueFrom: |-
140           ${
141           self["runOnCluster"] = inputs.arvados_cluster_ids[0];
142           return self;
143           }
144       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[1])" }
145       scrub_image: {default: "arvados/fed-test:runner-remote-step-home"}
146       scrub_collections:
147         default:
148           - 25fe10d8e8530329a738de69d9bc8ab5+81   # input collection
149           - 7f052d1a04b851b6f73fba77c7802e1d+51   # md5sum output collection
150           - ecb639201f454b6493757f5117f540df+112  # runner output json
151     out: [out, success]
152     run: framework/testcase.cwl
153
154   twostep-home-to-remote:
155     in:
156       arvados_api_token: arvados_api_token
157       arvado_api_host_insecure: arvado_api_host_insecure
158       arvados_api_hosts: arvados_api_hosts
159       arvados_cluster_ids: arvados_cluster_ids
160       acr: acr
161       wf:
162         default:
163           class: File
164           location: cases/twostep-home-to-remote.cwl
165           secondaryFiles:
166             - class: File
167               location: cases/md5sum.cwl
168             - class: File
169               location: cases/rev.cwl
170       obj:
171         default:
172           inp:
173             class: File
174             location: data/twostep-home-to-remote.txt
175         valueFrom: |-
176           ${
177           self["md5sumCluster"] = inputs.arvados_cluster_ids[0];
178           self["revCluster"] = inputs.arvados_cluster_ids[1];
179           return self;
180           }
181       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[0])" }
182       scrub_image: {default: "arvados/fed-test:twostep-home-to-remote"}
183       scrub_collections:
184         default:
185           - 268a54947fb75115cfe05bb54cc62c30+74   # input collection
186           - 400f03b8c5d2dc3dcb513a21b626ef88+51   # md5sum output collection
187           - 3738166916ca5f6f6ad12bf7e06b4a21+51   # rev output collection
188           - bc37c17a37aa25229e5de1339b27fbcc+112  # runner output json
189     out: [out, success]
190     run: framework/testcase.cwl
191
192   twostep-remote-to-home:
193     in:
194       arvados_api_token: arvados_api_token
195       arvado_api_host_insecure: arvado_api_host_insecure
196       arvados_api_hosts: arvados_api_hosts
197       arvados_cluster_ids: arvados_cluster_ids
198       acr: acr
199       wf:
200         default:
201           class: File
202           location: cases/twostep-remote-to-home.cwl
203           secondaryFiles:
204             - class: File
205               location: cases/md5sum.cwl
206             - class: File
207               location: cases/rev.cwl
208       obj:
209         default:
210           inp:
211             class: File
212             location: data/twostep-remote-to-home.txt
213         valueFrom: |-
214           ${
215           self["md5sumCluster"] = inputs.arvados_cluster_ids[1];
216           self["revCluster"] = inputs.arvados_cluster_ids[0];
217           return self;
218           }
219       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[0])" }
220       scrub_image: {default: "arvados/fed-test:twostep-remote-to-home"}
221       scrub_collections:
222         default:
223           - cce89b9f7b6e163978144051ce5f071a+74   # input collection
224           - 0c358c3af63644c6343766feff1b7238+51   # md5sum output collection
225           - 33fb7d512bf21f04847eca58cea46e74+51   # rev output collection
226           - 912e04aa3db04aba008cf5cd46c277b2+112  # runner output json
227     out: [out, success]
228     run: framework/testcase.cwl
229
230   twostep-both-remote:
231     in:
232       arvados_api_token: arvados_api_token
233       arvado_api_host_insecure: arvado_api_host_insecure
234       arvados_api_hosts: arvados_api_hosts
235       arvados_cluster_ids: arvados_cluster_ids
236       acr: acr
237       wf:
238         default:
239           class: File
240           location: cases/twostep-both-remote.cwl
241           secondaryFiles:
242             - class: File
243               location: cases/md5sum.cwl
244             - class: File
245               location: cases/rev.cwl
246       obj:
247         default:
248           inp:
249             class: File
250             location: data/twostep-both-remote.txt
251         valueFrom: |-
252           ${
253           self["md5sumCluster"] = inputs.arvados_cluster_ids[1];
254           self["revCluster"] = inputs.arvados_cluster_ids[1];
255           return self;
256           }
257       runner_cluster: { valueFrom: "$(inputs.arvados_cluster_ids[0])" }
258       scrub_image: {default: "arvados/fed-test:twostep-both-remote"}
259       scrub_collections:
260         default:
261           - 3c5e39939cf197d304ac1eac20841238+71   # input collection
262           - 3edb99aa607731593969cdab663d65b4+51   # md5sum output collection
263           - a91625b7139e60fe61a88cae42fbee13+51   # rev output collection
264           - ddfa58a81953dad08436d571615dd584+112  # runner output json
265     out: [out, success]
266     run: framework/testcase.cwl
267
268   # also: twostep-all-remote