Skip to main content

An extension to manage Kernelspecs from JupyterLab

Project description

Kernel Specification Manager JupyterLab Extension

Name

ksmm is a temporary name, originally standing for Kernel Spec Manager Manger

This Jupyter Extension allows users to edit specific components of their IPython Kernels from within Jupyter.

Current Features:

  • Kernel Editing: name, attributes.
  • Kernel Duplication.
  • Kernel Deletion.

Not implemented yet:

  • "New" Kernel Additions.

Goal

On large distributed systems, it is common to wish to parametrize kernels and chose 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 to too much of the internal details.

The current goal would be to provide an editor for kernelspec that would given a kernelspec template like the following.

{
  "argv": [
    "slurm", "run", "--mem={mem}", "--cpu={cpu}", "python3.8", "-m", "ipykernel"
  ],
  "display_name": "Python 3.8 {mem}/{cpu}",
  "params": {
    "mem": ["100G", "500G", "1T"],
    "cpu": { "min": 1, "max": 300}
  }
}

Generate a kernelspec modification UI with a Dropdown for the memory with available values, and for example a slider for the CPU.

This would let non-technical user in for example JupyterHub to quickly modify Kernelspecs.

Running from Source

Use the provided environment.yaml to install the conda environment.

conda deactivate && \
  make env-rm && \
  make env
conda activate ksmm
# Install the server and frontend in dev mode.
make install-dev
# In terminal 1, Start the jupyterlab.
# open http://localhost:8234?token=...
make jlab
# In terminal 2, start the extension building in watch mode.
make watch

Installing the Server Extension

pip install ksmm

This will install the extension inside the current JupyterLab Environment. This is typically the latest release from the main branch.

When 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.

Screenshots

Below are screenshots from the usage of the application.

Home Screen

General Settings

Launch Arguments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ksmm-0.0.5.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ksmm-0.0.5-py3-none-any.whl (5.7 MB view details)

Uploaded Python 3

File details

Details for the file ksmm-0.0.5.tar.gz.

File metadata

  • Download URL: ksmm-0.0.5.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for ksmm-0.0.5.tar.gz
Algorithm Hash digest
SHA256 973b866c35463de0847f2558c39cd4c234b4e4511710d17688f2b4a07bfb7185
MD5 1cdb5baddba0d6a7444a055d7081be6f
BLAKE2b-256 f6e3ac4e11b3e5b8ea263d653a3f4f97a0aa14449f847e8ba89855c0be5460f6

See more details on using hashes here.

File details

Details for the file ksmm-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ksmm-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

File hashes

Hashes for ksmm-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f6cd1f63be7021d435952bc491f9d5bcc595bcb9d6163a1b4084513378201026
MD5 af64cef90c320053fd5e30361263092a
BLAKE2b-256 697b175d6cc1ff5f96d21298e7911bf2d3aca2b3f664f399ac539936168a135d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page