21316: Merge commit '1416f698b72de4b09350d9c2fb25c1405c3247bc' into 21316-left-panel...
[arvados.git] / sdk / cwl / tests / federation / arvboxcwl / fed-config.cwl
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 cwlVersion: v1.1
6 class: CommandLineTool
7 $namespaces:
8   arv: "http://arvados.org/cwl#"
9   cwltool: "http://commonwl.org/cwltool#"
10 inputs:
11   container_name: string
12   this_cluster_id: string
13   cluster_ids: string[]
14   cluster_hosts: string[]
15   arvbox_data: Directory
16   arvbox_bin: File
17   logincluster:
18     type: boolean
19     default: false
20 outputs:
21   arvbox_data_out:
22     type: Directory
23     outputBinding:
24       outputEval: $(inputs.arvbox_data)
25 requirements:
26   EnvVarRequirement:
27     envDef:
28       ARVBOX_CONTAINER: $(inputs.container_name)
29       ARVBOX_DATA: $(inputs.arvbox_data.path)
30   InitialWorkDirRequirement:
31     listing:
32       - entryname: cluster_config.yml.override
33         entry: >-
34           ${
35           var remoteClusters = {};
36           for (var i = 0; i < inputs.cluster_ids.length; i++) {
37             remoteClusters[inputs.cluster_ids[i]] = {
38               "Host": inputs.cluster_hosts[i],
39               "Proxy": true,
40               "Insecure": true
41             };
42           }
43           var r = {"Clusters": {}};
44           r["Clusters"][inputs.this_cluster_id] = {"RemoteClusters": remoteClusters};
45           if (r["Clusters"][inputs.this_cluster_id]) {
46             r["Clusters"][inputs.this_cluster_id]["Login"] = {"LoginCluster": inputs.cluster_ids[0]};
47             r["Clusters"][inputs.this_cluster_id]["Users"] = {"AutoAdminFirstUser": false};
48           }
49           return JSON.stringify(r);
50           }
51       - entryname: application.yml.override
52         entry: >-
53           ${
54           var remoteClusters = {};
55           for (var i = 0; i < inputs.cluster_ids.length; i++) {
56             remoteClusters[inputs.cluster_ids[i]] = inputs.cluster_hosts[i];
57           }
58           return JSON.stringify({"development": {"remote_hosts": remoteClusters}});
59           }
60   LoadListingRequirement:
61     loadListing: no_listing
62   ShellCommandRequirement: {}
63   InlineJavascriptRequirement: {}
64   InplaceUpdateRequirement:
65     inplaceUpdate: true
66 arguments:
67   - shellQuote: false
68     valueFrom: |
69       docker cp cluster_config.yml.override $(inputs.container_name):/var/lib/arvados-arvbox
70       docker cp application.yml.override $(inputs.container_name):/usr/src/arvados/services/api/config
71       $(inputs.arvbox_bin.path) sv restart api
72       $(inputs.arvbox_bin.path) sv restart controller
73       $(inputs.arvbox_bin.path) sv restart keepstore0
74       $(inputs.arvbox_bin.path) sv restart keepstore1