Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rest: add max inactivity period for interactive sessions to info endpoint #599

Merged

Conversation

giuseppe-steduto
Copy link
Member

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

Addresses reanahub/reana-client#657

Copy link
Member

@audrium audrium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works nicely! I left couple of small comments how it could be potentially improved.
Can you please modify the PR/commit messages to use closes instead of addresses since the PR is not properly linked to the issue in the kanban board. I had to dig a bit to find it

@@ -455,6 +455,17 @@
},
"type": "object"
},
"maximum_interactive_session_inactivity_period": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you modified the OpenAPI specification you have to call the generate_openapi_spec.py script to publish these changes to reana-commons (and create another PR there)

@@ -108,6 +108,7 @@ def info(user, **kwargs): # noqa
}
"""
try:
ui_config = REANAConfig.load("ui")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered injecting inactivity period value through Helm templates similarly as it is done for REANA_KUBERNETES_JOBS_MAX_USER_TIMEOUT_LIMIT?. Now it's a bit strange to get it from the UI configmap

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it looks indeed like a way cleaner solution!

"type": "string"
},
"value": {
"type": "string"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this field could have a None value it should include "x-nullable": true flag similarly as for kubernetes_max_memory_limit field

Please not that after this change reana-client-go swagger specs will have to be regenerated

"REANA_SESSION_MAX_INACTIVITY_PERIOD", "forever"
)
if _reana_session_max_inactivity_period_env == "forever":
REANA_SESSION_MAX_INACTIVITY_PERIOD: Optional[str] = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small suggestion: perhaps it would be better to keep a long and descriptive name and use REANA_INTERACTIVE_SESSION prefix for this value so that it wouldn't be confused to other type of sessions reana might have? WDYT?

@@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be StringNullableInfoValue because it might containt None value

Copy link
Member

@audrium audrium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice now. The only two missing things now are to

  1. update the r-commons PR with the missing x-nullable option
  2. and to update the reana-client-go PR accordingly.

@mdonadoni
Copy link
Member

Works well, but this needs to be rebased!

@codecov-commenter
Copy link

Codecov Report

Merging #599 (9becd8d) into master (cf1ecd5) will increase coverage by 0.03%.
The diff coverage is 80.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #599      +/-   ##
==========================================
+ Coverage   59.12%   59.15%   +0.03%     
==========================================
  Files          32       32              
  Lines        3227     3232       +5     
==========================================
+ Hits         1908     1912       +4     
- Misses       1319     1320       +1     
Impacted Files Coverage Δ
reana_server/config.py 80.53% <75.00%> (-0.16%) ⬇️
reana_server/rest/info.py 83.78% <100.00%> (+0.45%) ⬆️

…oint

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

Closes reanahub/reana-client#657
@mdonadoni mdonadoni merged commit c459270 into reanahub:master Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

interactive session: notify user of auto-closure
4 participants