try:
ram = runtime_constraints["ram"]
+ self.uuid = runtimeContext.submit_request_uuid
+
for i in ramMultiplier:
runtime_constraints["ram"] = ram * i
- if runtimeContext.submit_request_uuid:
+ if self.uuid:
response = self.arvrunner.api.container_requests().update(
- uuid=runtimeContext.submit_request_uuid,
+ uuid=self.uuid,
body=container_request,
**extra_submit_params
).execute(num_retries=self.arvrunner.num_retries)
body=container_request,
**extra_submit_params
).execute(num_retries=self.arvrunner.num_retries)
- runtimeContext.submit_request_uuid = response["uuid"]
+ self.uuid = response["uuid"]
if response["container_uuid"] is not None:
break
container_request["state"] = "Committed"
response = self.arvrunner.api.container_requests().update(
- uuid=runtimeContext.submit_request_uuid,
+ uuid=self.uuid,
body=container_request,
**extra_submit_params
).execute(num_retries=self.arvrunner.num_retries)
- self.uuid = response["uuid"]
self.arvrunner.process_submitted(self)
self.attempt_count += 1
done.logtail(logc, callback, "", maxlen=1000)
# Check allocation failure
- oom_matches = oom_retry_req.get('memoryErrorRegex') or r'(bad_alloc|out ?of ?memory|container using over 9.% of memory)'
+ oom_matches = oom_retry_req.get('memoryErrorRegex') or r'(bad_alloc|out ?of ?memory|memory ?error|container using over 9.% of memory)'
if re.search(oom_matches, loglines[0], re.IGNORECASE | re.MULTILINE):
return True
}
tool: 19678-name-id.cwl
doc: "Test issue 19678 - non-string type input parameter called 'name'"
+
+- job: oom/fakeoom.yml
+ output: {}
+ tool: oom/19975-oom.cwl
+ doc: "Test feature 19975 - retry on exit 137"
+
+- job: oom/fakeoom2.yml
+ output: {}
+ tool: oom/19975-oom.cwl
+ doc: "Test feature 19975 - retry on memory error"
+
+- job: oom/fakeoom3.yml
+ output: {}
+ tool: oom/19975-oom3.cwl
+ doc: "Test feature 19975 - retry on custom error"
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+cwlVersion: v1.2
+class: CommandLineTool
+$namespaces:
+ arv: "http://arvados.org/cwl#"
+hints:
+ arv:OutOfMemoryRetry:
+ memoryRetryMultipler: 2
+ ResourceRequirement:
+ ramMin: 256
+ arv:APIRequirement: {}
+inputs:
+ fakeoom: File
+outputs: []
+arguments: [python3, $(inputs.fakeoom)]
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+cwlVersion: v1.2
+class: CommandLineTool
+$namespaces:
+ arv: "http://arvados.org/cwl#"
+hints:
+ arv:OutOfMemoryRetry:
+ memoryRetryMultipler: 2
+ memoryErrorRegex: Whoops
+ ResourceRequirement:
+ ramMin: 256
+ arv:APIRequirement: {}
+inputs:
+ fakeoom: File
+outputs: []
+arguments: [python3, $(inputs.fakeoom)]
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import sys
+import time
+import arvados
+
+api = arvados.api()
+current_container = api.containers().current().execute()
+
+if current_container["runtime_constraints"]["ram"] < (512*1024*1024):
+ sys.exit(137)
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+fakeoom:
+ class: File
+ location: fakeoom.py
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import sys
+import time
+import arvados
+
+api = arvados.api()
+current_container = api.containers().current().execute()
+
+if current_container["runtime_constraints"]["ram"] < (512*1024*1024):
+ raise MemoryError()
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+fakeoom:
+ class: File
+ location: fakeoom2.py
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+import sys
+import time
+import arvados
+
+api = arvados.api()
+current_container = api.containers().current().execute()
+
+if current_container["runtime_constraints"]["ram"] < (512*1024*1024):
+ print("Whoops")
+ sys.exit(1)
--- /dev/null
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+fakeoom:
+ class: File
+ location: fakeoom3.py