Package: ksmm
Kernel Specification Manager JupyterLab ExtensionThis JupyterLab Extension allows users to manage Kernelspecs from within JupyterLab.ksmmis a temporary name, originally standing forKernelspec Managerand currently ships:Kernelspec creation based on parametrized templates.Kernelspec Editing: name, attributes.Kernel Duplication.Kernel Deletion.ContextOn large distributed systems, it is common to wish to parametrize kernels and choose parameters for a remote environment, like number of CPU, Memory limit, presence of GPU. Or even set other parameters in environment variables.This currently requires to create a new Kernelspec for jupyter using the command line which can be a tedious and complicated task.Modifying existing Kernelspec also does not always works as they are cached on a per notebook.This is an attempt to provide a UI based on json-schema and templates, for end users to easily create, duplicate and modify kernelspec, without being exposed totoo muchof the internal details.RequirementsJupyterlab >= 4.0InstallpipinstallksmmNext, you will need to install someKernelspec templates. As an example, start by adding thepython-template-1kernelspec:jupyterkernelspecinstall./examples/python-template-1/To list existing kernelspecs, runjupyter kernelspec list .ContributingDevelopment installNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab_pyflyby directory# Install package in development modepipinstall-e.# Link your development version of the extension with JupyterLabjupyter-labextensiondevelop.--overwrite# Rebuild extension Typescript source after making changesjlpmrunbuildYou can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.# Watch the source directory in one terminal, automatically rebuilding when neededjlpmrunwatch# Run JupyterLab in another terminaljupyterlabWith the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).By default, thejlpm run buildcommand generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:jupyterlabbuild--minimize=FalseAbout Kernelspec TemplatesYou system adminstrator can create Kernelspec templates for you. As a user, if you click on the picker icon of a template card, you will be prompted for the Kernelspec parameters.When you will click on theCreate Kernelspecbutton, a new Kernespec will be created.This is an example of such a Kernelspec template. Themetadata/template/tplstanza should contain aJson Schemacompliant structure. You can browser thereact-jsonschema-formfor examples.You can use themetadata/template/mappingstanza to create visual mappings (e.g.Smallwill be mapped to102400). Theexample/python-template-1contains an example. To install that example template in your environment, you need to runjupyter kernelspec install ./examples/python-template-1(add--userto install in your user space).Click to view the kernelspec example.{"argv":["python","-m","ipykernel_launcher","-f","{connection_file}","--cache-size={cache_size}","--matplotlib={matplotlib}"],"display_name":"Python 3.8 Template 1","language":"python","metadata":{"template":{"tpl":{"argv":["python","-m","ipykernel_launcher","-f","{connection_file}","--cache-size={cache_size_map}","--matplotlib={matplotlib}","--logfile={logfile}","--Kernel._poll_interval={poll_interval}"],"display_name":"Python cache_size {cache_size_map} matplotlib {matplotlib}"},"parameters":{"poll_interval":{"type":"number","minimum":0.01,"maximum":1,"multipleOf":0.01,"title":"Kernel pool interval in seconds","default":0.01},"cache_size":{"type":"integer","title":"Set the size of the cache","default":"Medium","enum":["Small","Medium","Big"]},"matplotlib":{"type":"string","title":"Configure matplotlib for interactive use with the default matplotlib backend","default":"widget","enum":["auto","agg","gtk","gtk3","inline","ipympl","nbagg","notebook","osx","pdf","ps","qt","qt4","qt5","svg","tk","widget","wx"]},"logfile":{"type":"string","title":"Set the path for the logfile","default":"/tmp/kernel.out"}},"mapping":{"cache_size_map":{"cache_size":{"Small":"102400","Medium":"512000","Big":"1048576000"}}}}}}General SettingsLaunch ArgumentsReleaseTo publish a release, you need to manually bump the version number of thepackage.jsonfile, see this diff for example.{"name": "@deshaw/jupyterlab-ksmm",-  "version": "0.1.4",+  "version": "0.1.5","description": "An extension to manage Kernelspecs from JupyterLab","keywords": ["jupyter",Pleas followSemantic Versioningrules when bumping the version number.HistoryThis was created by theD. E. Shaw groupin conjunction withQuansight.We love contributions! Before you can contribute, please sign and submit thisContributor License Agreement (CLA).
This CLA is in place to protect all users of this project.