-
Notifications
You must be signed in to change notification settings - Fork 292
Kernels (Architecture)
Rich Chiodo edited this page Jul 29, 2022
·
17 revisions
Pre-requisites
- Please read Terminology
The core functionalities offered by the Kernels component are
- Kernel discovery and launching. More details in general overview and code architecture
- Discovery. Responsible for finding Jupyter kernel specs on user's machine, connecting to remote jupyter servers and turning Python Environments into Jupyter specs.
- Kernel launcher. Launching the selected Jupyter kernel with proper environment.
- Execution. Handling the messages between the extension and Jupyter kernel.
- Raw vs Jupyter kernels. There are two types of connections we create.
Below graphs is a bird view of where kernels are loaded from, how they are launched and what's being exposed once kernels are launched and connected:
- The kernel component can list all kernels found from multiple sources. The source of kernels limits how a kernel can be launched.
- Globally installed kernel specs are started as separate processes by default and the extension will connect to it through
zeromq
.- If
zeromq
is not available/enabled, then we would attempt to launchjupyter notebook|lab
and connect to the kernels through Jupyter Server API.
- If
- Jupyter servers created outside of the extension can be connected and communicated through Jupyter Server API.
- Lastly, Python environments can be used as "kernel" (see details), we would install
ipykernel
to the Python environment and start the kernel process.- There might be Jupyter kernel specs installed in Python environments, they can be started like the globally installed kernel specs
- Before starting kernels from Python environments, we need to activate the environment first to ensure the kernel process have all the required environment variables loaded
- Globally installed kernel specs are started as separate processes by default and the extension will connect to it through
- Once the kernels are started, we can communicate with the kernels through the same library and protocol (Jupyter Messaging Protocol). The message handling component is also exposed publicly to allow features to be built on top, including
- Update notebook cell outputs through
NotebookController
- Handle IPyWidgets
- Handle Debugging
- Exposed to 3rd party extensions
- Update notebook cell outputs through
- Contribution
- Source Code Organization
- Coding Standards
- Profiling
- Coding Guidelines
- Component Governance
- Writing tests
- Kernels
- Intellisense
- Debugging
- IPyWidgets
- Extensibility
- Module Dependencies
- Errors thrown
- Jupyter API
- Variable fetching
- Import / Export
- React Webviews: Variable Viewer, Data Viewer, and Plot Viewer
- FAQ
- Kernel Crashes
- Jupyter issues in the Python Interactive Window or Notebook Editor
- Finding the code that is causing high CPU load in production
- How to install extensions from VSIX when using Remote VS Code
- How to connect to a jupyter server for running code in vscode.dev
- Jupyter Kernels and the Jupyter Extension