-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for renaming kernelspecs on the fly.
This change adds support for kernelspec managers to be configured with renaming patterns that they will apply to the kernelspecs they serve. That, in turn, will be used a future change to allow multiple kernel spec managers to be used simultaneously without their kernel spec names colliding. This functionality is provided using a mixin that can be inherited by a subclass of KernelSpecManager in order to add this renaming support. Additionally, we provide canned subclasses of both KernelSpecManager and GatewayKernelSpecManager with this new renaming feature built into them. To use the new renaming feature with a remote Kernel Gateway, the user would add the following snippet to their Jupyter config: ``` c.ServerApp.kernel_spec_manager_class = 'jupyter_server.gateway.managers.GatewayRenamingKernelSpecManager' ``` ... meanwhile, an example of using the renaming functionality with local kernelspecs, can be achieved by the user adding the following snippet to their config: ``` c.ServerApp.kernel_spec_manager_class = 'jupyter_server.services.kernelspecs.renaming.RenamingKernelSpecManager' ``` This change also fixes a pre-existing issue with the GatewayMappingKernelManager class where the `default_kernel_name` value was not set until *after* the first request to `/api/kernelspecs`, resulting in the first such call getting the wrong default kernel name (even though subsequent calls would have gotten the correct one). I confirmed that this issue with the default kernel name was already present in the codebase on the main branch before this commit.
- Loading branch information
Showing
8 changed files
with
589 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.