Skip to content

Commit 9a361a9

Browse files
committed
chore(master): merge maint-0.9
ci(runners): upgrade CI runners to Ubuntu 22.04 (reanahub#647) ci(commitlint): consider commit body full stop as warning (reanahub#643) feat(manager): pass K8s requests/limits to job controller (reanahub#643)
2 parents eebd278 + 2b004ce commit 9a361a9

2 files changed

Lines changed: 83 additions & 2 deletions

File tree

reana_workflow_controller/config.py

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,59 @@ def compose_reana_url(hostname: str, hostport: int) -> str:
109109
)
110110
"""Snakemake workflow engine version."""
111111

112+
REANA_KUBERNETES_JOBS_CPU_REQUEST = os.getenv("REANA_KUBERNETES_JOBS_CPU_REQUEST")
113+
"""Default CPU request for user job containers.
114+
115+
Please see the following URL for possible values
116+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.
117+
"""
118+
119+
REANA_KUBERNETES_JOBS_CPU_LIMIT = os.getenv("REANA_KUBERNETES_JOBS_CPU_LIMIT")
120+
"""Default CPU limit for user job containers.
121+
122+
Please see the following URL for possible values
123+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.
124+
"""
125+
126+
REANA_KUBERNETES_JOBS_MEMORY_REQUEST = os.getenv("REANA_KUBERNETES_JOBS_MEMORY_REQUEST")
127+
"""Default memory request for user job containers.
128+
129+
Please see the following URL for possible values
130+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory.
131+
"""
132+
112133
REANA_KUBERNETES_JOBS_MEMORY_LIMIT = os.getenv("REANA_KUBERNETES_JOBS_MEMORY_LIMIT")
113-
"""Maximum default memory limit for user job containers. Exceeding this limit will terminate the container.
134+
"""Default memory limit for user job containers. Exceeding this limit will terminate the container.
135+
136+
Please see the following URL for possible values
137+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory.
138+
"""
139+
140+
REANA_KUBERNETES_JOBS_MAX_USER_CPU_REQUEST = os.getenv(
141+
"REANA_KUBERNETES_JOBS_MAX_USER_CPU_REQUEST"
142+
)
143+
"""Maximum custom CPU request that users can assign to their job containers via
144+
``kubernetes_cpu_request`` in reana.yaml.
145+
146+
Please see the following URL for possible values
147+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.
148+
"""
149+
150+
REANA_KUBERNETES_JOBS_MAX_USER_CPU_LIMIT = os.getenv(
151+
"REANA_KUBERNETES_JOBS_MAX_USER_CPU_LIMIT"
152+
)
153+
"""Maximum custom CPU limit that users can assign to their job containers via
154+
``kubernetes_cpu_limit`` in reana.yaml. Exceeding this limit will terminate the container.
155+
156+
Please see the following URL for possible values
157+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-cpu.
158+
"""
159+
160+
REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_REQUEST = os.getenv(
161+
"REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_REQUEST"
162+
)
163+
"""Maximum custom memory request that users can assign to their job containers via
164+
``kubernetes_memory_request`` in reana.yaml.
114165
115166
Please see the following URL for possible values
116167
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#meaning-of-memory.

reana_workflow_controller/workflow_run_manager.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,15 @@
7575
REANA_INTERACTIVE_SESSIONS_ENVIRONMENTS,
7676
REANA_INTERACTIVE_SESSIONS_RECOMMENDED_IMAGES,
7777
REANA_RUNTIME_BATCH_TERMINATION_GRACE_PERIOD,
78-
REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_LIMIT,
78+
REANA_KUBERNETES_JOBS_CPU_REQUEST,
79+
REANA_KUBERNETES_JOBS_CPU_LIMIT,
80+
REANA_KUBERNETES_JOBS_MEMORY_REQUEST,
7981
REANA_KUBERNETES_JOBS_MEMORY_LIMIT,
8082
REANA_KUBERNETES_JOBS_TIMEOUT_LIMIT,
83+
REANA_KUBERNETES_JOBS_MAX_USER_CPU_REQUEST,
84+
REANA_KUBERNETES_JOBS_MAX_USER_CPU_LIMIT,
85+
REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_REQUEST,
86+
REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_LIMIT,
8187
REANA_KUBERNETES_JOBS_MAX_USER_TIMEOUT_LIMIT,
8288
REANA_WORKFLOW_ENGINE_IMAGE_CWL,
8389
REANA_WORKFLOW_ENGINE_IMAGE_SERIAL,
@@ -765,10 +771,34 @@ def _create_job_spec(
765771
REANA_RUNTIME_KUBERNETES_KEEP_ALIVE_JOBS_WITH_STATUSES
766772
),
767773
},
774+
{
775+
"name": "REANA_KUBERNETES_JOBS_CPU_REQUEST",
776+
"value": REANA_KUBERNETES_JOBS_CPU_REQUEST,
777+
},
778+
{
779+
"name": "REANA_KUBERNETES_JOBS_CPU_LIMIT",
780+
"value": REANA_KUBERNETES_JOBS_CPU_LIMIT,
781+
},
782+
{
783+
"name": "REANA_KUBERNETES_JOBS_MEMORY_REQUEST",
784+
"value": REANA_KUBERNETES_JOBS_MEMORY_REQUEST,
785+
},
768786
{
769787
"name": "REANA_KUBERNETES_JOBS_MEMORY_LIMIT",
770788
"value": REANA_KUBERNETES_JOBS_MEMORY_LIMIT,
771789
},
790+
{
791+
"name": "REANA_KUBERNETES_JOBS_MAX_USER_CPU_REQUEST",
792+
"value": REANA_KUBERNETES_JOBS_MAX_USER_CPU_REQUEST,
793+
},
794+
{
795+
"name": "REANA_KUBERNETES_JOBS_MAX_USER_CPU_LIMIT",
796+
"value": REANA_KUBERNETES_JOBS_MAX_USER_CPU_LIMIT,
797+
},
798+
{
799+
"name": "REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_REQUEST",
800+
"value": REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_REQUEST,
801+
},
772802
{
773803
"name": "REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_LIMIT",
774804
"value": REANA_KUBERNETES_JOBS_MAX_USER_MEMORY_LIMIT,

0 commit comments

Comments
 (0)