Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

feat: Add KeyPairResourcePolicy.max_session_lifetime #583

Merged
merged 10 commits into from
Apr 25, 2022

Conversation

achimnol
Copy link
Member

resolves lablup/backend.ai-internal#46

@achimnol achimnol added this to the 22.03 milestone Apr 21, 2022
@achimnol achimnol self-assigned this Apr 21, 2022
@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #583 (87681dd) into main (4bcbb8e) will decrease coverage by 0.03%.
The diff coverage is 27.35%.

@@            Coverage Diff             @@
##             main     #583      +/-   ##
==========================================
- Coverage   48.51%   48.48%   -0.04%     
==========================================
  Files          53       53              
  Lines        9125     9127       +2     
==========================================
- Hits         4427     4425       -2     
- Misses       4698     4702       +4     
Impacted Files Coverage Δ
src/ai/backend/manager/config.py 63.73% <ø> (ø)
src/ai/backend/manager/scheduler/dispatcher.py 27.09% <ø> (ø)
src/ai/backend/manager/idle.py 28.97% <24.21%> (-1.56%) ⬇️
src/ai/backend/manager/server.py 57.53% <25.00%> (ø)
src/ai/backend/manager/api/context.py 68.29% <66.66%> (ø)
src/ai/backend/manager/models/resource_policy.py 68.75% <75.00%> (+0.20%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bcbb8e...87681dd. Read the comment docs.

@achimnol achimnol marked this pull request as draft April 21, 2022 09:34
@achimnol
Copy link
Member Author

TODO: add a timer to periodically check expired sessions

* Now we can naturally declare an intrinsic checker: SessionLifetimeChecker
* Removed duplicate codes in different checkers by this refactoring!
  (such as policy cache)
* Now all checkers are run inside a single read-only transaction.
* If a checker decides to terminate a session, remaining checkers are safely skipped.
@achimnol achimnol marked this pull request as ready for review April 21, 2022 16:10
@achimnol achimnol requested a review from adrysn April 21, 2022 16:11
Copy link
Member

@adrysn adrysn left a comment

Choose a reason for hiding this comment

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

I found an error in SessionLifetimeChecker. Other parts seem to be working well in my test environment.

Copy link
Member

@adrysn adrysn left a comment

Choose a reason for hiding this comment

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

Tested and LGTM.

@adrysn adrysn merged commit 74bfaf4 into main Apr 25, 2022
@adrysn adrysn deleted the feature/max-session-lifetime branch April 25, 2022 01:19
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants