[ARVADOS] updated: e14484fbba64222e4b32c353e3ea057c6f10acd0

Git user git at public.curoverse.com
Thu Oct 20 17:06:56 EDT 2016


Summary of changes:
 sdk/cwl/arvados_cwl/__init__.py     |  3 ++-
 sdk/cwl/arvados_cwl/arvcontainer.py | 10 +++++++---
 services/crunch-run/crunchrun.go    | 15 +++++++++++++++
 3 files changed, 24 insertions(+), 4 deletions(-)

       via  e14484fbba64222e4b32c353e3ea057c6f10acd0 (commit)
       via  4d59e4f59204ff6e278ad7f37b55ead3911412e1 (commit)
      from  617ef14a3f2fac4dad5f699af7000187143ebbe3 (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 e14484fbba64222e4b32c353e3ea057c6f10acd0
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Oct 20 17:06:48 2016 -0400

    10172: If RuntimeConstraints.API is set, refresh container record to check if
    output field has been already set by the container.

diff --git a/services/crunch-run/crunchrun.go b/services/crunch-run/crunchrun.go
index d804c01..0b59a3b 100644
--- a/services/crunch-run/crunchrun.go
+++ b/services/crunch-run/crunchrun.go
@@ -563,6 +563,21 @@ func (runner *ContainerRunner) CaptureOutput() error {
 		return nil
 	}
 
+	if wantAPI := runner.Container.RuntimeConstraints.API; wantAPI != nil && *wantAPI {
+		// Output may have been set directly by the container, so
+		// refresh the container record to check.
+		err := runner.ArvClient.Get("containers", runner.Container.UUID,
+			nil, &runner.Container)
+		if err != nil {
+			return err
+		}
+		if runner.Container.Output != "" {
+			// Container output is already set.
+			runner.OutputPDH = &runner.Container.Output
+			return nil
+		}
+	}
+
 	if runner.HostOutputDir == "" {
 		return nil
 	}

commit 4d59e4f59204ff6e278ad7f37b55ead3911412e1
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Oct 20 17:05:28 2016 -0400

    10172: Bugfix getting container output when container is reused.  Tweak output
    to report "Job" or "Container" depending on which API is in use.

diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index ba89951..936f445 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -123,7 +123,8 @@ class ArvCwlRunner(object):
                     try:
                         self.cond.acquire()
                         j = self.processes[uuid]
-                        logger.info("Job %s (%s) is %s", j.name, uuid, event["properties"]["new_attributes"]["state"])
+                        txt = self.work_api[0].upper() + self.work_api[1:-1]
+                        logger.info("%s %s (%s) is %s", txt, j.name, uuid, event["properties"]["new_attributes"]["state"])
                         with Perf(metrics, "done %s" % j.name):
                             j.done(event["properties"]["new_attributes"])
                         self.cond.notify()
diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py
index a3220f9..9f21b3f 100644
--- a/sdk/cwl/arvados_cwl/arvcontainer.py
+++ b/sdk/cwl/arvados_cwl/arvcontainer.py
@@ -113,10 +113,14 @@ class ArvadosContainer(object):
 
             self.arvrunner.processes[response["container_uuid"]] = self
 
-            logger.info("Container %s (%s) request state is %s", self.name, response["uuid"], response["state"])
+            container = self.arvrunner.api.containers().get(
+                uuid=response["container_uuid"]
+            ).execute(num_retries=self.arvrunner.num_retries)
+
+            logger.info("Container request %s (%s) state is %s with container %s %s", self.name, response["uuid"], response["state"], container["uuid"], container["state"])
 
-            if response["state"] == "Final":
-                self.done(response)
+            if container["state"] in ("Complete", "Cancelled"):
+                self.done(container)
         except Exception as e:
             logger.error("Got error %s" % str(e))
             self.output_callback({}, "permanentFail")

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list