X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1da448c49cb4ea4b8147e63f325102f793ca206c..60d5347a73a24638b57715c5f5d9c56d84a9e57e:/sdk/cwl/arvados_cwl/arvcontainer.py diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py index 19516d5b44..aaae7d9f66 100644 --- a/sdk/cwl/arvados_cwl/arvcontainer.py +++ b/sdk/cwl/arvados_cwl/arvcontainer.py @@ -42,17 +42,27 @@ class ArvadosContainer(object): } } + dirs = set() for f in self.pathmapper.files(): - _, p, _ = self.pathmapper.mapper(f) - mounts[p] = { - "kind": "collection", - "portable_data_hash": p[6:] - } + _, p, tp = self.pathmapper.mapper(f) + if tp == "Directory" and '/' not in p[6:]: + mounts[p] = { + "kind": "collection", + "portable_data_hash": p[6:] + } + dirs.add(p[6:]) + for f in self.pathmapper.files(): + _, p, tp = self.pathmapper.mapper(f) + if p[6:].split("/")[0] not in dirs: + mounts[p] = { + "kind": "collection", + "portable_data_hash": p[6:] + } if self.generatefiles["listing"]: raise UnsupportedRequirement("Generate files not supported") - container_request["environment"] = {"TMPDIR": "/tmp"} + container_request["environment"] = {"TMPDIR": self.tmpdir, "HOME": self.outdir} if self.environment: container_request["environment"].update(self.environment) @@ -80,6 +90,14 @@ class ArvadosContainer(object): runtime_constraints["vcpus"] = resources.get("cores", 1) runtime_constraints["ram"] = resources.get("ram") * 2**20 + api_req, _ = get_feature(self, "http://arvados.org/cwl#APIRequirement") + if api_req: + runtime_constraints["API"] = True + + runtime_req, _ = get_feature(self, "http://arvados.org/cwl#RuntimeConstraints") + if runtime_req: + logger.warn("RuntimeConstraints not yet supported by container API") + container_request["mounts"] = mounts container_request["runtime_constraints"] = runtime_constraints @@ -90,7 +108,7 @@ class ArvadosContainer(object): self.arvrunner.processes[response["container_uuid"]] = self - logger.info("Container %s (%s) request state is %s", self.name, response["container_uuid"], response["state"]) + logger.info("Container %s (%s) request state is %s", self.name, response["uuid"], response["state"]) if response["state"] == "Final": self.done(response)