Skip to content

Commit adbe2ef

Browse files
committed
Percolating schema changes to other backends, and fixing the client to
accept the new changes.
1 parent e012bf8 commit adbe2ef

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

wes_client/wes_client_main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def fixpaths(d):
128128
]
129129
if workflow_url.startswith("file://"):
130130
# with open(workflow_url[7:], "rb") as f:
131-
# body["workflow_descriptor"] = f.read()
131+
# body["workflow_attachment"] = f.read()
132132
rootdir = os.path.dirname(workflow_url[7:])
133133
dirpath = rootdir
134134
# for dirpath, dirnames, filenames in os.walk(rootdir):
@@ -137,7 +137,7 @@ def fixpaths(d):
137137
continue
138138
fn = os.path.join(dirpath, f)
139139
if os.path.isfile(fn):
140-
parts.append(('workflow_descriptor', (fn[len(rootdir)+1:], open(fn, "rb"))))
140+
parts.append(('workflow_attachment', (fn[len(rootdir)+1:], open(fn, "rb"))))
141141
parts.append(("workflow_url", os.path.basename(workflow_url[7:])))
142142
else:
143143
parts.append(("workflow_url", workflow_url))

wes_service/arvados_wes.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def ListRuns(self, page_size=None, page_token=None, state_search=None):
109109
}
110110

111111
def invoke_cwl_runner(self, cr_uuid, workflow_url, workflow_params,
112-
env, workflow_descriptor_file, project_uuid,
112+
env, workflow_attachment_file, project_uuid,
113113
tempdir):
114114
api = arvados.api_from_config(version="v1", apiconfig={
115115
"ARVADOS_API_HOST": env["ARVADOS_API_HOST"],
@@ -151,8 +151,8 @@ def invoke_cwl_runner(self, cr_uuid, workflow_url, workflow_params,
151151
api.container_requests().update(uuid=cr_uuid, body={"priority": 0,
152152
"properties": {"arvados-cwl-runner-log": str(e)}}).execute()
153153
finally:
154-
if workflow_descriptor_file is not None:
155-
workflow_descriptor_file.close()
154+
if workflow_attachment_file is not None:
155+
workflow_attachment_file.close()
156156

157157
@catch_exceptions
158158
def RunWorkflow(self, **args):
@@ -184,20 +184,20 @@ def RunWorkflow(self, **args):
184184
"priority": 500}}).execute()
185185

186186
workflow_url = body.get("workflow_url")
187-
workflow_descriptor_file = None
188-
if body.get("workflow_descriptor"):
189-
workflow_descriptor_file = tempfile.NamedTemporaryFile()
190-
workflow_descriptor_file.write(body.get('workflow_descriptor'))
191-
workflow_descriptor_file.flush()
192-
workflow_url = workflow_descriptor_file.name
187+
workflow_attachment_file = None
188+
if body.get("workflow_attachment"):
189+
workflow_attachment_file = tempfile.NamedTemporaryFile()
190+
workflow_attachment_file.write(body.get('workflow_attachment'))
191+
workflow_attachment_file.flush()
192+
workflow_url = workflow_attachment_file.name
193193

194194
project_uuid = body.get("workflow_engine_parameters", {}).get("project_uuid")
195195

196196
threading.Thread(target=self.invoke_cwl_runner, args=(cr["uuid"],
197197
workflow_url,
198198
body["workflow_params"],
199199
env,
200-
workflow_descriptor_file,
200+
workflow_attachment_file,
201201
project_uuid,
202202
tempdir)).start()
203203

wes_service/cwl_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def run(self, request, opts):
2424
CWL (url):
2525
request["workflow_url"] == a url to a cwl file
2626
or
27-
request["workflow_descriptor"] == input cwl text (written to a file and a url constructed for that file)
27+
request["workflow_attachment"] == input cwl text (written to a file and a url constructed for that file)
2828
2929
JSON File:
3030
request["workflow_params"] == input json text (to be written to a file)

wes_service/toil_wes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def write_workflow(self, request, opts, wftype='cwl'):
3838
"""Writes a cwl, wdl, or python file as appropriate from the request dictionary."""
3939
self.input_wf_filename = os.path.join(self.workdir, 'workflow.' + wftype)
4040

41-
if request.get("workflow_descriptor"):
42-
workflow_descriptor = request.get('workflow_descriptor')
41+
if request.get("workflow_attachment"):
42+
workflow_attachment = request.get('workflow_attachment')
4343
with open(self.input_wf_filename, "w") as f:
44-
f.write(workflow_descriptor)
44+
f.write(workflow_attachment)
4545
workflow_url = urllib.pathname2url(self.input_wf_filename)
4646
else:
4747
workflow_url = request.get("workflow_url")
@@ -147,7 +147,7 @@ def run(self, request, opts):
147147
CWL (url):
148148
request["workflow_url"] == a url to a cwl file
149149
or
150-
request["workflow_descriptor"] == input cwl text (written to a file and a url constructed for that file)
150+
request["workflow_attachment"] == input cwl text (written to a file and a url constructed for that file)
151151
152152
JSON File:
153153
request["workflow_params"] == input json text (to be written to a file)

0 commit comments

Comments
 (0)