From 44d98de115d99e1ef0b407578c98fcc2fa26208e Mon Sep 17 00:00:00 2001 From: Enol Fernandez Date: Tue, 4 Jul 2023 07:43:00 +0100 Subject: [PATCH] feat: set CPU guarantee depending on limit Sets a CPU guarantee equal to 1 if limit is <= 4, equal to 2 if larger limit. Related: https://support.d4science.org/issues/25331 --- egi_notebooks_hub/d4science.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/egi_notebooks_hub/d4science.py b/egi_notebooks_hub/d4science.py index e5c5f8d..ee52aba 100644 --- a/egi_notebooks_hub/d4science.py +++ b/egi_notebooks_hub/d4science.py @@ -418,6 +418,9 @@ def profile_list(self, spawner): cut_info = [] if "Cores" in p["Cut"]: override["cpu_limit"] = float(p["Cut"]["Cores"]) + override["cpu_guarantee"] = ( + 1 if override["cpu_limit"] <= 4 else 2 + ) cut_info.append(f"{p['Cut']['Cores']} Cores") if "Memory" in p["Cut"]: override["mem_limit"] = (