[ARVADOS] created: 1825696494802d264c74ed2af58cc39b6ff8c7f8
Git user
git at public.curoverse.com
Thu Oct 13 21:24:23 EDT 2016
at 1825696494802d264c74ed2af58cc39b6ff8c7f8 (commit)
commit 1825696494802d264c74ed2af58cc39b6ff8c7f8
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Oct 13 21:13:58 2016 -0400
10259: Add one level of indirection on dict parameters so that
arv-run-pipeline-instance does not try to interpret the value. Check pipeline
state so that polling loop for cwl-runner job does not get stuck.
diff --git a/sdk/cwl/arvados_cwl/arvjob.py b/sdk/cwl/arvados_cwl/arvjob.py
index 5250410..8269eee 100644
--- a/sdk/cwl/arvados_cwl/arvjob.py
+++ b/sdk/cwl/arvados_cwl/arvjob.py
@@ -256,6 +256,10 @@ class RunnerJob(Runner):
def run(self, *args, **kwargs):
job_spec = self.arvados_job_spec(*args, **kwargs)
+ for k,v in job_spec["script_parameters"].items():
+ if isinstance(v, dict):
+ job_spec["script_parameters"][k] = {"value": v}
+
self.arvrunner.pipeline = self.arvrunner.api.pipeline_instances().create(
body={
"owner_uuid": self.arvrunner.project_uuid,
@@ -275,6 +279,8 @@ class RunnerJob(Runner):
uuid=self.arvrunner.pipeline["uuid"]).execute(
num_retries=self.arvrunner.num_retries)
job = self.arvrunner.pipeline["components"]["cwl-runner"].get("job")
+ if not job and self.arvrunner.pipeline["state"] != "RunningOnServer":
+ raise WorkflowException("Submitted pipeline is %s" % (self.arvrunner.pipeline["state"]))
self.uuid = job["uuid"]
self.arvrunner.processes[self.uuid] = self
diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py
index f65a82b..d3bdf8f 100644
--- a/sdk/cwl/tests/test_submit.py
+++ b/sdk/cwl/tests/test_submit.py
@@ -126,12 +126,12 @@ def stubs(func):
"cwl-runner": {
'runtime_constraints': {'docker_image': 'arvados/jobs'},
'script_parameters': {
- 'y': {'basename': '99999999999999999999999999999998+99', 'location': 'keep:99999999999999999999999999999998+99', 'class': 'Directory'},
- 'x': {'basename': 'blorp.txt', 'class': 'File', 'location': 'keep:99999999999999999999999999999994+99/blorp.txt'},
- 'z': {'basename': 'anonymous', 'class': 'Directory',
+ 'y': {"value": {'basename': '99999999999999999999999999999998+99', 'location': 'keep:99999999999999999999999999999998+99', 'class': 'Directory'}},
+ 'x': {"value": {'basename': 'blorp.txt', 'class': 'File', 'location': 'keep:99999999999999999999999999999994+99/blorp.txt'}},
+ 'z': {"value": {'basename': 'anonymous', 'class': 'Directory',
'listing': [
{'basename': 'renamed.txt', 'class': 'File', 'location': 'keep:99999999999999999999999999999998+99/file1.txt'}
- ]},
+ ]}},
'cwl:tool': '99999999999999999999999999999991+99/wf/submit_wf.cwl'
},
'repository': 'arvados',
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list