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

Jupyter notebook support #574

Merged
merged 51 commits into from
Feb 27, 2023
Merged

Jupyter notebook support #574

merged 51 commits into from
Feb 27, 2023

Conversation

amolenaar
Copy link
Contributor

@amolenaar amolenaar commented Jan 31, 2023

Add support for Jupyter notebooks

  • Since jupyter works for persistent sessions only, it's not needed to configure a read-only and backup image -> make readonly and backup non-required fields.
  • This setup works with (basic) k8s ingress routes. For openshift we need a different type of route.
  • host is "localhost"
  • No Metrics at the moment (can't automaticallty terminate idle session)
  • Harden the image (no ssh)
  • Memory and CPU usage are now similar to Capella's
  • Move jupyter image to capella-dockerimages repo -> Jupyter image capella-dockerimages#108
  • Remove openshift routes on container shutdown

Changes include:

  • Add a "Jupyter notebook" integration
  • readonly and backup docker images are optional
  • Jupyter notebooks are exposed via Ingress rules on k8s
  • On openshift clusters, jupyter endpoints are exposed via a custom domain

Postponed/to be picked up separately:

  • Create an abstraction for deploying guacamole jupiter and your favorite tool. -> later, maybe
  • The jupyter setup is pretty basic. It installs py-capellambse. We may want to provide more tooling out of the box -> let's see. Separate PR anyway.
  • Only one persistent session can be running per user at any time. You can't run both a capella and a jupyter session. That would be nice, I suppose. -> one per tool, separate PR
  • Logging may need some configuration

Requires: DSD-DBS/capella-dockerimages#108

@amolenaar amolenaar marked this pull request as draft January 31, 2023 16:04
@amolenaar amolenaar force-pushed the jupyter branch 6 times, most recently from 50c6704 to 1595a7c Compare February 9, 2023 13:30
@amolenaar amolenaar marked this pull request as ready for review February 9, 2023 13:31
Copy link
Contributor

@dominik003 dominik003 left a comment

Choose a reason for hiding this comment

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

Not fully finished with this PR yet as I still have to test it out and have to review the k8s.py but here are already my comments for the other files.
Many comments are related to the fact that you not only added jupyter as a tool but also provided a integration flag for it. I am not sure why this is needed and it feels like we can simply remove it, so I added a comment in all the files that would be affected by that (hopefully I didn't miss one).

CONTRIBUTING.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
backend/capellacollab/core/database/migration.py Outdated Show resolved Hide resolved
helm/templates/backend/backend.serviceaccount.yaml Outdated Show resolved Hide resolved
images/jupyter/Dockerfile Outdated Show resolved Hide resolved
images/jupyter/docker-entrypoint.sh Outdated Show resolved Hide resolved
@amolenaar amolenaar force-pushed the jupyter branch 2 times, most recently from c5889f9 to 453a745 Compare February 15, 2023 07:25
@MoritzWeber0
Copy link
Member

MoritzWeber0 commented Feb 15, 2023

If not done yet: Please test it in our OpenShift development cluster.

  • Test functionality in OpenShift development cluster

Copy link
Contributor

@dominik003 dominik003 left a comment

Choose a reason for hiding this comment

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

Finished the review of the k8s operator but as the backend is currently not starting I can't really test the jupyter sessions. So please fix the backend issue first.

helm/templates/backend/backend.serviceaccount.yaml Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
@amolenaar amolenaar force-pushed the jupyter branch 4 times, most recently from 6f78534 to 8b3747d Compare February 21, 2023 12:40
@amolenaar
Copy link
Contributor Author

If not done yet: Please test it in our OpenShift development cluster.

* [x]  Test functionality in OpenShift development cluster

Works.

Copy link
Member

@MoritzWeber0 MoritzWeber0 left a comment

Choose a reason for hiding this comment

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

  • Add release notes
  • Restructure / Add user documentation. Right now, it'd focused on Capella sessions.

@amolenaar amolenaar force-pushed the jupyter branch 2 times, most recently from 9128e5b to 734fb80 Compare February 24, 2023 08:26
Copy link
Member

@MoritzWeber0 MoritzWeber0 left a comment

Choose a reason for hiding this comment

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

Great addition, our list of supported tools starts growing 🥳

Makefile Outdated Show resolved Hide resolved
backend/capellacollab/sessions/operators/k8s.py Outdated Show resolved Hide resolved
backend/capellacollab/sessions/routes.py Outdated Show resolved Hide resolved
amolenaar and others added 24 commits February 24, 2023 15:28
We should already be there.
Let's raise an error if the expected port is not found.
So we can use routes on openshift to expose Jupyter to users.
Needed for Jupyter session in OpenShift.
Makes more sense, since it's jupyter specific.
So it's version is in line with the Capella version.
Not needed for jupyter notebooks, and as it turns out,
we also do not need it for our local (k3d) cluster setup.
They were separated in part, now the cut is even more clear.
Copy link
Member

@MoritzWeber0 MoritzWeber0 left a comment

Choose a reason for hiding this comment

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

Is ready for merge. However, I'd wait until DSD-DBS/capella-dockerimages#108 is merged.

Thanks again for the implementation, @amolenaar! 😃

@dominik003
Copy link
Contributor

:shipit:

@MoritzWeber0 MoritzWeber0 merged commit cac3124 into main Feb 27, 2023
@MoritzWeber0 MoritzWeber0 deleted the jupyter branch February 27, 2023 14:24
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.

3 participants