-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate notebook session management from positron-notebook-controllers extension into runtime session service #2671
Comments
A big difference between the notebook UI and console UI is that in the notebook UI there are far fewer guarantees around when a user attempts to start a session, shutdown a session, restart a session, or change runtimes. A user can:
Each of these can happen at any moment, meaning that we need safety between each possible state of: starting, shutting down, and restarting. This is what I'd expect to happen in each of case:
|
I'm going to be tackling this as a step toward improving notebook runtime stability, including the following issues: |
…e runtime services (#5335) This is in preparation for writing unit tests for the runtime session service since I intend on making changes to it for #2671. The main addition is the `positronWorkbenchInstantiationService` function, which sets up a test instantiation service with a bunch of test dummies, following upstream's `workbenchInstantiationService` function. I also refactored our existing unit tests to use the new function. #### QA Notes 1. Positron unit tests should pass. They can be run locally with: ```sh ./scripts/test-positron.sh ``` 2. There are a few minor code changes to runtime-related code, mainly to fix leaked disposables, which could use a review.
The aim of this PR is to improve the stability of the runtime session service, with a slight focus on notebooks. This is another step toward #2671. I've also added an extensive suite of unit tests for the runtime session service, for two reasons: 1. Some of the issues we're seeing with notebooks are intermittent and therefore tricky to reproduce without tests. 2. I wanted to ensure that I didn't break any existing behavior with these changes as well as more planned changes to add notebook-runtime methods to the extension API.
The goal of this PR is to stop relying on the positron-notebook-controller extension's notebook session service tracking the running notebook sessions and instead use the existing `positron.runtime.getNotebookSession` method. It's another step toward removing the notebook session service altogether. Related to #2671. ### QA Notes Tests should continue to pass and opening/closing/restarting/executing notebooks should feel stable in general.
…ion service (#5688) Another step toward removing the notebook session service entirely (#2671). ### QA Notes This shouldn't change any behavior, although I did fix some edge cases where the context was not set correctly. Opening a notebook, restarting it, closing and reopening it should all work. The restart button should be deactivated when the session is exited.
This PR adds notebook kernels for language runtimes in the main thread. Before this, runtime kernels lived in the `positron-notebook-controllers` extension. Having kernels in the main thread gives us more control over runtime session management. Addresses #2671. Should also address #4224 because of the way we manage notebook runtime sessions. Some changes were required in the runtime session service in order to make this possible. ### Release Notes #### New Features - Positron's notebook kernels now live in the main thread rather than in an extension. They should also be more stable. Since this was a big change, the feature can be disabled via the `positron.runtimeNotebookKernel.enable` setting. #### Bug Fixes - Cancelling the ipykernel installation modal no longer breaks kernel selection (#4224). ### QA Notes I'll run E2E tests against this branch. Playing around with notebooks should also feel stable. Should also address #4224.
For QA: Main thread notebook kernels should be active by default in the latest release. We should try a bunch of different operations in notebooks and ensure that they all work as before. |
Verified Fixed
Test scenario(s)Unable to detect any differences in notebook functionality with this release. Link(s) to TestRail test cases run or created: |
The
NotebookSessionService
class duplicates a bunch of code from the runtime session service, and really doesn't need to exist. We should bring what's required into theRuntimeSessionService
and expose the rest via the API.Ultimately, we may want the entirety of the positron-notebook-controllers extension to live in Positron. It might be worth trying to tackle that at the same time.
In order to satisfy the requirements for restoring/starting/shutting down notebook sessions in the runtime session service, we may want to split the current
startNewRuntimeSession
function into separate functions for console sessions vs notebook sessions, since (a) they require different sets of arguments (console takesruntimeId
, notebook takeslanguageId
andnotebookUri
), and (b) they require different functionality (notebook gets the preferred runtime for the language, and keys onnotebookUri
instead ofruntimeId
).We may also do the same for
selectLanguageRuntime
.The text was updated successfully, but these errors were encountered: