[ARVADOS] created: 1.3.0-709-g54f5db8e2

Git user git at public.curoverse.com
Tue Apr 9 20:18:02 UTC 2019


        at  54f5db8e28df329286770b9d5ef8357a71356457 (commit)


commit 54f5db8e28df329286770b9d5ef8357a71356457
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Tue Apr 9 09:45:04 2019 -0400

    14723: Mapping each target destination to an input file WIP
    
    Arvados-DCO-1.1-Signed-off-by: Eric Biagiotti <ebiagiotti at veritasgenetics.com>

diff --git a/sdk/cwl/arvados_cwl/executor.py b/sdk/cwl/arvados_cwl/executor.py
index c35842616..d185d70fe 100644
--- a/sdk/cwl/arvados_cwl/executor.py
+++ b/sdk/cwl/arvados_cwl/executor.py
@@ -436,13 +436,12 @@ http://doc.arvados.org/install/install-api-server.html#disable_api_methods
         adjustFileObjs(outputObj, capture)
 
         generatemapper = NoFollowPathMapper(files, "", "", separateDirs=False)
-
         final = arvados.collection.Collection(api_client=self.api,
                                               keep_client=self.keep_client,
                                               num_retries=self.num_retries)
 
         for k,v in generatemapper.items():
-            if k.startswith("_:"):
+            if v.resolved.startswith("_:"):
                 if v.type == "Directory":
                     continue
                 if v.type == "CreateFile":
@@ -450,9 +449,9 @@ http://doc.arvados.org/install/install-api-server.html#disable_api_methods
                         f.write(v.resolved.encode("utf-8"))
                     continue
 
-            if not k.startswith("keep:"):
+            if not v.resolved.startswith("keep:"):
                 raise Exception("Output source is not in keep or a literal")
-            sp = k.split("/")
+            sp = v.resolved.split("/")
             srccollection = sp[0][5:]
             try:
                 reader = self.collection_cache.get(srccollection)
diff --git a/sdk/cwl/arvados_cwl/pathmapper.py b/sdk/cwl/arvados_cwl/pathmapper.py
index 38135899d..37ca2515e 100644
--- a/sdk/cwl/arvados_cwl/pathmapper.py
+++ b/sdk/cwl/arvados_cwl/pathmapper.py
@@ -284,23 +284,34 @@ class StagingPathMapper(PathMapper):
         self.targets.add(tgt)
         if obj["class"] == "Directory":
             if obj.get("writable"):
-                self._pathmap[loc] = MapperEnt(loc, tgt, "WritableDirectory", staged)
+                self._pathmap[tgt] = MapperEnt(loc, tgt, "WritableDirectory", staged)
             else:
-                self._pathmap[loc] = MapperEnt(loc, tgt, "Directory", staged)
+                self._pathmap[tgt] = MapperEnt(loc, tgt, "Directory", staged)
             if loc.startswith("_:") or self._follow_dirs:
                 self.visitlisting(obj.get("listing", []), tgt, basedir)
         elif obj["class"] == "File":
-            if loc in self._pathmap:
+            if tgt in self._pathmap:
                 return
             if "contents" in obj and loc.startswith("_:"):
-                self._pathmap[loc] = MapperEnt(obj["contents"], tgt, "CreateFile", staged)
+                self._pathmap[tgt] = MapperEnt(obj["contents"], tgt, "CreateFile", staged)
             else:
                 if copy or obj.get("writable"):
-                    self._pathmap[loc] = MapperEnt(loc, tgt, "WritableFile", staged)
+                    self._pathmap[tgt] = MapperEnt(loc, tgt, "WritableFile", staged)
                 else:
-                    self._pathmap[loc] = MapperEnt(loc, tgt, "File", staged)
+                    self._pathmap[tgt] = MapperEnt(loc, tgt, "File", staged)
                 self.visitlisting(obj.get("secondaryFiles", []), stagedir, basedir)
 
+    def mapper(self, src):  # type: (Text) -> MapperEnt
+        if u"#" in src:
+            i = src.index(u"#")         
+            for k,v in self._pathmap.items():
+                if v.resolved == src[:i]:
+                    return MapperEnt(v.resolved, v.target + src[i:], v.type, v.staged)
+    
+        for k,v in self._pathmap.items():
+            if v.resolved == src:
+                return self._pathmap[k]
+
 
 class VwdPathMapper(StagingPathMapper):
     def setup(self, referenced_files, basedir):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list