[ARVADOS] updated: 1.3.0-710-g2f2d82b01

Git user git at public.curoverse.com
Tue Apr 9 20:23:39 UTC 2019


Summary of changes:
 sdk/cwl/arvados_cwl/executor.py   | 10 +++++-----
 sdk/cwl/arvados_cwl/pathmapper.py | 27 +++++++++++++++++----------
 2 files changed, 22 insertions(+), 15 deletions(-)

       via  2f2d82b01df5f9175cd94518e8574e58461cd93f (commit)
      from  54f5db8e28df329286770b9d5ef8357a71356457 (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 2f2d82b01df5f9175cd94518e8574e58461cd93f
Author: Eric Biagiotti <ebiagiotti at veritasgenetics.com>
Date:   Tue Apr 9 16:23:32 2019 -0400

    14723:  Fixes literal mapping and name conflict resolution
    
    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 d185d70fe..0e46c5360 100644
--- a/sdk/cwl/arvados_cwl/executor.py
+++ b/sdk/cwl/arvados_cwl/executor.py
@@ -436,17 +436,17 @@ 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 v.resolved.startswith("_:"):
-                if v.type == "Directory":
+            if v.type == "Directory" and v.resolved.startswith("_:"):
                     continue
-                if v.type == "CreateFile":
-                    with final.open(v.target, "wb") as f:
-                        f.write(v.resolved.encode("utf-8"))
+            if v.type == "CreateFile" and (k.startswith("_:") or v.resolved.startswith("_:")):
+                with final.open(v.target, "wb") as f:
+                    f.write(v.resolved.encode("utf-8"))
                     continue
 
             if not v.resolved.startswith("keep:"):
diff --git a/sdk/cwl/arvados_cwl/pathmapper.py b/sdk/cwl/arvados_cwl/pathmapper.py
index 37ca2515e..f08d7d7b2 100644
--- a/sdk/cwl/arvados_cwl/pathmapper.py
+++ b/sdk/cwl/arvados_cwl/pathmapper.py
@@ -276,8 +276,14 @@ class StagingPathMapper(PathMapper):
         loc = obj["location"]
         tgt = os.path.join(stagedir, obj["basename"])
         basetgt, baseext = os.path.splitext(tgt)
+
+        def targetExists():
+            return tgt in self.targets and ("contents" not in obj) and (self._pathmap[tgt].resolved != loc)
+        def literalTargetExists():
+            return tgt in self.targets and "contents" in obj
+
         n = 1
-        if tgt in self.targets and (self.reversemap(tgt)[0] != loc):
+        if targetExists() or literalTargetExists():
             while tgt in self.targets:
                 n += 1
                 tgt = "%s_%i%s" % (basetgt, n, baseext)
@@ -293,7 +299,7 @@ class StagingPathMapper(PathMapper):
             if tgt in self._pathmap:
                 return
             if "contents" in obj and loc.startswith("_:"):
-                self._pathmap[tgt] = MapperEnt(obj["contents"], tgt, "CreateFile", staged)
+                self._pathmap[loc] = MapperEnt(obj["contents"], tgt, "CreateFile", staged)
             else:
                 if copy or obj.get("writable"):
                     self._pathmap[tgt] = MapperEnt(loc, tgt, "WritableFile", staged)
@@ -302,15 +308,16 @@ class StagingPathMapper(PathMapper):
                 self.visitlisting(obj.get("secondaryFiles", []), stagedir, basedir)
 
     def mapper(self, src):  # type: (Text) -> MapperEnt
+        def getMapperEnt(src):
+            for k,v in viewitems(self._pathmap):
+                if v.resolved == src or (v.type == "CreateFile" and k == src):
+                    return v
+
         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]
+            i = src.index(u"#")
+            v = getMapperEnt(src[i:])
+            return MapperEnt(v.resolved, v.target + src[i:], v.type, v.staged)
+        return getMapperEnt(src)
 
 
 class VwdPathMapper(StagingPathMapper):

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list