Skip to content

Commit

Permalink
feat(dask): update info command to include autoscaler info (reanahub#701
Browse files Browse the repository at this point in the history
)

closes (reanahub/reana/834)
  • Loading branch information
Alputer committed Sep 20, 2024
1 parent 73ab0ea commit 3c80569
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions reana_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@
DASK_ENABLED = strtobool(os.getenv("DASK_ENABLED", "true"))
"""Whether dask is enabled in the cluster or not"""

DASK_AUTOSCALER_ENABLED = strtobool(os.getenv("DASK_AUTOSCALER_ENABLED", "true"))
"""Whether dask autoscaler is enabled in the cluster or not"""

REANA_DASK_CLUSTER_MAX_CORES_LIMIT = float(
os.getenv("REANA_DASK_CLUSTER_MAX_CORES_LIMIT", 8)
)
Expand Down
17 changes: 17 additions & 0 deletions reana_server/rest/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
REANA_KUBERNETES_JOBS_MAX_USER_TIMEOUT_LIMIT,
REANA_INTERACTIVE_SESSION_MAX_INACTIVITY_PERIOD,
DASK_ENABLED,
DASK_AUTOSCALER_ENABLED,
REANA_DASK_CLUSTER_MAX_CORES_LIMIT,
REANA_DASK_CLUSTER_MAX_MEMORY_LIMIT,
REANA_DASK_CLUSTER_DEFAULT_CORES_LIMIT,
Expand Down Expand Up @@ -139,6 +140,13 @@ def info(user, **kwargs): # noqa
value:
type: string
type: object
dask_autoscaler_enabled:
properties:
title:
type: string
value:
type: string
type: object
dask_cluster_default_cores_limit:
properties:
title:
Expand Down Expand Up @@ -236,6 +244,10 @@ def info(user, **kwargs): # noqa
"title": "Dask workflows allowed in the cluster",
"value": "False"
},
"dask_autoscaler_enabled": {
"title": "Dask autoscaler is used for the dask clusters",
"value": "False"
},
"dask_cluster_default_cores_limit": {
"title": "Default cores limit for dask clusters",
"value": "4"
Expand Down Expand Up @@ -318,6 +330,10 @@ def info(user, **kwargs): # noqa
),
)
if DASK_ENABLED:
cluster_information["dask_autoscaler_enabled"] = dict(
title="Dask autoscaler is used for the dask clusters",
value=bool(DASK_AUTOSCALER_ENABLED),
)
cluster_information["dask_cluster_default_cores_limit"] = dict(
title="Default cores limit for dask clusters",
value=REANA_DASK_CLUSTER_DEFAULT_CORES_LIMIT,
Expand Down Expand Up @@ -388,6 +404,7 @@ class InfoSchema(Schema):
kubernetes_max_memory_limit = fields.Nested(StringInfoValue)
dask_enabled = fields.Nested(StringInfoValue)
if DASK_ENABLED:
dask_autoscaler_enabled = fields.Nested(StringInfoValue)
dask_cluster_default_cores_limit = fields.Nested(StringInfoValue)
dask_cluster_max_cores_limit = fields.Nested(StringInfoValue)
dask_cluster_default_memory_limit = fields.Nested(StringInfoValue)
Expand Down

0 comments on commit 3c80569

Please sign in to comment.