-
Notifications
You must be signed in to change notification settings - Fork 295
Kernel Discovery (architecture)
Don Jayamanne edited this page Jan 21, 2022
·
5 revisions
- Please read the Wiki page Terminology
- Please read the Wiki page General overview of Kernel Discovery & Execution in Jupyter for a general (non-technical) overview on:
- How and where are kernels specifications are found/located
- How are kernels (processes) launched
Mermaid Diagrams
flowchart TB
A[NotebookController] --> B & C;
B["ILocalKernelFinder.listKernels()"];
C{Remote jupyter\n connection setup?} --> G
G["IRemoteKernelFinder.listKernels()"];
flowchart TB
A["ILocalKernelFinder.listKernels()"] --> C;
subgraph Local Kernels
C["localKernelFinder.listKernels()"] --> E & F;
E["LocalKnownPathKernelSpecFinder.listKernels() \n (list global non-python kernelspecs)"];
F["LocalPythonAndRelatedNonPythonKernelSpecFinder.listKernels() \n (list kernelspecs inside Python environments & list Python interpreters as kernelspecs)"] --> G & H;
G["LocalKnownPathKernelSpecFinder.listKernels() \n (list python kernelspecs)"];
H["IInterpreterService \n Use this to fetch list of all interpreters, their details (such as paths to look for kernelspecs)"];
end
flowchart TB
A[NotebookController] --> B;
subgraph Remote Kernels
B["IRemoteKernelFinder.listKernels()"] --> C;
C["remoteKernelFinder.listKernels()"] --> E & F & G & H;
E["IJupyterSessionManagerFactory.create() \n (Create Jupyter Session for @jupyterlabs/services)"];
F["IJupyterSessionManager.getKernelSpecs()"];
G["IJupyterSessionManager.getRunningKernels()"];
H["IJupyterSessionManager.getRunningSessions() \n (To get information about running kernels)"];
end
- Local kernels are fetch in localKernelFinder.ts
- The above class fetches kernels using the two classes
- LocalKnownPathKernelSpecFinder This is responsible for discovering non-python kernel specs in known paths on disc.
-
LocalPythonAndRelatedNonPythonKernelSpecFinder
This is responsible for discovering kernel specs in the python environments and returning kernel specs that can be used to start Python Environments as kernels.
(again, please read pre-requisite section above)
This uses LocalKnownPathKernelSpecFinder to fetch Python Kernel specs on disc.
This uses
IInterpreterService
to get a list of all interpreters and find kernelspecs within the interpreter directory. Duplicate kernelspecs are removed here (e.g. if user installed Jupyter, then a kernelspec is registered, but we can just ignore most of them and just list a hand-crafted kernelspec for the Interpreter instead).
- Local kernels are fetch in remoteKernelFinder.ts
- Create a
IJupyterSessionManager
usingIJupyterSessionManagerFactory.create
(for the remote connection currently configured). - Get a list of kernel specs using
IJupyterSessionManager.getKernelSpecs()
- Get a list of running kernels from
IJupyterSessionManager.getRunningKernels()
- Get more information about the running kernels from
IJupyterSessionManager.getRunningSessions()
- 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