Skip to content

Commit

Permalink
rest: add max inactivity period for interactive sessions to info endp…
Browse files Browse the repository at this point in the history
…oint

Adds the `maximum_interactive_session_inactivity_period` value to the ones returned by `/api/info`.

Addresses reanahub/reana-client#657
  • Loading branch information
giuseppe-steduto committed Jun 6, 2023
1 parent f3bc632 commit 140f23e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changes
Version 0.9.1 (UNRELEASED)
--------------------------

- Changes OpenAPI specification with respect to return the maximum inactivity time before automatic closure of interactive sessions in ``info`` endpoint.
- Adds the content of the ``REANA_GITLAB_HOST`` environment variable to the list of GitLab instances from which it is possible to launch a workflow.
- Adds new ``prune_workspace`` endpoint to allow users to delete all the files of a workflow, specifying whether to also delete the inputs and/or the outputs.
- Adds ``interactive-session-cleanup`` command that can be used by REANA administrators to close interactive sessions that are inactive for more than the specified number of days.
Expand Down
11 changes: 11 additions & 0 deletions docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,17 @@
},
"type": "object"
},
"maximum_interactive_session_inactivity_period": {
"properties": {
"title": {
"type": "string"
},
"value": {
"type": "string"
}
},
"type": "object"
},
"maximum_kubernetes_jobs_timeout": {
"properties": {
"title": {
Expand Down
8 changes: 7 additions & 1 deletion reana_server/rest/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from flask import Blueprint, jsonify
from marshmallow import Schema, fields

from reana_commons.config import DEFAULT_WORKSPACE_PATH, WORKSPACE_PATHS
from reana_commons.config import DEFAULT_WORKSPACE_PATH, WORKSPACE_PATHS, REANAConfig

from reana_server.config import (
SUPPORTED_COMPUTE_BACKENDS,
Expand Down Expand Up @@ -108,6 +108,7 @@ def info(user, **kwargs): # noqa
}
"""
try:
ui_config = REANAConfig.load("ui")
cluster_information = dict(
workspaces_available=dict(
title="List of available workspaces",
Expand Down Expand Up @@ -140,6 +141,10 @@ def info(user, **kwargs): # noqa
title="Maximum timeout for Kubernetes jobs",
value=REANA_KUBERNETES_JOBS_MAX_USER_TIMEOUT_LIMIT,
),
maximum_interactive_session_inactivity_period=dict(
title="Maximum inactivity period in days before automatic closure of interactive sessions",
value=ui_config.get("maximum_interactive_session_inactivity_period"),
),
)
return InfoSchema().dump(cluster_information)

Expand Down Expand Up @@ -180,3 +185,4 @@ class InfoSchema(Schema):
maximum_workspace_retention_period = fields.Nested(StringNullableInfoValue)
default_kubernetes_jobs_timeout = fields.Nested(StringInfoValue)
maximum_kubernetes_jobs_timeout = fields.Nested(StringInfoValue)
maximum_interactive_session_inactivity_period = fields.Nested(StringInfoValue)

0 comments on commit 140f23e

Please sign in to comment.