[ARVADOS] updated: 328f506a294619694b84cf123332f7c2694552e1

Git user git at public.curoverse.com
Mon Dec 19 15:37:57 EST 2016


Summary of changes:
 sdk/cwl/arvados_cwl/__init__.py     | 21 ++++++++++++++++-----
 sdk/cwl/arvados_cwl/arvcontainer.py |  6 +++---
 2 files changed, 19 insertions(+), 8 deletions(-)

       via  328f506a294619694b84cf123332f7c2694552e1 (commit)
      from  bdc2f242b1a4dd231426868d35b5dd5a5718e39b (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 328f506a294619694b84cf123332f7c2694552e1
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Dec 19 15:33:40 2016 -0500

    10497: Improve up front feature checking and error reporting.

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index c1de2a8..85156db 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -17,6 +17,7 @@ import pkg_resources  # part of setuptools
 from cwltool.errors import WorkflowException
 import cwltool.main
 import cwltool.workflow
+import cwltool.process
 import schema_salad
 from schema_salad.sourceline import SourceLine
 
@@ -192,15 +193,25 @@ class ArvCwlRunner(object):
     def add_uploaded(self, src, pair):
         self.uploaded[src] = pair
 
-    def check_writable(self, obj):
+    def check_features(self, obj):
         if isinstance(obj, dict):
+            if obj.get("class") == "InitialWorkDirRequirement":
+                if self.work_api == "containers":
+                    raise UnsupportedRequirement("InitialWorkDirRequirement not supported with --api=containers")
             if obj.get("writable"):
                 raise SourceLine(obj, "writable", UnsupportedRequirement).makeError("InitialWorkDir feature 'writable: true' not supported")
+            if obj.get("class") == "CommandLineTool":
+                if self.work_api == "containers":
+                    if obj.get("stdin"):
+                        raise SourceLine(obj, "stdin", UnsupportedRequirement).makeError("Stdin redirection currently not suppported with --api=containers")
+                    if obj.get("stderr"):
+                        raise SourceLine(obj, "stderr", UnsupportedRequirement).makeError("Stderr redirection currently not suppported with --api=containers")
             for v in obj.itervalues():
-                self.check_writable(v)
+                self.check_features(v)
         if isinstance(obj, list):
-            for v in obj:
-                self.check_writable(v)
+            for i,v in enumerate(obj):
+                with SourceLine(obj, i, UnsupportedRequirement):
+                    self.check_features(v)
 
     def make_output_collection(self, name, tagsString, outputObj):
         outputObj = copy.deepcopy(outputObj)
@@ -309,7 +320,7 @@ class ArvCwlRunner(object):
     def arv_executor(self, tool, job_order, **kwargs):
         self.debug = kwargs.get("debug")
 
-        tool.visit(self.check_writable)
+        tool.visit(self.check_features)
 
         self.project_uuid = kwargs.get("project_uuid")
         self.pipeline = None
diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py
index 827e92d..25a8ffa 100644
--- a/sdk/cwl/arvados_cwl/arvcontainer.py
+++ b/sdk/cwl/arvados_cwl/arvcontainer.py
@@ -68,17 +68,17 @@ class ArvadosContainer(object):
                 }
 
         if self.generatefiles["listing"]:
-            raise SourceLine(self.tool.get_requirement("InitialWorkDirRequirement")[0], None, UnsupportedRequirement).makeError("InitialWorkDirRequirement not supported with --api=containers")
+            raise UnsupportedRequirement("InitialWorkDirRequirement not supported with --api=containers")
 
         container_request["environment"] = {"TMPDIR": self.tmpdir, "HOME": self.outdir}
         if self.environment:
             container_request["environment"].update(self.environment)
 
         if self.stdin:
-            raise SourceLine(self.tool.tool, "stdin", UnsupportedRequirement).makeError("Stdin redirection currently not suppported")
+            raise UnsupportedRequirement("Stdin redirection currently not suppported")
 
         if self.stderr:
-            raise SourceLine(self.tool.tool, "stderr", UnsupportedRequirement).makeError("Stderr redirection currently not suppported")
+            raise UnsupportedRequirement("Stderr redirection currently not suppported")
 
         if self.stdout:
             mounts["stdout"] = {"kind": "file",

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list