From 5d0007f0798d34619a21e447f12c34ac2023f2fb Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Tue, 6 Dec 2022 13:41:42 -0500 Subject: [PATCH] 19847: Fix KeepCacheTypeRequirement Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- sdk/cwl/arvados_cwl/arvcontainer.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sdk/cwl/arvados_cwl/arvcontainer.py b/sdk/cwl/arvados_cwl/arvcontainer.py index fde9db384e..4be2e2bd74 100644 --- a/sdk/cwl/arvados_cwl/arvcontainer.py +++ b/sdk/cwl/arvados_cwl/arvcontainer.py @@ -266,11 +266,14 @@ class ArvadosContainer(JobBase): use_disk_cache = (self.arvrunner.api.config()["Containers"].get("DefaultKeepCacheDisk", 0) > 0) + keep_cache_type_req, _ = self.get_requirement("http://arvados.org/cwl#KeepCacheTypeRequirement") + if keep_cache_type_req: + if "keepCacheType" in keep_cache_type_req: + if keep_cache_type_req["keepCacheType"] == "ram_cache": + use_disk_cache = False + runtime_req, _ = self.get_requirement("http://arvados.org/cwl#RuntimeConstraints") if runtime_req: - if "keepCacheType" in runtime_req: - if cache_type == "ram_cache": - use_disk_cache = False if "keep_cache" in runtime_req: if use_disk_cache: # If DefaultKeepCacheDisk is non-zero it means we should use disk cache. -- 2.30.2