-
Notifications
You must be signed in to change notification settings - Fork 65
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
[JEP 0028] Clearly define the smallest unit that is a "Jupyter Server" #31
Comments
Here is previous conversation around this section from PR #28
|
In my view there are two different (but related) discussions here:
I think the line between these two has been a bit blurry in this discussion. In my view:
Is this issue about pt. 1, pt. 2, or both? |
Thanks @vidartf. These are some great discussion points. How would you answer the following question?
My answer is that the ServerApp shouldn't be "inherited" by other apps. Rather, it should only be extended using server extensions using a I don't think we should allow such extensions to "turn off" server handlers. Removing server handlers this way would lead to confusion around the server. If an extension needs to remove some service/handler, that indicates to me that it shouldn't be a core, promised service—we should make it an extension instead. I'm worried pt. 2 is a temporary patch that will introduce backwards incompatibility (or buggy future shims) later. |
I think we may want to distinguish between services and their handlers in this discussion. I view the handlers as the entities that expose a service to users (aka the "promise"). For example, w/o the content handlers the content service is not available to external applications. However, the content service is still useful from within the server for use from other services. This may have been what @rgbkrk was driving at regarding his "Core services should stick around..." comment. As such, I think we need to allow an ExtensionApp to disable handlers. If instead we wanted to have a "service composition" capability, I still think there needs to be a way to disable the handlers - unless we go down the road of a full blown micro services approach where access to the service is only available via handlers (which I don't think we want or need). Perhaps it might be helpful to first decide what "services" should be included the in server, then ask about their handlers (although I believe one could argue that all handlers should be able to be disabled). Looking at the services sub-package, entries that seem questionable are |
I agree that people shouldn't need to do that in order to get the capabilities they need. However, if that is the only way to achieve what they want, they will. Pt. 2 is mostly meant as an escape hatch for those cases where you can't do what you want from an extension/ExtensionApp.
(my emphasis added) If that is the selection criteria, then it will likely reduce down to only kernel/kernelspec and probably session handlers. We could possibly also solve this by layering: |
@vidartf and @kevin-bates Great stuff here! Thank you both for doing the deep dive and opening up this conversation. Let me think about this over the weekend and I'll post here again with some follow up thoughts. |
nudge ;) |
I think the smallest unit depends on who you are.
we have a few traitornado products that are logically decomposable into
smaller pieces.
- notebook: conf + extensions + contents + convert + specs + kernelspecs +
sessions + kernels
- nbviewer: conf + contents + convert + cache
- jupyterhub: conf + auth + env + services
- lab: notebook + js build
Some stuff we _still_ don't have natively, but basically all of those could
benefit from:
- search
- graph store
- localization (vs checked in translations)
- version control (or at least greater awareness)
- live API documentation
- general documentation serving
Getting to reuse more pieces across all of those would be really powerful:
- nbviewer + auth: often requested for a long time
- hub + js build: would ease some challenges we're seeing in serving more
tailored apps
- notebook + envs: spawn@home!
On the traits/tornado aspect: we have to do a lot of stuff ourselves, and
our stuff doesn't work like other peoples' stuff. People can't embed our
stuff. We can't easily embed other people's stuff (though async is helping).
The ASGI spec...
https://asgi.readthedocs.io
... came out of Django, but has seen good adoption across a broader swathe
of projects.
I'd love to do/see a breakdown of our products into this space, but would
be more (verifiably) composable. To achieve that, things like openapi, more
json schema, type checking, and even graphql, would help a lot.
We tend not to (need to) worry/measure _too_ much performance, but probably
should do more, at this sub-unit level, as it leaves other people to do it
when they integrate (or choose not to) our stuff.
Http/2 isn't great for the standalone case, because https, but would be
great in basically every other case... And we might be in the position to
encourage people to learn about https/certs, and even 2fa. But I don't see
some of this materializing in tornado.
So at the end of the day, smaller, more tested/quantified, more spec'ed,
more reusable units might be the answer, after you ask the second question
of " what do you want to do?"
Some things I've been researching:
- ASGI, schema, openapi:
- https://github.com/tiangolo/fastapi
GraphQL:
- https://github.com/tartiflette/tartiflette
- https://github.com/mirumee/ariadne
- http2:
- https://gitlab.com/pgjones/hypercorn
- perf/testing
- https://github.com/airspeed-velocity/asv
- https://github.com/locustio/locust
- https://github.com/HypothesisWorks/hypothesis
|
@bollwyvl these examples make a good point (that @kevin-bates and @vidartf were making too, I was just being stubborn 😆). It doesn't matter what we choose as the "smallest unit", someone will compose their own server with whatever handlers they want. We're doing it ourselves! Thanks, @kevin-bates for distinguishing handlers + services. You're right, blending them was causing an issue on my thinking. I think adding a
Thanks, @bollwyvl. I absolutely love all these ideas. We should chat over video to discuss further. Do you have time in the coming days to chat? This sounds like a complete rewrite of the jupyter_server codebase (though, I admit I haven't done enough research on these projects to be sure). I'm not opposed to that (actually I secretly would love this), but maybe that's something we do in parallel? Looking at tools like ASGI, schemas, and openapi, I bet we could quickly rebuild the jupyter_server from scratch and gain a lot of these things you mentioned. The separation of server and notebook allows us to develop this type of "new implementation of the server" and swap it out later without interruption for users (?), especially is this proves to be fruitful. I'd love to work on this with you (and anyone else). |
Closing due to inactivity. A lot of these ideas were picked up by jupyverse. |
From JEP 0028 (Jupyter Server):
Opening this issue for further discussion.
The text was updated successfully, but these errors were encountered: