Skip to content
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

Select kernel does not put up the 'install ipykernel' message #5736

Closed
Tracked by #1122
rchiodo opened this issue May 3, 2021 · 14 comments
Closed
Tracked by #1122

Select kernel does not put up the 'install ipykernel' message #5736

rchiodo opened this issue May 3, 2021 · 14 comments
Labels
bug Issue identified by VS Code Team member as probable bug notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel)

Comments

@rchiodo
Copy link
Contributor

rchiodo commented May 3, 2021

Create a new virtual env
Open a notebook with 'Select Kernel' being shown at the bottom
Run a cell
Pick the new env
Make sure 'auto start' is enabled.

Nothing happens

It should ask you to install ipykernel.

@rchiodo rchiodo added the bug Issue identified by VS Code Team member as probable bug label May 3, 2021
@joyceerhl joyceerhl self-assigned this May 3, 2021
@joyceerhl joyceerhl added this to the May 2021 Release milestone May 3, 2021
@joyceerhl
Copy link
Contributor

This is what we're expecting to see, right?

image

This works in webview fwiw so likely related to notebook controller changes.

@rchiodo
Copy link
Contributor Author

rchiodo commented May 3, 2021 via email

@joyceerhl
Copy link
Contributor

Actually sorry this seems to be working for me following the repro steps above with a new conda environment:

image

Rich do you happen to have a log you can share?

@rchiodo
Copy link
Contributor Author

rchiodo commented May 3, 2021

errorlog.log

@joyceerhl
Copy link
Contributor

So I'll confess I don't have the most context on our kernel start logic, but I went through the codebase looking for any places that we were improperly passing disableUI: true. These two spots looked potentially iffy to me:

// Auto start the local kernels.
if (newKernel && !this.configuration.getSettings(undefined).disableJupyterAutoStart && this.isLocalLaunch) {
await newKernel.start({ disableUI: true, document }).catch(noop);
}

traceInfo(`Attempting to start a server because of preload conditions ...`);
// Check if we are already connected
let providerConnection = await this.notebookProvider.connect({
getOnly: true,
disableUI: true,
resource: undefined
});
// If it didn't start, attempt for local and if allowed.
if (!providerConnection && !this.configService.getSettings(undefined).disableJupyterAutoStart) {
// Local case, try creating one
providerConnection = await this.notebookProvider.connect({
getOnly: false,
resource: undefined,
disableUI: true,
localOnly: true
});
}

Rich's log doesn't have the log message from the second code snippet in it so I think that means the first one might be the culprit. The first one was also last touched in the kernelpush updates: #5565

@DonJayamanne
Copy link
Contributor

that we were improperly passing disableUI: true. These two spots looked potentially iffy to me:

I think this is correct

I think we should change this to perhaps have a state.
If dependency installation checks has been completed, then we need to re-run them.

Basically its a race condition, auto startup says don't display UI. But when you start running a cell, if the auto start has already started, then we just use that existing promise.
We were aware of this when we did this.
I recall the discussion around the Progress indicators as well. E.g. you'll never see any of the progress indicators for starting the notebook either (if you are in the small window).

I think a quick fix would be to re-check the dependencies based on some state.
Long term fix is to ensure we have the ability to display the progress indicators when user hits run & auto start is still in progress.

@rchiodo
Copy link
Contributor Author

rchiodo commented May 3, 2021

I remember having something that would switch the 'disableUI' flag as soon as somebody clicked a button. But that was long ago and it was for getting a jupyter server. I believe that's how we handled this before.

@DonJayamanne
Copy link
Contributor

DonJayamanne commented May 3, 2021

I think we'll need an object instead of a flag, so that when progress messages are being displayed, we can see the change in the state of the object & we can then create/display the UI.

However, the first issue - checking dependencies will still need to be addressed separately.
Generally that happens first, and its possible we've missed the ship on that, and might have to perform another check.

I think the best fix is:

  • Just disable auto start for native notebooks.
  • fix this in june (not even via a point fix)

As its not a bug, but a mere perf issue & i don't think it will be too bad, after all, we didn't have auto start in native notebooks for a while, hence we should be ok until next release.

Also better than making a lot of major changes to the code (that's used in webview/interactive), etc at the last minute.

@joyceerhl
Copy link
Contributor

My vote would be to defer fixing this to the June release if possible, as it doesn't seem to be a regression and a fix is risky (potentially impacts kernel startup and being able to run cells). I'm not sure we need to disable auto start at all for the May release. Am I missing something about this bug that would make it worth fixing sooner?

@DonJayamanne
Copy link
Contributor

I agree

@greazer greazer modified the milestones: May 2021 Release, June 2021 Release May 6, 2021
@joyceerhl
Copy link
Contributor

Autostart is disabled in main right now. We should turn that back on as part of fixing this bug.

@IanMatthewHuff
Copy link
Member

IanMatthewHuff commented May 6, 2021

Quick note when fixing this. This code should be reenabled as part of the fix:

// Auto start the local kernels.
// if (newKernel && !this.configuration.getSettings(undefined).disableJupyterAutoStart && this.isLocalLaunch) {
// await newKernel.start({ disableUI: true, document }).catch(noop);
// }

@joyceerhl joyceerhl removed their assignment Jun 4, 2021
@greazer
Copy link
Member

greazer commented Jun 4, 2021

Can wait until July.

@greazer greazer modified the milestones: July 2021, August 2021 Jul 30, 2021
@greazer greazer added the notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) label Aug 2, 2021
@greazer greazer modified the milestones: August 2021, old August 2021 Aug 9, 2021
@DonJayamanne
Copy link
Contributor

Make sure 'auto start' is enabled.

Closing in favor of #7903

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel)
Projects
None yet
Development

No branches or pull requests

5 participants