9442: Override kwargs["outdir"] so that $(runtime.outdir) is set correctly.
[arvados.git] / sdk / cwl / arvados_cwl / arvcontainer.py
index 384b03b6d9c28f17d847688439466c75527c0a2c..94a7579f202a62d88f7a69481e4f2fe65dfa0f7b 100644 (file)
@@ -14,11 +14,12 @@ from .runner import Runner
 logger = logging.getLogger('arvados.cwl-runner')
 
 class ArvadosContainer(object):
-    """Submit and manage a Crunch job for executing a CWL CommandLineTool."""
+    """Submit and manage a Crunch container request for executing a CWL CommandLineTool."""
 
     def __init__(self, runner):
         self.arvrunner = runner
         self.running = False
+        self.uuid = None
 
     def update_pipeline_component(self, r):
         pass
@@ -50,20 +51,6 @@ class ArvadosContainer(object):
         if self.generatefiles:
             raise UnsupportedRequirement("Generate files not supported")
 
-            vwd = arvados.collection.Collection(api_client=self.arvrunner.api_client)
-            container_request["task.vwd"] = {}
-            for t in self.generatefiles:
-                if isinstance(self.generatefiles[t], dict):
-                    src, rest = self.arvrunner.fs_access.get_collection(self.generatefiles[t]["path"].replace("$(task.keep)/", "keep:"))
-                    vwd.copy(rest, t, source_collection=src)
-                else:
-                    with vwd.open(t, "w") as f:
-                        f.write(self.generatefiles[t])
-            vwd.save_new()
-            # TODO
-            # for t in self.generatefiles:
-            #     container_request["task.vwd"][t] = "$(task.keep)/%s/%s" % (vwd.portable_data_hash(), t)
-
         container_request["environment"] = {"TMPDIR": "/tmp"}
         if self.environment:
             container_request["environment"].update(self.environment)
@@ -88,7 +75,6 @@ class ArvadosContainer(object):
         if resources is not None:
             runtime_constraints["vcpus"] = resources.get("cores", 1)
             runtime_constraints["ram"] = resources.get("ram") * 2**20
-            #runtime_constraints["min_scratch_mb_per_node"] = resources.get("tmpdirSize", 0) + resources.get("outdirSize", 0)
 
         container_request["mounts"] = mounts
         container_request["runtime_constraints"] = runtime_constraints
@@ -145,11 +131,10 @@ class RunnerContainer(Runner):
     """Submit and manage a container that runs arvados-cwl-runner."""
 
     def arvados_job_spec(self, dry_run=False, pull_image=True, **kwargs):
-        """Create an Arvados job specification for this workflow.
+        """Create an Arvados container request for this workflow.
 
-        The returned dict can be used to create a job (i.e., passed as
-        the +body+ argument to jobs().create()), or as a component in
-        a pipeline template or pipeline instance.
+        The returned dict can be used to create a container passed as
+        the +body+ argument to container_requests().create().
         """
 
         workflowmapper = super(RunnerContainer, self).arvados_job_spec(dry_run=dry_run, pull_image=pull_image, **kwargs)