[ARVADOS] updated: 84bcaa194dd2dd767aea291cdc17e85cd802325a

Git user git at public.curoverse.com
Mon Sep 19 21:48:02 EDT 2016


Summary of changes:
 sdk/cwl/arvados_cwl/__init__.py    |  3 +--
 sdk/cwl/arvados_cwl/arvworkflow.py | 36 ++++++++++++++++++++++++++++++------
 sdk/cwl/arvados_cwl/runner.py      |  3 ++-
 3 files changed, 33 insertions(+), 9 deletions(-)

       via  84bcaa194dd2dd767aea291cdc17e85cd802325a (commit)
      from  559729f94c6676cc6bca707e36417da412f937f5 (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 84bcaa194dd2dd767aea291cdc17e85cd802325a
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Sep 19 21:47:52 2016 -0400

    10081: Upload dependencies.  Fix keep paths.  Ensure correct quoting.

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 0c56c86..f52c4a5 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -23,9 +23,8 @@ import arvados.config
 from .arvcontainer import ArvadosContainer, RunnerContainer
 from .arvjob import ArvadosJob, RunnerJob, RunnerTemplate
 from .arvtool import ArvadosCommandTool
-from .arvworkflow import ArvadosWorkflow
+from .arvworkflow import ArvadosWorkflow, upload_workflow
 from .fsaccess import CollectionFsAccess
-from .arvworkflow import upload_workflow
 from .perf import Perf
 from cwltool.pack import pack
 
diff --git a/sdk/cwl/arvados_cwl/arvworkflow.py b/sdk/cwl/arvados_cwl/arvworkflow.py
index 3bf62ad..ab39409 100644
--- a/sdk/cwl/arvados_cwl/arvworkflow.py
+++ b/sdk/cwl/arvados_cwl/arvworkflow.py
@@ -7,7 +7,7 @@ from cwltool.pack import pack
 from cwltool.load_tool import fetch_document
 from cwltool.process import shortname
 from cwltool.workflow import Workflow
-from cwltool.pathmapper import adjustDirObjs
+from cwltool.pathmapper import adjustFileObjs, adjustDirObjs
 
 import ruamel.yaml as yaml
 
@@ -59,14 +59,38 @@ class ArvadosWorkflow(Workflow):
         req, _ = self.get_requirement("http://arvados.org/cwl#RunInSingleContainer")
         if req:
             document_loader, workflowobj, uri = (self.doc_loader, self.doc_loader.fetch(self.tool["id"]), self.tool["id"])
+
             workflowobj["requirements"] = self.requirements + workflowobj.get("requirements", [])
             workflowobj["hints"] = self.hints + workflowobj.get("hints", [])
             packed = pack(document_loader, workflowobj, uri, self.metadata)
 
-            def prune_directories(obj):
-                if obj["location"].startswith("keep:") and "listing" in obj:
+            upload_dependencies(self.arvrunner,
+                                kwargs.get("name", ""),
+                                document_loader,
+                                packed,
+                                uri,
+                                False)
+
+            upload_dependencies(self.arvrunner,
+                                os.path.basename(joborder.get("id", "#")),
+                                document_loader,
+                                joborder,
+                                joborder.get("id", "#"),
+                                False)
+
+            joborder_keepmount = copy.deepcopy(joborder)
+
+            def keepmount(obj):
+                if obj["location"].startswith("keep:"):
+                    obj["location"] = "/keep/" + obj["location"][5:]
+                else:
+                    raise Exception("Uh oh %s" % obj["location"])
+                if "listing" in obj:
                     del obj["listing"]
-            adjustDirObjs(joborder, prune_directories)
+            adjustFileObjs(joborder_keepmount, keepmount)
+            adjustDirObjs(joborder_keepmount, keepmount)
+            adjustFileObjs(packed, keepmount)
+            adjustDirObjs(packed, keepmount)
 
             wf_runner = {
                 "class": "CommandLineTool",
@@ -83,11 +107,11 @@ class ArvadosWorkflow(Workflow):
                             "entry": yaml.safe_dump(packed).replace("\\", "\\\\").replace('$(', '\$(').replace('${', '\${')
                         }, {
                             "entryname": "cwl.input.json",
-                            "entry": yaml.safe_dump(joborder).replace("\\", "\\\\").replace('$(', '\$(').replace('${', '\${')
+                            "entry": yaml.safe_dump(joborder_keepmount).replace("\\", "\\\\").replace('$(', '\$(').replace('${', '\${')
                         }]
                 }],
                 "hints": workflowobj["hints"],
-                "arguments": ["--no-container", "--move-outputs", "workflow.cwl", "cwl.input.json"]
+                "arguments": ["--no-container", "--move-outputs", "workflow.cwl#main", "cwl.input.json"]
             }
             kwargs["loader"] = self.doc_loader
             kwargs["avsc_names"] = self.doc_schema
diff --git a/sdk/cwl/arvados_cwl/runner.py b/sdk/cwl/arvados_cwl/runner.py
index 155c6a0..2e52b63 100644
--- a/sdk/cwl/arvados_cwl/runner.py
+++ b/sdk/cwl/arvados_cwl/runner.py
@@ -87,7 +87,8 @@ def upload_dependencies(arvrunner, name, document_loader,
                            name=name)
 
     def setloc(p):
-        p["location"] = mapper.mapper(p["location"]).target
+        if not p["location"].startswith("keep:"):
+            p["location"] = mapper.mapper(p["location"]).resolved
     adjustFileObjs(workflowobj, setloc)
     adjustDirObjs(workflowobj, setloc)
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list