-
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
Replace tornado options with traitlets #83
base: main
Are you sure you want to change the base?
Conversation
I haven't reviewed the changes yet, but I support moving to Traitlets. It'll help with adding extensibility, which has been discussed in a few issues including:
Since we can let people install their own extensions, and initialise them in jupyterhub-idle-culler by passing the parent object to them. |
Absolutely love it! |
This... looks ready to go? What else is missing? |
@yuvipanda I marked this as draft because I threw it together in a hotel lounge while on travel and then haven't been able to get back to it. But I thought it might be helpful to at least get a version of it out there as a proposal for people to look at and see if there was anything obviously missing in terms of making sure the CLI looked compatible with the old one, etc. I did have a question about logging and I see #84 has popped up, related. We could try to reconcile that here or do it as a later pull request (one thing at a time...?). In any case I am interested in whether folks think this is a better move than going with argparse. I think traitlets has the upside of configuration and familiarity within the JupyterHub domain. |
We don't need to do everything in one go as long as we don't introduce any major problems, and resolve any issues before a release. I'm in favour of getting this in and dealing with logging in a separate PR. |
Use traitlets logger with JupyterHub format
for more information, see https://pre-commit.ci
What was bothering me here ended up just being the default log level when you switch to traitlets is warning, not info (which is what idle culler was using before). Leaving that be just didn't sit right with me, and it was fairly simple to just make the traitlets logging work so I went ahead with that. Sorry for the hold up. |
Should address #84 |
Here is a pass at what replacing tornado options with traitlets might look like. Also,
default
decorator to set the defaultcull_every
totimeout // 2
.Using traitlets would provide a familiar way for JupyterHub admins to introduce additional logic in
handle_server()
, through a hook that could be defined via service configuration file. Related to issue #44 and issues referenced therein.Note this PR doesn't try to introduce a hook for that kind of configurable logic, it just changes tornado options to traitlets. Can we discuss: