[arvados] updated: 2.5.0-232-g82de91b57

git repository hosting git at public.arvados.org
Tue Mar 7 18:24:20 UTC 2023


Summary of changes:
 doc/user/cwl/cwl-extensions.html.textile.liquid | 14 ++++++++++++++
 sdk/cwl/arvados_cwl/arvcontainer.py             | 12 ++++++------
 2 files changed, 20 insertions(+), 6 deletions(-)

       via  82de91b57218abf4f74a38f1bf53d0cc28cd8da9 (commit)
      from  9e76a12ff0b25322f86caf6d5ea70c09cbfd8829 (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 82de91b57218abf4f74a38f1bf53d0cc28cd8da9
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Mar 7 13:21:03 2023 -0500

    19975: Add OutOfMemoryRetry to CWL extensions page.
    
    Out of memory retry is now a warning for better visibility.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/doc/user/cwl/cwl-extensions.html.textile.liquid b/doc/user/cwl/cwl-extensions.html.textile.liquid
index 197816f4a..0b8562de1 100644
--- a/doc/user/cwl/cwl-extensions.html.textile.liquid
+++ b/doc/user/cwl/cwl-extensions.html.textile.liquid
@@ -71,6 +71,10 @@ hints:
 
   arv:UsePreemptible:
     usePreemptible: true
+
+  arv:OutOfMemoryRetry:
+    memoryRetryMultipler: 2
+    memoryErrorRegex: "custom memory error"
 {% endcodeblock %}
 
 h2(#RunInSingleContainer). arv:RunInSingleContainer
@@ -188,6 +192,16 @@ table(table table-bordered table-condensed).
 |_. Field |_. Type |_. Description |
 |usePreemptible|boolean|Required, true to opt-in to using preemptible instances, false to opt-out.|
 
+
+h2(#OutOfMemoryRetry). arv:OutOfMemoryRetry
+
+Request that when a workflow step appears to have failed because it did not request enough RAM, it should be re-submitted with more RAM.  Out of memory conditions are detected either by the container being unexpectedly killed (exit code 137) or by matching a pattern in the container's output (see @memoryErrorRegex@).  Retrying will increase the base RAM request by the value of @memoryRetryMultipler at .  For example, if the original RAM request was 10 GiB and the multiplier is 1.5, then it will re-submit with 15 GiB.  Containers are only re-submitted once.  If it fails a second time after increasing RAM, then the worklow step will still fail.
+
+table(table table-bordered table-condensed).
+|_. Field |_. Type |_. Description |
+|memoryRetryMultipler|float|Required, the retry will multiply the base memory request by this factor to get the retry memory request.|
+|memoryErrorRegex|string|Optional, a custom regex that, if found in the stdout, stderr or crunch-run logging of a program, will trigger a retry with greater RAM.  If not provided, the default pattern matches "out of memory" (with or without spaces), "memory error" (with or without spaces), "bad_alloc" and "container using over 90% of memory"|
+
 h2. arv:dockerCollectionPDH
 
 This is an optional extension field appearing on the standard @DockerRequirement at .  It specifies the portable data hash of the Arvados collection containing the Docker image.  If present, it takes precedence over @dockerPull@ or @dockerImageId at .
diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py
index aafbc38fc..be8e557bd 100644
--- a/sdk/cwl/arvados_cwl/arvcontainer.py
+++ b/sdk/cwl/arvados_cwl/arvcontainer.py
@@ -367,11 +367,11 @@ class ArvadosContainer(JobBase):
                 logger.warning("%s API revision is %s, revision %s is required to support setting properties on output collections.",
                                self.arvrunner.label(self), self.arvrunner.api._rootDesc["revision"], "20220510")
 
-        ramMultiplier = [1]
+        ram_multiplier = [1]
 
         oom_retry_req, _ = self.get_requirement("http://arvados.org/cwl#OutOfMemoryRetry")
         if oom_retry_req and oom_retry_req.get('memoryRetryMultipler'):
-            ramMultiplier.append(oom_retry_req.get('memoryRetryMultipler'))
+            ram_multiplier.append(oom_retry_req.get('memoryRetryMultipler'))
 
         if runtimeContext.runnerjob.startswith("arvwf:"):
             wfuuid = runtimeContext.runnerjob[6:runtimeContext.runnerjob.index("#")]
@@ -388,7 +388,7 @@ class ArvadosContainer(JobBase):
 
             self.uuid = runtimeContext.submit_request_uuid
 
-            for i in ramMultiplier:
+            for i in ram_multiplier:
                 runtime_constraints["ram"] = ram * i
 
                 if self.uuid:
@@ -408,7 +408,7 @@ class ArvadosContainer(JobBase):
                     break
 
             if response["container_uuid"] is None:
-                runtime_constraints["ram"] = ram * ramMultiplier[self.attempt_count]
+                runtime_constraints["ram"] = ram * ram_multiplier[self.attempt_count]
 
             container_request["state"] = "Committed"
             response = self.arvrunner.api.container_requests().update(
@@ -477,7 +477,7 @@ class ArvadosContainer(JobBase):
                     processStatus = "permanentFail"
 
                 if processStatus == "permanentFail" and self.attempt_count == 1 and self.out_of_memory_retry(record, container):
-                    logger.info("%s Container failed with out of memory error, retrying with more RAM.",
+                    logger.warning("%s Container failed with out of memory error, retrying with more RAM.",
                                  self.arvrunner.label(self))
                     self.job_runtime.submit_request_uuid = None
                     self.uuid = None
@@ -486,7 +486,7 @@ class ArvadosContainer(JobBase):
                     return
 
                 if rcode == 137:
-                    logger.warning("%s Container may have been killed for using too much RAM.  Try resubmitting with a higher 'ramMin'.",
+                    logger.warning("%s Container may have been killed for using too much RAM.  Try resubmitting with a higher 'ramMin' or use the arv:OutOfMemoryRetry feature.",
                                  self.arvrunner.label(self))
             else:
                 processStatus = "permanentFail"

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list