[ARVADOS] created: 1.1.0-139-g2b713e5

Git user git at public.curoverse.com
Wed Nov 15 12:53:10 EST 2017


        at  2b713e548510a99803c41ceb13d47fa2f38b51bf (commit)


commit 2b713e548510a99803c41ceb13d47fa2f38b51bf
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date:   Wed Nov 15 10:56:00 2017 -0500

    12601: Apply pathmap to job order for RunInSingleContainer subwf.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>

diff --git a/sdk/cwl/arvados_cwl/arvworkflow.py b/sdk/cwl/arvados_cwl/arvworkflow.py
index fdf506e..316af0e 100644
--- a/sdk/cwl/arvados_cwl/arvworkflow.py
+++ b/sdk/cwl/arvados_cwl/arvworkflow.py
@@ -18,7 +18,7 @@ from cwltool.pathmapper import adjustFileObjs, adjustDirObjs, visit_class
 import ruamel.yaml as yaml
 
 from .runner import upload_dependencies, packed_workflow, upload_workflow_collection, trim_anonymous_location, remove_redundant_fields
-from .pathmapper import trim_listing
+from .pathmapper import ArvPathMapper, trim_listing
 from .arvtool import ArvadosCommandTool
 from .perf import Perf
 
@@ -110,8 +110,17 @@ class ArvadosWorkflow(Workflow):
                                         False)
 
             with Perf(metrics, "subworkflow adjust"):
+                joborder_resolved = copy.deepcopy(joborder)
                 joborder_keepmount = copy.deepcopy(joborder)
 
+                reffiles = []
+                visit_class(joborder_keepmount, ("File", "Directory"), lambda x: reffiles.append(x))
+
+                mapper = ArvPathMapper(self.arvrunner, reffiles, kwargs["basedir"],
+                                 "/keep/%s",
+                                 "/keep/%s/%s",
+                                 **kwargs)
+
                 def keepmount(obj):
                     remove_redundant_fields(obj)
                     with SourceLine(obj, None, WorkflowException, logger.isEnabledFor(logging.DEBUG)):
@@ -119,7 +128,7 @@ class ArvadosWorkflow(Workflow):
                             raise WorkflowException("%s object is missing required 'location' field: %s" % (obj["class"], obj))
                     with SourceLine(obj, "location", WorkflowException, logger.isEnabledFor(logging.DEBUG)):
                         if obj["location"].startswith("keep:"):
-                            obj["location"] = "/keep/" + obj["location"][5:]
+                            obj["location"] = mapper.mapper(obj["location"]).target
                             if "listing" in obj:
                                 del obj["listing"]
                         elif obj["location"].startswith("_:"):
@@ -129,6 +138,12 @@ class ArvadosWorkflow(Workflow):
 
                 visit_class(joborder_keepmount, ("File", "Directory"), keepmount)
 
+                def resolved(obj):
+                    if obj["location"].startswith("keep:"):
+                        obj["location"] = mapper.mapper(obj["location"]).resolved
+
+                visit_class(joborder_resolved, ("File", "Directory"), resolved)
+
                 if self.wf_pdh is None:
                     adjustFileObjs(packed, keepmount)
                     adjustDirObjs(packed, keepmount)
@@ -159,6 +174,6 @@ class ArvadosWorkflow(Workflow):
             })
             kwargs["loader"] = self.doc_loader
             kwargs["avsc_names"] = self.doc_schema
-            return ArvadosCommandTool(self.arvrunner, wf_runner, **kwargs).job(joborder, output_callback, **kwargs)
+            return ArvadosCommandTool(self.arvrunner, wf_runner, **kwargs).job(joborder_resolved, output_callback, **kwargs)
         else:
             return super(ArvadosWorkflow, self).job(joborder, output_callback, **kwargs)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list