-
Notifications
You must be signed in to change notification settings - Fork 37
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
Support custom culling logic through hooks (like Spawner's pre_spawn_hook etc) #25
Comments
This comment has been minimized.
This comment has been minimized.
found this issue while looking for a similar solution to KubeSpawner's PreStop hook, actually needing this for the project I am working on right now. |
Hi, I have a similar use case: In our Jupyterhub deployment we have the possibility of assigning users to nodes with GPU, which are a "scarce" resource. For this reason, we would like to have different timeouts depending on which resources the users have booked, e.g. letting sessions expire after 2h since last_activity for nodes with GPUs and 6h for nodes using only CPU. I was thinking about customizing the should_cull https://github.com/jupyterhub/jupyterhub-idle-culler/blob/main/jupyterhub_idle_culler/__init__.py#L238 with a configurable callable which takes as inputs the user and the server objects and returns a boolean. Does it make any sense? I can work on a PR in case you find it useful |
Hi, We would like to cull servers based on profile. That will be great! |
I have the exact case of @rccern. We would like to cull pods for some JHub profiles faster. Is there any workaround for this? |
+1 from me as well! Would be great to have this functionality. |
Proposed change
Just like the JupyterHub Spawner and JupyterHub Authenticator classes have various hooks that can be used to take various actions, I think it could make sense to expose some hooks to the JupyterHub idle culler.
I don't have a need for this personally, but reflecting on #24 adding
--cull-admin-users
I felt it could be relevant to allow for some custom logic to play a role in the decision to cull a user server or a JupyterHub user identity.Who would use this feature?
Anyone that would want to make culling decisions based on user state, such as belonging to a certain group or similar.
(Optional): Suggest a solution
We add hooks that we can configure using traitlets that are given some information of relevance and where their return value could influence culling decisions. I'm not sure what hooks would make sense.
Action points
Related issues / PRs
The text was updated successfully, but these errors were encountered: