[ARVADOS] updated: 691a08fd486e53ce656ae20fea84c2b3ec1a1088

Git user git at public.curoverse.com
Wed Jun 22 09:55:14 EDT 2016


Summary of changes:
 sdk/cwl/arvados_cwl/arvcontainer.py | 24 ++++--------------------
 sdk/cwl/arvados_cwl/arvtool.py      | 10 +++++-----
 2 files changed, 9 insertions(+), 25 deletions(-)

       via  691a08fd486e53ce656ae20fea84c2b3ec1a1088 (commit)
      from  ffdc34b50c159573ffeeb836fb405890e4062d01 (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 691a08fd486e53ce656ae20fea84c2b3ec1a1088
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jun 22 09:55:12 2016 -0400

    8442: Code cleanup.  Remove dead code.  Update comments.

diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py
index 2fb2c33..94a7579 100644
--- a/sdk/cwl/arvados_cwl/arvcontainer.py
+++ b/sdk/cwl/arvados_cwl/arvcontainer.py
@@ -14,7 +14,7 @@ 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
@@ -51,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)
@@ -89,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
@@ -146,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)
diff --git a/sdk/cwl/arvados_cwl/arvtool.py b/sdk/cwl/arvados_cwl/arvtool.py
index 0601fa6..ecc913e 100644
--- a/sdk/cwl/arvados_cwl/arvtool.py
+++ b/sdk/cwl/arvados_cwl/arvtool.py
@@ -9,21 +9,21 @@ class ArvadosCommandTool(CommandLineTool):
     def __init__(self, arvrunner, toolpath_object, **kwargs):
         super(ArvadosCommandTool, self).__init__(toolpath_object, **kwargs)
         self.arvrunner = arvrunner
-        self.crunch2 = (kwargs["work_api"] == "containers")
+        self.work_api = kwargs["work_api"]
 
     def makeJobRunner(self):
-        if self.crunch2:
+        if self.work_api == "containers":
             return ArvadosContainer(self.arvrunner)
-        else:
+        elif self.work_api == "jobs":
             return ArvadosJob(self.arvrunner)
 
     def makePathMapper(self, reffiles, **kwargs):
-        if self.crunch2:
+        if self.work_api == "containers":
             return ArvPathMapper(self.arvrunner, reffiles, kwargs["basedir"],
                                  "/keep/%s",
                                  "/keep/%s/%s",
                                  **kwargs)
-        else:
+        elif self.work_api == "jobs":
             return ArvPathMapper(self.arvrunner, reffiles, kwargs["basedir"],
                                  "$(task.keep)/%s",
                                  "$(task.keep)/%s/%s",

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list