posit-dev / posit-dev/positron
Share kernels between Positron and Quarto
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 4.3k
- Forks
- 184
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 195
Description
Positron and Quarto both use Jupyter kernels to run code, but those kernels are discrete sets. Positron uses the Kallichore supervisor to run its kernels, and Quarto has a built-in Jupyter client and kernel daemon that power its usage:
https://quarto.org/docs/advanced/jupyter/kernel-execution.html#daemonization
One way we could integrate these systems better would be to have them share kernels. This would help achieve the following goals:
- Consistency between behavior in the IDE and behavior during render
- Consistency in environment selection and settings
- Improved performance and memory use
- Reduced duplication of execution paths with fewer idiosyncratic ways to run the code
This could look something like this:
- A single kernel session exists per Quarto doc, just like a single kernel session exists per notebook file. Like other Positron kernel sessions, it is supervised by Kallichore.
- Quarto is made aware of the session, and uses it to run code for the document; its
nbclientinstance connects to the Positron kernel rather than its own kernel daemon. - Positron negotiates cell executions with Quarto (and perhaps delegates them to Quarto). Because Quarto is handling the execution, the kernels will receive e.g. the Quarto document options when running cells.
- Because Quarto is performing cell executions, results are exactly the same as though they were obtained during a Quarto render.
- Positron receives cell execution output (as an iopub subscriber) and displays it in its own UI.
Connected to:
- #2866
- #3676
- #5640
- #6675
(from conversations at posit::conf and elsewhere)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the Kallichore supervisor design and Quarto’s Jupyter kernel daemon documentation, then review connected issues #2866, #3676, #5640, and #6675. Done requires an agreed integration design that shares one supervised kernel session per Quarto document, preserves Quarto execution behavior, and exposes results in Positron.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100