1
1
import arvados
2
+ import arvados .util
2
3
import arvados .collection
3
4
import os
4
5
import connexion
@@ -17,11 +18,11 @@ def get_api():
17
18
18
19
19
20
statemap = {
20
- "Queued" : "Queued " ,
21
- "Locked" : "Initializing " ,
22
- "Running" : "Running " ,
23
- "Complete" : "Complete " ,
24
- "Cancelled" : "Canceled "
21
+ "Queued" : "QUEUED " ,
22
+ "Locked" : "INITIALIZING " ,
23
+ "Running" : "RUNNING " ,
24
+ "Complete" : "COMPLETE " ,
25
+ "Cancelled" : "CANCELED "
25
26
}
26
27
27
28
@@ -31,8 +32,8 @@ def GetServiceInfo(self):
31
32
"workflow_type_versions" : {
32
33
"CWL" : ["v1.0" ]
33
34
},
34
- "supported_wes_versions" : "0.1.0 " ,
35
- "supported_filesystem_protocols" : ["file" ],
35
+ "supported_wes_versions" : "0.2.1 " ,
36
+ "supported_filesystem_protocols" : ["file" , "http" , "https" , "keep" ],
36
37
"engine_versions" : "cwl-runner" ,
37
38
"system_state_counts" : {},
38
39
"key_values" : {}
@@ -41,19 +42,21 @@ def GetServiceInfo(self):
41
42
def ListWorkflows (self ):
42
43
api = get_api ()
43
44
44
- requests = api .container_requests ().list (
45
- filters = [["requesting_container_uuid" , "=" , None ]],
46
- select = ["uuid" , "command" , "container_uuid" ]).execute ()
47
- containers = api .containers ().list (filters = [["uuid" , "in" , [w ["container_uuid" ] for w in requests ["items" ]]]], # NOQA
48
- select = ["uuid" , "state" ]).execute ()
45
+ requests = arvados .util .list_all (api .container_requests ().list ,
46
+ filters = [["requesting_container_uuid" , "=" , None ],
47
+ ["container_uuid" , "!=" , None ]],
48
+ select = ["uuid" , "command" , "container_uuid" ])
49
+ containers = arvados .util .list_all (api .containers ().list ,
50
+ filters = [["uuid" , "in" , [w ["container_uuid" ] for w in requests ]]],
51
+ select = ["uuid" , "state" ])
49
52
50
- uuidmap = {c ["uuid" ]: statemap [c ["state" ]] for c in containers [ "items" ]} # NOQA
53
+ uuidmap = {c ["uuid" ]: statemap [c ["state" ]] for c in containers }
51
54
52
55
return {
53
56
"workflows" : [{"workflow_id" : cr ["uuid" ],
54
- "state" : uuidmap [ cr ["container_uuid" ]] }
55
- for cr in requests [ "items" ]
56
- if cr ["command" ][0 ] == "arvados-cwl-runner" ],
57
+ "state" : uuidmap . get ( cr ["container_uuid" ]) }
58
+ for cr in requests
59
+ if cr ["command" ] and cr [ "command" ] [0 ] == "arvados-cwl-runner" ],
57
60
"next_page_token" : ""
58
61
}
59
62
@@ -114,7 +117,7 @@ def keepref(d):
114
117
"outputs" : outputobj
115
118
}
116
119
if container ["exit_code" ] is not None :
117
- r ["workflow_log" ]["exitCode " ] = container ["exit_code" ]
120
+ r ["workflow_log" ]["exit_code " ] = container ["exit_code" ]
118
121
return r
119
122
120
123
def CancelJob (self , workflow_id ): # NOQA
0 commit comments