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

feat(app): use PV to hibernate/resume sessions #1518

Merged
merged 19 commits into from
Sep 14, 2023

Conversation

m-alisafaee
Copy link
Contributor

@m-alisafaee m-alisafaee commented Jun 21, 2023

Adds a /notebooks/servers/<server_name> endpoint with PATCH method that accepts a state argument. Setting state to hibernated makes the server to go to hibernation and setting state to running resumes a hibernated server.

When hibernating a server:

  • spec.jupyterServer.hibernated is set to True in the server's manifest file.
  • Server's sidecar is queried (via JSON RPC) and some info about the repository (commit, branch, dirty, synched) along with hibernation date are added to server's annotations.
  • If querying the sidecar fails, all those annotation except hibernation date will be empty.
  • By seeing spec.jupyterServer.hibernated set to true, Amalthea scales server's statefulset to have 0 replicas and set's server's state to hibernated.

When resuming:

  • spec.jupyterServer.hibernated is set to False in the server's manifest file.
  • All server's hibernation annotations are cleared (including the date)
  • By seeing spec.jupyterServer.hibernated set to false, Amalthea scales server's statefulset to have 1 replica.

It also adds a renku.io/hibernatedSecondsThreshold annotation to the server that shows when a hibernated sessions will be deleted.

Related: SwissDataScienceCenter/amalthea#344

/deploy #persist extra-values=notebooks.userSessionPersistentVolumes.enabled=true,notebooks.amalthea.image.repository=renku/amalthea,notebooks.amalthea.image.tag=db70f80ef1983d49a1b167faa57d02d9d8b9554f renku-ui=leafty/2526-feature-persistent-sessions

@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 June 21, 2023 00:31 — with GitHub Actions Inactive
@RenkuBot
Copy link
Contributor

You can access the deployment of this PR at https://renku-ci-nb-1518.dev.renku.ch

@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 June 27, 2023 14:59 — with GitHub Actions Inactive
@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 July 5, 2023 10:05 — with GitHub Actions Inactive
Seems this cause the service to crash on startup
@leafty leafty temporarily deployed to renku-ci-nb-1518 August 29, 2023 08:07 — with GitHub Actions Inactive
@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 August 29, 2023 09:24 — with GitHub Actions Inactive
@olevski olevski self-requested a review August 29, 2023 09:34
olevski
olevski previously approved these changes Aug 29, 2023
renku_notebooks/api/notebooks.py Outdated Show resolved Hide resolved
@m-alisafaee m-alisafaee changed the title feat(app): use pv to persist sessions feat(app): use PV to hibernate/resume sessions Aug 31, 2023
@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 August 31, 2023 14:54 — with GitHub Actions Inactive
@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 September 5, 2023 14:39 — with GitHub Actions Inactive
* feat(app): use amalthea 0.9.1
@m-alisafaee m-alisafaee temporarily deployed to renku-ci-nb-1518 September 8, 2023 08:15 — with GitHub Actions Inactive
@olevski olevski self-requested a review September 8, 2023 08:54
@m-alisafaee m-alisafaee merged commit 8101029 into master Sep 14, 2023
12 of 13 checks passed
@m-alisafaee m-alisafaee deleted the pitch/session-persistence branch September 14, 2023 05:43
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.

4 participants