-
Notifications
You must be signed in to change notification settings - Fork 294
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
Pass resource to track Kernel Metadata against a resource #4760
Conversation
@@ -147,8 +147,7 @@ export class KernelSelector implements IKernelSelectionUsage { | |||
notebookMetadata?: nbformat.INotebookMetadata, | |||
disableUI?: boolean, | |||
cancelToken?: CancellationToken, | |||
ignoreDependencyCheck?: boolean, | |||
ignoreTrackingKernelInformation?: boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the hacks & assumptions.
Just because some of these methods were called doesn't mean the kernel was changed.
We now track the kernel against the URI where these methods are called & kernel information is actually changed/set. No assumptions.
@@ -86,9 +86,7 @@ export class InterpreterPackages { | |||
const packageAndVersions = new Map<string, string>(); | |||
// Add defaults. | |||
interestedPackages.forEach((item) => { | |||
if (!packageAndVersions.has(item)) { | |||
packageAndVersions.set(item, 'NOT INSTALLED'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have been hashed (no harm, it was a noop)
|
||
// Select a new kernel using the connection information | ||
const kernel = await this.kernelSelector.selectJupyterKernel( | ||
options.identity, | ||
options.resource, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug fix.
@@ -183,6 +183,7 @@ export class IPyWidgetScriptSource implements ILocalResourceUriConverter { | |||
if (!this.notebook) { | |||
this.notebook = await this.notebookProvider.getOrCreateNotebook({ | |||
identity: this.identity, | |||
resource: this.identity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is resource
the same as identity
? Or does it not matter in this context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't matter in this context (basically use the best we have, majority of the time identify = resoruce
, except in interactive window when you open it without a correspoding py file or when you have multiples.
|
||
// 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, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this then get updated later? Just making sure that if a server is preloaded that the undefined here was going to stay even when we start up the actual notebook later when opening the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ChangeKernel should trigger the update it looks like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we start the actual notebook, then we'd be connecting to some kernel, hence at that point with Jupyter
we'd change the kernel.
And with Raw, we'd end up starting a different kernel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. passing undefined
is ok for auto start.
Addresses the comments from here #4742 (comment)