12764: Fixes
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Wed, 10 Jan 2018 21:58:29 +0000 (16:58 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Mon, 29 Jan 2018 19:49:56 +0000 (14:49 -0500)
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>

sdk/cwl/arvados_cwl/arvcontainer.py
sdk/cwl/arvados_cwl/pathmapper.py
services/crunch-run/crunchrun.go

index deccc69753831e4bdd6aae73c2a55fefb321b525..fba158bda6c80eec6f38ac00c79591c73a1205b1 100644 (file)
@@ -126,7 +126,7 @@ class ArvadosContainer(object):
                     mounts[mountpoint] = {"kind": "collection",
                                           "portable_data_hash": vwd.portable_data_hash(),
                                           "path": p.target}
-                    if t.type.startswith("Writable"):
+                    if p.type.startswith("Writable"):
                         mounts[mountpoint]["writable"] = True
 
         container_request["environment"] = {"TMPDIR": self.tmpdir, "HOME": self.outdir}
index 914ccaa5a1049868cfe7f840f6bf7d56e957218c..bb95ba9ee4636ff273cd93455f901a2123a62995 100644 (file)
@@ -230,7 +230,10 @@ class StagingPathMapper(PathMapper):
             tgt = "%s_%i%s" % (basetgt, n, baseext)
         self.targets.add(tgt)
         if obj["class"] == "Directory":
-            self._pathmap[loc] = MapperEnt(loc, tgt, "Directory", staged)
+            if obj.get("writable"):
+                self._pathmap[loc] = MapperEnt(loc, tgt, "WritableDirectory", staged)
+            else:
+                self._pathmap[loc] = MapperEnt(loc, tgt, "Directory", staged)
             if loc.startswith("_:") or self._follow_dirs:
                 self.visitlisting(obj.get("listing", []), tgt, basedir)
         elif obj["class"] == "File":
@@ -239,7 +242,7 @@ class StagingPathMapper(PathMapper):
             if "contents" in obj and loc.startswith("_:"):
                 self._pathmap[loc] = MapperEnt(obj["contents"], tgt, "CreateFile", staged)
             else:
-                if copy:
+                if copy or obj.get("writable"):
                     self._pathmap[loc] = MapperEnt(loc, tgt, "WritableFile", staged)
                 else:
                     self._pathmap[loc] = MapperEnt(loc, tgt, "File", staged)
index 60f2a6fa2cadf86321db4155649e951af9ff24fe..5437e3653aa8939fda4bb453b173630f8ec40c36 100644 (file)
@@ -580,7 +580,10 @@ func (runner *ContainerRunner) SetupMounts() (err error) {
                if err == nil {
                        if dir.IsDir() {
                                err = filepath.Walk(cp.src, func(walkpath string, walkinfo os.FileInfo, walkerr error) error {
-                                       return copyfile(walkpath, path.Join(cp.bind, walkpath))
+                                       if walkinfo.Mode().IsRegular() {
+                                               return copyfile(walkpath, path.Join(cp.bind, walkpath[len(cp.src):]))
+                                       }
+                                       return nil
                                })
                        } else {
                                err = copyfile(cp.src, cp.bind)