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
JupyterHub integration #6451
JupyterHub integration #6451
Conversation
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
@ian-r-rose, do you mind finishing this PR with the connection lost handling? |
d0c8e9f
to
d3226c1
Compare
@ian-r-rose, ping! |
@blink1073 Sure, I can do that. |
Thanks! ❤️ |
I'm currently fixing up some stuff on the Python side -- still not completely running yet. |
@@ -204,6 +204,14 @@ def load_jupyter_server_extension(nbapp): | |||
# Must add before the root server handlers to avoid shadowing. | |||
web_app.add_handlers('.*$', handlers) | |||
|
|||
# If running under JupyterHub, add more metadata. | |||
if hasattr(nbapp, 'hub_prefix'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check doesn't appear to be working, at least not in my testing. At the time the server extension is loaded, it doesn't seem like the hub_prefix
traitlet has been set.
labhubapp.py
seems to be working correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm concerned that we won't actually be able to deprecate LabHubApp
. Without it, I'm not sure that JupyterHub spawners can easily configure the LabApp
specific traitlets (which is a problem I'm having while testing this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you saw this state. I'm seeing it working fine locally...
restart the server.
3c3059c
to
a33f18d
Compare
Thanks @ian-r-rose! Not sure about the CI failure, Usage has been flakey... |
@ian-r-rose I may be wrong, but I don't think this problem should happen if traits are added in appropriate config files. Traits in config files should get loaded by the respective classes. The problem here is that traits passed to the main application being launched by the CLI don't get directed to the classes to which they belong unless those classes are explicitly added to main applications' |
@Zsailer My grasp of traitlet loading is definitely pretty shaky, but I was having trouble getting that to work when testing this. My thinking was this: if JupyterHub is using the default |
Hmm, yeah, configuring an extension itself is really what we want, not an app. If you wanted to configure an app then you should be using that app directly. |
In my ideal world, I think all extensions would be classes, and not use the load_serverextension magic function but something like an import path to the class as the extension load mechanism. |
restart the server.
…erlab into jhub-integration
@ian-r-rose, the error was the fact that we were implicitly relying on the hub extension in our application extension. I added a fallback to the default connectionLost implementation. |
JS failure is unrelated, and the windows one passed, so in she goes. Thanks again @ian-r-rose! |
I'm not sure about the history behind the More complex extensions would benefit from an import path to class mechanism. jupyter-server/jupyter_server#48 is a compromise of those two solutions. It uses some tricky logic to hijack Should we drop the |
@ian-r-rose Ah yes. You're right. I was thinking ahead to a world where hub is launching jupyter_server |
Wieeeeeeeeeeeee sooo much excellent work going on ❤️ 🎉! This is awesome!! |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion. |
References
Fixes #6428.
cf jupyterhub/jupyterlab-hub#84
cf #6399
Code changes
Absorbs
labhubapp
andjupyterlab-hub
into the main application.User-facing changes
No longer need to provide any additional config other than setting
c.Spawner.default_url = '/lab'
, and no need to installjupyterlab-hub
.Backwards-incompatible changes
Deprecated
SingleUserLabApp
.