-
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
Additions to how it works, and a simple "keep alive" strategy #55
Comments
New version of my script# This script was based on the idea described by Min RK in
# https://github.com/jupyterhub/jupyterhub-idle-culler/issues/55
#
import time
print(
"This script can ensure jupyterhub-idle-culler isn't going to "
"stop this server due to inactivity by having an busy kernel "
"that also generates some output regularly.\n"
)
hours = int(input(" Enter hours of activity: "))
print(f"\nGenerating kernel output every minute for a {hours} hours:\n")
# loop over all hours and print 60 dots for each
for hour in range(hours):
print(f"Hour {hour}: ", end="")
for min in range(60):
time.sleep(60)
print(".", end="")
print()
print("Done generating kernel output!") |
Further investigationJupyterHub reports activity regularly, either via the They are just relying on the the primitive report of If we want jupyterhub-idle-culler to make better decisions, we need to have jupyterhub-idle-culler get better information, or to redefine what "last activity" means. Currently all it gets is "last activity" from the user server, which doesn't exclude that a user has a running kernel that doesn't emit any output or similar.
|
@consideRatio @minrk glad i found this issue, and i'm subscribing to this issue as we're about to deploy an undergraduate research hub here at berkeley. one of the concerns we have is the idle culler killing "long running jobs", with "long running" currently defined as "longer than a few hours". :) |
+1 For more options, most importantly, the options for an end-user to have more control. The python code above is what I suggest to our students if they ask, but it's less than ideal, as this could stop culling for an infinite amount of time. The best solution for us would be a ui-element within the JupyterLab where a User could specify a (limited) "keep alive time" that the culler would respect (read via some Lab REST endpoint perhaps). After the time is over, the User would have to log in again and renew its keep alive time or let other mechanism take over the control over his environment lifetime. I could help with the backend implementation of this, but I'm not familiar with the JupyterLab frontend. |
Right now, I think the best we have is jupyter-keepalive, which provides UI for keeping things alive for a specified amount of time. Applying a limit is tricky if it's going to be anything other than jupyterhub-idle-culler's We could extend |
jupyter-keepalive is kind of what we are looking for, but I am not a big fan of relying on the activity record in general. I think it only works okay when no other policies are necessary. To softly prevent infinite runtimes, more control would be great. One would have to create a reasonable api and configuration options for the two systems to work together. |
You definitely don't need to rely on the activity record, if you don't want to. That's just what this "idle culler" does - cull idle servers. You can definitely collect whatever information is most relevant to you to decide when/how to shutdown servers, e.g. requesting a server lifetime at spawn time, with a prolongation API, etc. If you can define the sources of information you'd like to use to make the shutdown decisions, we can help you figure out how to shutdown servers based on that information. |
I learned a few things from @minrk on gitter (February 1, 2023 6:36 PM) that I want to ensure is captured in this repo.
My takeaway points from what Min said
Gitter discussion
Me:
Min:
Me:
Min:
The text was updated successfully, but these errors were encountered: