-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new Jupyter kernel supervisor (#4910)
This change adds a new and currently optional Jupyter kernel supervisor to Positron. When enabled, all R and Python kernels are run under a supervisor process (codenamed 'Kallichore'). This process is a native binary that takes care of the minutiae of kernel lifecyle management (process output, startup, shutdown, restart, status reporting, etc.). It also takes care of the low-level ZeroMQ socket connectivity and exposes a simple WebSocket based interface that proxies messages to and from the ZeroMQ sockets. ```mermaid graph TD R[Positron R Extension] -- Jupyter Adapter API --> ka[Kallichore Adapter] ka -- WebSocket --> k[Kallichore Supervisor] k -- ZeroMQ --> ark[R Jupyter Kernel - ark] py[Positron Python Extension] -- Jupyter Adapter API --> ka k -- ZeroMQ --> ipy[Python Jupyter Kernel - ipykernel] ``` The implementation is a drop-in replacement for the Jupyter Adapter and currently exposes an API that is fully compatible with the Jupyter Adapter; the only changes to the R and Python extensions are switches that determine which extension the Jupyter Adapter API is loaded from. The change is otherwise totally transparent to the R and Python extensions since they already are behind a layer of abstraction from the Jupyter protocol. The current plan of record is for the Jupyter Adapter to be fully deprecated in favor of this new supervisor when it reaches feature parity, stability, and performance goals. This will allow us to get rid of our troublesome ZeroMQ bindings in Node and will also improve stability and performance around session management. The goal of this PR is to start exposing the new supervisor to builds and to make it possible to start collaborating on work associated with the supervisor. While most everything works today with the new supervisor, there are a lot of edge cases that aren't finished yet, so the supervisor is disabled by default and will continue to be until it's ready to take over. Lint-level issues are aggregated here: #4912 ### QA Notes This change isn't ready for QA yet. It tries very hard to avoid touching any code outside the new adapter extension; the only thing worth testing is probably R and Python restarts.
- Loading branch information
Showing
97 changed files
with
8,554 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (C) 2024 Posit Software, PBC. All rights reserved. | ||
* Licensed under the Elastic License 2.0. See LICENSE.txt for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
//@ts-check | ||
|
||
'use strict'; | ||
|
||
const path = require('path'); | ||
const withDefaults = require('../shared.webpack.config'); | ||
|
||
module.exports = withDefaults({ | ||
context: __dirname, | ||
entry: { | ||
extension: './src/extension.ts', | ||
}, | ||
node: { | ||
__dirname: false | ||
}, | ||
externals: { | ||
'bufferutil': 'commonjs bufferutil', | ||
'utf-8-validate': 'commonjs utf-8-validate' | ||
} | ||
}); |
Oops, something went wrong.