Skip to content

Commit 4dbfce0

Browse files
committed
feat(dask): make Dask autoscaler configurable (reanahub#702)
1 parent 15d0b97 commit 4dbfce0

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

docs/openapi.json

+15
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,10 @@
429429
"slurmcern"
430430
]
431431
},
432+
"dask_autoscaler_enabled": {
433+
"title": "Dask autoscaler enabled in the cluster",
434+
"value": "False"
435+
},
432436
"dask_cluster_default_number_of_workers": {
433437
"title": "The number of Dask workers created by default",
434438
"value": "2Gi"
@@ -499,6 +503,17 @@
499503
},
500504
"type": "object"
501505
},
506+
"dask_autoscaler_enabled": {
507+
"properties": {
508+
"title": {
509+
"type": "string"
510+
},
511+
"value": {
512+
"type": "string"
513+
}
514+
},
515+
"type": "object"
516+
},
502517
"dask_cluster_default_number_of_workers": {
503518
"properties": {
504519
"title": {

reana_server/config.py

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
DASK_ENABLED = strtobool(os.getenv("DASK_ENABLED", "true"))
6262
"""Whether Dask is enabled in the cluster or not"""
6363

64+
DASK_AUTOSCALER_ENABLED = os.getenv("DASK_AUTOSCALER_ENABLED", "true").lower() == "true"
65+
"""Whether Dask autoscaler is enabled in the cluster or not"""
66+
6467
REANA_DASK_CLUSTER_MAX_MEMORY_LIMIT = os.getenv(
6568
"REANA_DASK_CLUSTER_MAX_MEMORY_LIMIT", "16Gi"
6669
)

reana_server/rest/info.py

+17
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
REANA_KUBERNETES_JOBS_MAX_USER_TIMEOUT_LIMIT,
2626
REANA_INTERACTIVE_SESSION_MAX_INACTIVITY_PERIOD,
2727
DASK_ENABLED,
28+
DASK_AUTOSCALER_ENABLED,
2829
REANA_DASK_CLUSTER_DEFAULT_NUMBER_OF_WORKERS,
2930
REANA_DASK_CLUSTER_MAX_MEMORY_LIMIT,
3031
REANA_DASK_CLUSTER_DEFAULT_SINGLE_WORKER_MEMORY,
@@ -137,6 +138,13 @@ def info(user, **kwargs): # noqa
137138
value:
138139
type: string
139140
type: object
141+
dask_autoscaler_enabled:
142+
properties:
143+
title:
144+
type: string
145+
value:
146+
type: string
147+
type: object
140148
dask_cluster_max_memory_limit:
141149
properties:
142150
title:
@@ -209,6 +217,10 @@ def info(user, **kwargs): # noqa
209217
"title": "Dask workflows allowed in the cluster",
210218
"value": "False"
211219
},
220+
"dask_autoscaler_enabled": {
221+
"title": "Dask autoscaler enabled in the cluster",
222+
"value": "False"
223+
},
212224
"dask_cluster_max_memory_limit": {
213225
"title": "The maximum memory limit for Dask clusters created by users",
214226
"value": "16Gi"
@@ -283,6 +295,10 @@ def info(user, **kwargs): # noqa
283295
),
284296
)
285297
if DASK_ENABLED:
298+
cluster_information["dask_autoscaler_enabled"] = dict(
299+
title="Dask autoscaler enabled in the cluster",
300+
value=bool(DASK_AUTOSCALER_ENABLED),
301+
)
286302
cluster_information["dask_cluster_default_number_of_workers"] = dict(
287303
title="The number of Dask workers created by default",
288304
value=REANA_DASK_CLUSTER_DEFAULT_NUMBER_OF_WORKERS,
@@ -345,6 +361,7 @@ class InfoSchema(Schema):
345361
kubernetes_max_memory_limit = fields.Nested(StringInfoValue)
346362
dask_enabled = fields.Nested(StringInfoValue)
347363
if DASK_ENABLED:
364+
dask_autoscaler_enabled = fields.Nested(StringInfoValue)
348365
dask_cluster_default_number_of_workers = fields.Nested(StringInfoValue)
349366
dask_cluster_max_memory_limit = fields.Nested(StringInfoValue)
350367
dask_cluster_default_single_worker_memory = fields.Nested(StringInfoValue)

0 commit comments

Comments
 (0)