-
Notifications
You must be signed in to change notification settings - Fork 336
Transition to Kernel Provider model for kernel management #90
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
Comments
I absolutely love this. I think we should move forward. I'm happy to help with reviewing/contributing, just let me know. I think the most important thing we need to document is a list of traits and configurables that change as we go. This will obviously break a bunch of KernelSpec configuration in a backward-incompatible way. This is fine as long as we give a clear path to migrating. |
Sounds good @Zsailer - thanks for the input. The KernelSpec configuration (i.e., I'll start implementing this via a WIP PR shortly. |
Great. I was thinking more along the lines that... |
I hope to get some free time soon to contribute with at least reviews and user testing this initiative.
|
@echarles - hello again! I apologize, I should have been more explicit in the quoted text above. I meant to imply that we should only support async kernel management. My statement has no bearing on the kernels themselves - they would not change - nor should anything we do in the server introduce any new requirements on kernel implementations themselves. Yes, with the different kernel providers, we won't just be launching local processes. Instead, some kernel startups may require 5 to 10 seconds and we need to accommodate much better throughput in the server. We also shouldn't assume the server is servicing a single user - so the currently synchronous kernel startups (and their lifecycle management) is something that must be made "asynchronous". Besides the fact that its an obvious evolutionary step. 😄 |
Hey @kevin-bates, how's this work coming? Excited to see this PR 😉 |
Thanks for asking @Zsailer! I've been side-tracked by other work lately, but... It's really a matter of bringing over jupyter/notebook#4837. However, due to the amount of work just to bring this in, and despite my earlier statement of providing a WIP PR "shortly", I was hoping to get further discussion (and buy-in) from the community before committing to this work. I figure folks can look at jupyter/notebook#4837 to see what is happening since this would be that same exercise. I also want to make sure there's a level of tolerance for this because its essentially refactoring the entire kernel management framework. So if 100% backward compatibility is expected, that's probably not going to happen. For example, traitlets is something @takluyver didn't really want to carry forward in the provider framework. That said, I believe this is good for the community long term as it paves a way for multiple custom kernel (and spec) managers to be in play simultaneously. Something that can't happen today. I hope you understand my hesitancy here. If that's how things work (via a PR) then I'll be happy to focus on this. |
I have been travelling through the repos and PRs... regarding remote/async feature but was not able to have a good picture on the next step for me to compose a features rich set of branches and kick that UI to try the remote/async with the new kernels management.
@kevin-bates @Zsailer From this, it sounds like the step is still to inject features in notebook and backport it to server. To make life easier, would it make sense to skip
|
@echarles - yes, that's the complete intention. The idea behind jupyter/notebook#4837 was to bring jupyter/notebook#4170 up to a current code base - which was nearly a year old - relative to Notebook, with the sole intention of making the transition easier to Server. Once the jupyter_server momentum picked up, between those two PRs, there was never an intention of adding Kernel Providers to Notebook. The update was merely to use a transitive property approach to getting Kernel Providers into Server. My main concern, as I tried to note previously, is that Kernel Providers have not had a lot of discussion - yet there have been TWO PRs already. And, given the commitment, I don't want to waste time moving them again when there has been ample opportunity for discussion previously. Regarding async support, my PR to introduce async support into the provider framework has not been merged, but I believe it can be. We wanted to get an idea of what other applications would need to do should they NOT also want to move to async. After thinking about this last night, I think having Jupyter Server use a different kernel management framework is the right approach as this framework is more agile in the sense that parties are free to introduce new providers. Also, things like metrics will vary between providers as @minrk implies in this comment. Where careful thought needs to occur is in defining the interface (in the form of an abstract base class) that providers need to implement and that acts as the "bridge" between system-related functionality and custom, provider-specific behavior. If the discussion would be better "seeing" the code relative to server (although, in this area of code, its identical to notebook sans a couple import paths), then I'm happy to cherry-pick the various commits into server. Thank you for being interested in this and helping stoke the discussion! |
@kevin-bates I am a bit frustrated to only bring questions and not real code, but this is all I can do for now upon maybe end-user testing. Anyway, good to know that focus is only server, not notebook. I see here 2 points:
Do you see those 2 points coupled? Otherwise, why not merging Side question: Do you need Async support to run your gateway experiments? (at the end, I am interested in remote kernels on k8s). |
Kernel Providers and async support are not coupled. However, introducing kernel-mgmt that does not use async, then switching it for async could introduce issues where kernel providers are not async, while the server is expecting them to be async. As a result, I'd prefer to do both at the same time - although we could probably manage transition to async via version requirements management.
Read concerns above. I want to make sure the community is on board here. It's a commitment and I'd like some agreement, at a minimum, to the degree of backwards compatibility that is acceptable. For example, applications that have overridden either
No - although, again, the implementations need to be in-sync relative to async (see what I did there 😄). Down the road, we definitely need async kernel management, period, but the code in the master branches for each of the remote kernel providers is relative to synchronous management (since the async PR for kernel-mgmt has not been merged). |
@kevin-bates You probably know this, but... I wouldn't perceive the lack-of-response as lack-of-interest. Rather, I think very few people feel qualified to review this proposal. Those that feel qualified to review it lack the time (as this proposal takes a lot of thought). That said, I think Jupyter Server is the perfect place to experiment with this kind of thing. In earlier conversations about Jupyter Server, it seemed that backwards compatibility was important. In more recent conversations, I've been told that we should not let backwards compatibility hold us back. Let's make Jupyter Server a better server component, and it will make it more enticing for projects to switch to Jupyter Server (we just have to be ready to help people make the switch later 😄). |
Thanks for the response @Zsailer! I completely agree that Server should be an idea of where we want to go and its tough to get places if we have to be 100% B/C. I would absolutely help folks get going in the new framework - no worries there. Ok, I'll stoke up the coals and get this thing moving once I reach stopping points on other tasks (should be a day or two). |
Great! No rush, @kevin-bates. The urgency earlier in the thread was from my own excitement for this work 😉 |
@Zsailer I can come as listener on the first meeting October 10th 8AM Pacific. Hopefully, I can try out as end-user by that time to give more feedback. For this, it would be great to have a recipe to follow and prepare a working jupyter distribution with the branches we are targeting. Any hint on this? (I can take back my repo/branch odyssey, but I am sure it is easier than it looks with hints from the source guys). |
Thanks @willingc ❤️ |
Thank you for adding me in, I need to be following this and helping wherever I can. |
* Add docker-local mode * fix function call * clean up defaults and tests * add handling of test mode * fix type
Closing, since this is now implemented as kernel provisioners in jupyter client. |
Some time ago, @takluyver introduced a proposal for a new mechanism of kernel management. This framework essentially supplants
jupyter_client
, splitting it intojuptyer_kernel_mgmt
andjupyter_protocol
leading to a better separation of functionality. I have spent some time over the past several weeks working onjuptyer_kernel_mgmt
and migrating Enterprise Gateway's remote kernel support into this framework as a proof of concept.jupyter_kernel_mgmt
, among other things, introduces the notion of a Kernel Provider. Kernel Providers essentially take on the responsibility of discovery, launch and lifecycle management of a kernel. With this approach, multiple third-party application Kernel Providers can co-exist within the same server. This was not possible before since there could only be one override of KernelSpecManager (for discovery) and KernelManager (for launch and lifecycle management). This is a huge win relative to jupyter-server and allowing third-party innovations!The base implementation provides two kernel providers out of the box - the
KernelSpecProvider
(for kernelspec-based kernels) and theIPykernelProvider
for kernels running in the typical python/conda-installed kernels.@takluyver has also provided examples of an ssh-based and docker-based providers, while I have migrated EG's kubernetes, yarn, and docker implementations as proof of concepts.
We would likely ONLY support async kernels (work in progress) and enable the ability to use parameterized kernels (work in progress), among other things.
I would like to move forward with incorporating these changes - similar to what has been proposed in Notebook (although the plan would be that this framework only get used in jupyter_server) - but wanted to run this past the project first.
The text was updated successfully, but these errors were encountered: