[ARVADOS] updated: cb781d9b5e61c5494d29d53a0a12c678c839eecd
Git user
git at public.curoverse.com
Thu Oct 13 10:36:36 EDT 2016
Summary of changes:
sdk/cwl/arvados_cwl/__init__.py | 2 +-
sdk/cwl/arvados_cwl/arvjob.py | 12 +++++++++++-
sdk/cwl/tests/test_submit.py | 5 +++--
3 files changed, 15 insertions(+), 4 deletions(-)
via cb781d9b5e61c5494d29d53a0a12c678c839eecd (commit)
from cc9aed221c506cfc28f1b6ca37675dba6543d824 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit cb781d9b5e61c5494d29d53a0a12c678c839eecd
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Oct 13 10:36:30 2016 -0400
10259: Workaround for spurious "job_order" on command line. --no-wait returns
pipeline uuid.
diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index c90f890..57b1bc1 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -289,7 +289,7 @@ class ArvCwlRunner(object):
logger.info("Pipeline instance %s", self.pipeline["uuid"])
if runnerjob and not kwargs.get("wait"):
- runnerjob.run()
+ runnerjob.run(wait=kwargs.get("wait"))
return runnerjob.uuid
self.poll_api = arvados.api('v1')
diff --git a/sdk/cwl/arvados_cwl/arvjob.py b/sdk/cwl/arvados_cwl/arvjob.py
index 8b6642f..5250410 100644
--- a/sdk/cwl/arvados_cwl/arvjob.py
+++ b/sdk/cwl/arvados_cwl/arvjob.py
@@ -234,6 +234,12 @@ class RunnerJob(Runner):
workflowmapper = super(RunnerJob, self).arvados_job_spec(dry_run=dry_run, pull_image=pull_image, **kwargs)
+ # Need to filter this out, gets added by cwltool when providing
+ # parameters on the command line, and arv-run-pipeline-instance doesn't
+ # like it.
+ if "job_order" in self.job_order:
+ del self.job_order["job_order"]
+
self.job_order["cwl:tool"] = workflowmapper.mapper(self.tool.tool["id"]).target[5:]
if self.output_name:
self.job_order["arv:output_name"] = self.output_name
@@ -258,6 +264,10 @@ class RunnerJob(Runner):
"state": "RunningOnServer"}).execute(num_retries=self.arvrunner.num_retries)
logger.info("Created pipeline %s", self.arvrunner.pipeline["uuid"])
+ if kwargs.get("wait") is False:
+ self.uuid = self.arvrunner.pipeline["uuid"]
+ return
+
job = None
while not job:
time.sleep(2)
@@ -270,7 +280,7 @@ class RunnerJob(Runner):
self.arvrunner.processes[self.uuid] = self
if job["state"] in ("Complete", "Failed", "Cancelled"):
- self.done(response)
+ self.done(job)
class RunnerTemplate(object):
diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py
index f5fe2c0..7c8659a 100644
--- a/sdk/cwl/tests/test_submit.py
+++ b/sdk/cwl/tests/test_submit.py
@@ -135,7 +135,8 @@ def stubs(func):
}
}
stubs.pipeline_create = copy.deepcopy(stubs.expect_pipeline_instance)
- stubs.pipeline_create["uuid"] = "zzzzz-d1hrv-zzzzzzzzzzzzzzz"
+ stubs.expect_pipeline_uuid = "zzzzz-d1hrv-zzzzzzzzzzzzzzz"
+ stubs.pipeline_create["uuid"] = stubs.expect_pipeline_uuid
stubs.pipeline_with_job = copy.deepcopy(stubs.pipeline_create)
stubs.pipeline_with_job["components"]["cwl-runner"]["job"] = {
"uuid": "zzzzz-8i9sb-zzzzzzzzzzzzzzz",
@@ -229,7 +230,7 @@ class TestSubmit(unittest.TestCase):
stubs.api.pipeline_instances().create.assert_called_with(
body=expect_pipeline)
self.assertEqual(capture_stdout.getvalue(),
- stubs.expect_job_uuid + '\n')
+ stubs.expect_pipeline_uuid + '\n')
@mock.patch("time.sleep")
@stubs
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list