Skip to content

Kernels (Architecture)

Peng Lyu edited this page Jul 22, 2022 · 17 revisions

Pre-requisites

Overview

The core functionalities offered by the Kernels component are

How does it work end to end

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 launch jupyter notebook|lab and connect to the kernels through Jupyter Server API.
    • 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
  • 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
image
Clone this wiki locally