-
Notifications
You must be signed in to change notification settings - Fork 338
Ensure kernel points to live kernel connection when starting remote kernels #10573
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
Open
DonJayamanne
wants to merge
6
commits into
main
Choose a base branch
from
issue9865
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f6c931a
Swap controllers once kernel starts
DonJayamanne 16f70b4
Fix IW tests
DonJayamanne 036bfca
Enable only in Insiders
DonJayamanne a8d8f5c
Better error mesage
DonJayamanne 0f73fa5
Fix unhandled errors
DonJayamanne b37d24c
Add logging
DonJayamanne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 @@ | ||
Ensure the kernel picker points to the live Kernel Connection when starting a new remote kernel. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,62 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { KernelConnectionMetadata } from './types'; | ||
|
||
export class KernelConnectionMetadataProxy { | ||
public get kernelModel() { | ||
return 'kernelModel' in this.metadata ? this.metadata['kernelModel'] : undefined; | ||
} | ||
public get interpreter() { | ||
return this.metadata.interpreter; | ||
} | ||
public get kernelSpec() { | ||
return 'kernelSpec' in this.metadata ? this.metadata['kernelSpec'] : undefined; | ||
} | ||
public get kind() { | ||
return this.metadata.kind; | ||
} | ||
public get baseUrl() { | ||
return 'baseUrl' in this.metadata ? this.metadata['baseUrl'] : undefined; | ||
} | ||
public get serverId() { | ||
return 'serverId' in this.metadata ? this.metadata['serverId'] : undefined; | ||
} | ||
public get id() { | ||
return this.metadata.id; | ||
} | ||
private constructor(public metadata: KernelConnectionMetadata) { | ||
this.metadata = metadata; | ||
} | ||
public update(metadata: KernelConnectionMetadata) { | ||
this.metadata = metadata; | ||
} | ||
public toString() { | ||
return JSON.stringify(this.toJSON()); | ||
} | ||
public toJSON() { | ||
return { | ||
kernelModel: this.kernelModel, | ||
kernelSpec: this.kernelSpec, | ||
interpreter: this.interpreter, | ||
kind: this.kind, | ||
baseUrl: this.baseUrl, | ||
serverId: this.serverId, | ||
id: this.id | ||
}; | ||
} | ||
static isWrapped( | ||
metadata: KernelConnectionMetadata | KernelConnectionMetadataProxy | ||
): metadata is KernelConnectionMetadataProxy { | ||
if (metadata instanceof KernelConnectionMetadataProxy) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
static wrap(metadata: KernelConnectionMetadata): KernelConnectionMetadata { | ||
if (metadata instanceof KernelConnectionMetadataProxy) { | ||
return metadata; | ||
} | ||
return new KernelConnectionMetadataProxy(metadata) as unknown as KernelConnectionMetadata; | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.