{"_id":"@dciangot/jupyterlab-custom-kernel","name":"@dciangot/jupyterlab-custom-kernel","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.2":{"name":"@dciangot/jupyterlab-custom-kernel","version":"0.0.2","description":"An extension to manage Kernelspecs from JupyterLab","keywords":["jupyter","jupyterlab","jupyterlab-extension","ipython","kernel"],"homepage":"https://github.com/dciangot/jupyterlab-custom-kernel","bugs":{"url":"https://github.com/dciangot/jupyterlab-custom-kernel/issues"},"license":"BSD-3-Clause","main":"lib/index.js","types":"lib/index.d.ts","style":"style/index.css","repository":{"type":"git","url":"https://github.com/dciangot/jupyterlab-custom-kernel"},"scripts":{"build":"jlpm run build:lib && jlpm run build:labextension:dev","build:all":"jlpm run build:lib && jlpm run build:labextension","build:labextension":"jupyter labextension build .","build:labextension:dev":"jupyter labextension build --development True .","build:lib":"tsc","build:prod":"jlpm run build:lib && jlpm run build:labextension","clean":"jlpm run clean:lib","clean:all":"jlpm run clean:lib && jlpm run clean:labextension","clean:labextension":"rimraf ksmm/labextension","clean:lib":"rimraf lib tsconfig.tsbuildinfo","eslint":"eslint . --ext .ts,.tsx --fix","eslint:check":"eslint . --ext .ts,.tsx","install:extension":"jupyter labextension develop --overwrite .","prepare":"jlpm run clean && jlpm run build:prod","watch":"run-p watch:src watch:labextension","watch:labextension":"jupyter-labextension watch .","watch:src":"tsc -w"},"dependencies":{"@jupyterlab/application":"^3.2.3","@jupyterlab/coreutils":"^5.2.3","@jupyterlab/launcher":"^3.2.3","@jupyterlab/services":"^6.2.3","@rjsf/bootstrap-4":"^3.2.1","@rjsf/core":"^3.2.1","@types/react-jsonschema-form":"1.7.6","core-js":"^3.21.1","react":"^17.0.2","react-bootstrap":"2.0.0-beta.2","react-dom":"^17.0.2","react-jsonschema-form":"1.8.1"},"devDependencies":{"@jupyterlab/builder":"^3.0.0","@popperjs/core":"^2.9.2","@types/lodash":"^4.14.168","@types/react":"17.0.11","@types/react-bootstrap":"^0.32.25","@typescript-eslint/eslint-plugin":"^2.27.0","@typescript-eslint/parser":"^2.27.0","eslint":"^7.27.0","eslint-config-prettier":"^6.10.1","eslint-plugin-jsdoc":"^22.0.0","eslint-plugin-prettier":"^3.1.2","eslint-plugin-react":"^7.18.3","mkdirp":"^1.0.3","npm-run-all":"^4.1.5","prettier":"2.2.1","rimraf":"^3.0.2","typescript":"~4.1.3"},"resolutions":{"**/@types/react":"17.0.11"},"sideEffects":["style/*.css"],"jupyterlab":{"extension":true,"outputDir":"jupyterlab-custom-kernel/labextension","discovery":{"server":{"managers":["pip"],"base":{"name":"ksmm"}}}},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2021 Quansight\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","_id":"@dciangot/jupyterlab-custom-kernel@0.0.2","dist":{"shasum":"cd741c8f663c7e1c7d5401f1cff153ff78f53d07","integrity":"sha512-13a3sHTGaxdRad7ehryJZlAX+jcpJ0aVVb3b22tmNK4eakPJEOsw16qxJtneGMO7sk2BVP8nAfIc7Yc/OET4Ng==","tarball":"https://registry.npmjs.org/@dciangot/jupyterlab-custom-kernel/-/jupyterlab-custom-kernel-0.0.2.tgz","fileCount":28,"unpackedSize":88362,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDD1ySVLQzExu5UNlEUmWxnUw9seadR8oZV4/2i89ui1AiEA/1reFw/2M+iejAvt4iSubIaZR/aLDNA88AZUVyX3zSI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDjZKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJTQ/+LYkhdMf0nc7ghDJ3GsymJftjNqCK01JWZwkRcgg1N5SfjKyj\r\nlIOqrbAtoVhGDfUi6h0qFSRihXbgJSQpwdpPRsAgRr4lnH2MTaxqzglg85+C\r\nK9qLdfz/a2am/PDxTerReisL3ARsi8RLSg04T5yFIBBWPNf+9urnsz0XDiLH\r\nBYl9Ts5oTdunxd7uBA3XxJMWLmSlOmrOaJOEM392hSa7fF8NWBB1jUiar9rX\r\nNhopLxAfTryPe1SmIih27fyzB7hOjl/KPjCLsXqz7AzvOHIW3LrVufPhOwG7\r\nCp3OU3BCiUQc3FF+TS6i7vAbO69S4UCPD2G/DKgxr2psKZJZEVOniMbn1Kmf\r\nt6VbvnKwvgGeT8yh/H45JhCHUsXRoRVca5I7EgMuXRm+lHfLYVhbz6b46idT\r\nDpjd0gZ4IU8U0AQNszbvx/G76x7Z4CcoQCgoRhSroL4Dwq51p0A4nAIg99ZQ\r\nQ8Eft152kE8UEOMMzvz4024ve0/MMCzsmGBNV36cyBDs7WpruCehkzA/tgwL\r\nJf6bM8ekKsT5PZtbyHvTYNXEmQHaq3n19JdQIX+UbyxbARz3PfYhpyz9unow\r\neXXlyz3gCJ65E/NC5fLZfmHA6uOjmbyPfDdt/R76J5iZeDIWQPczw66ij9I/\r\nJ2rdTLZwgG9gX7MFU7znTQejhjE4Pd0+w+w=\r\n=5ZHJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dciangot","email":"diego.ciangottini@gmail.com"},"directories":{},"maintainers":[{"name":"dciangot","email":"diego.ciangottini@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/jupyterlab-custom-kernel_0.0.2_1678653002562_0.6900354881703241"},"_hasShrinkwrap":false}},"time":{"created":"2023-03-12T20:30:02.488Z","0.0.2":"2023-03-12T20:30:02.784Z","modified":"2023-03-12T20:30:02.987Z"},"maintainers":[{"name":"dciangot","email":"diego.ciangottini@gmail.com"}],"description":"An extension to manage Kernelspecs from JupyterLab","homepage":"https://github.com/dciangot/jupyterlab-custom-kernel","keywords":["jupyter","jupyterlab","jupyterlab-extension","ipython","kernel"],"repository":{"type":"git","url":"https://github.com/dciangot/jupyterlab-custom-kernel"},"bugs":{"url":"https://github.com/dciangot/jupyterlab-custom-kernel/issues"},"license":"BSD-3-Clause","readme":"# Kernel Specification Manager JupyterLab Extension\n\n> This JupyterLab Extension allows users to manage Kernelspecs from within JupyterLab.\n\n![](screenshots/home_screen_ss.png)\n\n`ksmm` is a temporary name, originally standing for `Kernelspec Manager` and currently ships:\n\n- Kernelspec creation based on parametrized templates.\n- Kernelspec Editing: name, attributes.\n- Kernel Duplication. \n- Kernel Deletion.\n\n## Context\n\nOn 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.\n\nThis currently requires to create a new Kernelspec for jupyter using the command line which can be a tedious and complicated task.\n\nModifying existing Kernelspec also does not always works as they are cached on a per notebook.\n\nThis 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 to _too much_ of the internal details.\n\n## Install Kernelspecs Templates\n\nYou will need to install some [Kernelspec templates](#about-kernelspec-templates).\n\n```bash\nmake install-kernelspecs\n```\n\nThis will install the `python-template-1` Kernelspec example located in the examples folder into your system environment.\n\n## Install from a Release\n\nEnsure you have JupyterLab 3.1+, and then run this command the ksmm extension inside your current JupyterLab environment.\n\n```bash\npip install --upgrade ksmm\n```\n\n## Develop\n\nUse the provided `environment.yaml` to install the conda environment.\n\n```base\nconda deactivate && \\\n  make env-rm && \\\n  make env\nconda activate ksmm\n```\n\n```python\n# Install the server and frontend in dev mode.\nmake install-dev\n```\n\n```python\n# In terminal 1, Start the jupyterlab.\n# open http://localhost:8234?token=...\nmake jlab\n```\n\n```python\n# In terminal 2, start the extension building in watch mode.\nmake watch\n```\n\nWhen making changes to the extension you will need to issue a `jupyter labextension build`, or, start `jlpm run watch` in the root of the repository to rebuild on every changes. You do not need to restart or rebuild JupyterLab for changes on the frontend extensions, but do need to restart the server for changes to the Python code.\n\n## About Kernelspec Templates\n\nYou system adminstrator can create Kernelspect 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.\n\n<img src=\"screenshots/parameters_ss.png\" width=\"400\" />\n\nWhen you will click on the `Create Kernelspec` button, a new Kernespec will be created.\n\nThis is an example of such a Kernelspec template. The `metadata/template/tpl` stanza should contain a [Json Schema](https://json-schema.org) compliant structure. You can browser the [react-jsonschema-form](https://rjsf-team.github.io/react-jsonschema-form) for examples.\n\nYou can use the `metadata/template/mapping` stanza to create visual mappings (e.g. `Small` will be mapped to `102400`). The `example/python-template-1` contains an example. To install that example template in your environment, you need to run `jupyter kernelspec install ./examples/python-template-1` (add `--user` to install in your user space).\n\n<details>\n  <summary>Click to view the kernelspec example.</summary>\n\n```json\n{\n  \"argv\": [\n    \"python\",\n    \"-m\",\n    \"ipykernel_launcher\",\n    \"-f\",\n    \"{connection_file}\",\n    \"--cache-size={cache_size}\",\n    \"--matplotlib={matplotlib}\"\n  ],\n  \"display_name\": \"Python 3.8 Template 1\",\n  \"language\": \"python\",\n  \"metadata\": {\n    \"template\": {\n      \"tpl\": {\n        \"argv\": [\n          \"python\",\n          \"-m\",\n          \"ipykernel_launcher\",\n          \"-f\",\n          \"{connection_file}\",\n          \"--cache-size={cache_size_map}\",\n          \"--matplotlib={matplotlib}\",\n          \"--logfile={logfile}\",\n          \"--Kernel._poll_interval={poll_interval}\"\n        ],\n        \"display_name\": \"Python cache_size {cache_size_map} matplotlib {matplotlib}\"\n      },\n      \"parameters\": {\n        \"poll_interval\": {\n          \"type\": \"number\",\n          \"minimum\": 0.01,\n          \"maximum\": 1,\n          \"multipleOf\": 0.01,\n          \"title\": \"Kernel pool interval in seconds\",\n          \"default\": 0.01\n        },\n        \"cache_size\": {\n          \"type\": \"integer\",\n          \"title\": \"Set the size of the cache\",\n          \"default\": \"Medium\",\n          \"enum\": [\n            \"Small\",\n            \"Medium\",\n            \"Big\"\n          ]\n        },\n        \"matplotlib\": {\n          \"type\": \"string\",\n          \"title\": \"Configure matplotlib for interactive use with the default matplotlib backend\",\n          \"default\": \"widget\",\n          \"enum\": [\n            \"auto\", \"agg\", \"gtk\", \"gtk3\", \"inline\", \"ipympl\", \"nbagg\", \"notebook\", \n            \"osx\", \"pdf\", \"ps\", \"qt\", \"qt4\", \"qt5\", \"svg\", \"tk\", \"widget\", \"wx\"\n          ]\n        },\n        \"logfile\": {\n          \"type\": \"string\",\n          \"title\": \"Set the path for the logfile\",\n          \"default\": \"/tmp/kernel.out\"\n        }\n      },\n      \"mapping\": {\n        \"cache_size_map\": {\n          \"cache_size\": {\n            \"Small\": \"102400\",\n            \"Medium\": \"512000\",\n            \"Big\": \"1048576000\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n</details>\n\n## General Settings\n\n![](screenshots/general_settings_ss.png)\n\n## Launch Arguments\n\n![](screenshots/launch_args_ss.png)\n\n## Release\n\nTo publish a release, you need to manually bump the version number of the [package.json](https://github.com/deshaw/ksmm/blob/main/package.json) file, this this diff for example.\n\n```diff\n {\n   \"name\": \"@deshaw/jupyterlab-ksmm\",\n-  \"version\": \"0.1.4\",\n+  \"version\": \"0.1.5\",\n   \"description\": \"An extension to manage Kernelspecs from JupyterLab\",\n   \"keywords\": [\n     \"jupyter\",\n```\n\nPleas follow [Semantic Versioning](https://semver.org/spec/v2.0.0.html) rules when bumping the version number.\n\nCommmit and push your changes, then run the following comamand which clean, build and push the needed artifact into the [PyPi Ksmm project](https://pypi.org/project/ksmm) (ensure you have been given the needed authorization for that).\n\n```bash\nmake publish\n```\n\nAt some point, it would be interesting to use the [https://github.com/jupyter-server/jupyter_releaser](juypyter-releaser) tool (tracked in [#81](https://github.com/deshaw/ksmm/issues/81)).\n\n## History\nThis was created by the [D. E. Shaw group](https://www.deshaw.com/) in conjunction with [Quansight](https://www.quansight.com/).\n\n<p align=\"center\">\n    <a href=\"https://www.deshaw.com\">\n       <img src=\"https://www.deshaw.com/assets/logos/blue_logo_417x125.png\" alt=\"D. E. Shaw Logo\" height=\"75\" >\n    </a>\n</p>\n\n\nWe love contributions! Before you can contribute, please sign and submit this [Contributor License Agreement (CLA)](https://www.deshaw.com/oss/cla).\nThis CLA is in place to protect all users of this project.\n","readmeFilename":"README.md"}