-
Notifications
You must be signed in to change notification settings - Fork 8
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
Unique kernel IDs #43
Comments
Yes, I like the idea of having a The answer to my question 1 would therefore be: JKM typically picks the ID when a new kernel is started, but the caller code can specify an ID (e.g. if it's restarting a kernel and wants to keep the same ID). @kevin-bates , as this is a topic that interests you, do you want to make a PR? Or we can discuss it more - I'm not sure that I've thought through all the details and implications yet. |
I think you meant to say that the provider picks the ID since the kernel manager returned from launch is used by the builtin providers. I know of some projects that want to be able to specify kernel-id on initial starts as well and so I think we can generally say that a specified kernel_id will be honored or starts or restarts. One concern I have is that because (I believe) restarts should use the same ID (as is the case today), I think providers are going to need to know (or should be informed so) that I don't mind creating a PR for this once the dust has settled. |
This came up on #42, and we wanted to spin out a separate issue. Questions include:
This is also going to play into a larger question about kernel discovery; I'll open a separate issue about that.
@kevin-bates responded to some of my questions already on #42:
I think we must retain the kernel id on restarts. The MappingKernelManager relies on this fact - otherwise it would remove the current slot and create a new slot for the new kernel manager. In addition, I believe kernel providers should be able to do what they want within their kernel manager, but the kernel-id, IMO, is the public key for identifying a kernel throughout its lifetime (where restarts are considered within its lifetime).
I think I mentioned this before, but I believe KernelFinder.launch() should take an optional kernel_id=None parameter. This parameter would also be honored on initial launch as well and the restarter would then use it during restarts: self.kernel_finder.launch(self.kernel_type, cwd, kernel_id=self.kernel_manager.kernel_id). (We'd want to extend KernelManager's initializer in a similar manner - with an optional kernel_id parameter.)
If these questions are directed at persisted sessions that get "revived" I think the id of the process is orthogonal to the id of the kernel. When/how is process id used by clients?
In EG, when a persisted session is "revived", for example if the server came down, and another started, EG does not restart the kernel process, but instead, re-establishes connection to the kernel process. It can do this because the kernel is remote and is (probably) still running.
If we want the server to be able to support active/active scenarios (which we plan to do for EG), retaining the kernel's id across restarts is paramount to that - otherwise restarts would require communicating the old and new kernel ids to other servers, etc. and I don't think we want to go there - especially since the current behavior is to retain the id.
I guess I'm not familiar enough with the direct kernel application approach. For applications like notebook and jupyter-server, the list of running kernels should come directly from the MappingKernelManager. Once (well, if) we add the notion of users and roles, we could then apply filtering on the results of the /api/kernels request.
The text was updated successfully, but these errors were encountered: