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

Integrate jupyterhub-idle-culler with KubeIngressProxy #42

Open
droctothorpe opened this issue Dec 13, 2021 · 5 comments
Open

Integrate jupyterhub-idle-culler with KubeIngressProxy #42

droctothorpe opened this issue Dec 13, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@droctothorpe
Copy link

Proposed change

last_activity data for routes will be available when using configurable-http-proxy as JupyterHub does by default, but if for example traefik-proxy is used as it is in the TLJH distribution, no such data will be available.

We use JupyterHub + KubeIngressProxy + the nginx ingress controller. Based on the docs, I suspect that the last_activity is never updated, so notebooks are culled even when they're active.

Are there any plans to integrate these two capabilities? If not, would you be open to a PR to that effect (assuming it's possible)?

Thanks!

@droctothorpe droctothorpe added the enhancement New feature or request label Dec 13, 2021
@welcome
Copy link

welcome bot commented Dec 13, 2021

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@manics
Copy link
Member

manics commented Dec 14, 2021

The idle culler is agnostic to the underlying spawner. Assuming you're right about the cause it sounds like the fix needs to be in KubeIngressProxy not this repo. Is that your understanding? If so I'll transfer the issue to KubeSpawner.

@droctothorpe
Copy link
Author

Thanks for getting back to me, @manics!

KIP just creates the ingress resources. The nginx ingress controller is what's actually responsible for managing the proxy, and it's completely oblivious to the concept of last_activity, since that's a very JH / configurable-http-proxy convention.

I guess what I'm wondering if it makes sense to either modify jupyterhub-idle-culler or create a discrete culler that's more generic / isn't contingent on the use of configurable-http-proxy.

Some approaches that come to mind:

  1. Evaluating idleness using a daemon on the notebook container that terminates the container locally instead of relying on a centralized service.
  2. Determining idleness by checking HTTP requests frequency via prometheus.

Totally understand if this is out of scope. We're pretty unique in our adoption of KIP I suspect.

@droctothorpe
Copy link
Author

Hm, alternatively, why not hit the /api/status endpoints of the notebooks? I think that's what KF does: https://github.com/kubeflow/kubeflow/blob/master/components/notebook-controller/pkg/culler/culler.go.

@manics
Copy link
Member

manics commented Dec 14, 2021

There are some past discussions on supporting plugins or configurable hooks:

No progress yet, but maybe your use-case could be a driver?

If you haven't already seen https://discourse.jupyter.org/t/which-is-the-correct-way-to-cull-idle-kernels-and-notebook/8123/7 it explains some of the complexity of idle detection?

Did you see https://discourse.jupyter.org/t/jupyterhub-amalthea/12208 (posted today)? Might be worth seeing how they implemented idle culling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants