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

Kernel selection UI #8866

Merged
merged 22 commits into from
Dec 11, 2019
Merged

Kernel selection UI #8866

merged 22 commits into from
Dec 11, 2019

Conversation

DavidKutu
Copy link

@DavidKutu DavidKutu commented Dec 2, 2019

For #8611

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Appropriate comments and documentation strings in the code
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated
  • Test plan is updated as appropriate
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)
  • The wiki is updated with any design decisions/details.

@codecov-io
Copy link

codecov-io commented Dec 3, 2019

Codecov Report

Merging #8866 into master will decrease coverage by 0.74%.
The diff coverage is 33.12%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8866      +/-   ##
==========================================
- Coverage   57.64%   56.89%   -0.75%     
==========================================
  Files         530      550      +20     
  Lines       27664    28957    +1293     
  Branches     4185     4376     +191     
==========================================
+ Hits        15946    16476     +530     
- Misses      10824    11581     +757     
- Partials      894      900       +6
Impacted Files Coverage Δ
...tascience-ui/native-editor/redux/reducers/index.ts 100% <ø> (+100%) ⬆️
...atascience/jupyter/liveshare/guestJupyterServer.ts 11.94% <ø> (ø) ⬆️
src/datascience-ui/react-common/locReactSide.ts 50% <ø> (+50%) ⬆️
src/client/datascience/types.ts 100% <ø> (ø) ⬆️
...tascience-ui/history-react/redux/reducers/index.ts 100% <ø> (+100%) ⬆️
...ascience/interactive-ipynb/nativeEditorProvider.ts 55.24% <0%> (ø) ⬆️
src/datascience-ui/native-editor/redux/actions.ts 11.62% <0%> (+11.62%) ⬆️
...ce/interactive-window/interactiveWindowProvider.ts 15.11% <0%> (ø) ⬆️
src/datascience-ui/history-react/redux/actions.ts 9.67% <0%> (+9.67%) ⬆️
...ence-ui/interactive-common/redux/reducers/types.ts 100% <100%> (ø)
... and 66 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1dc04c...f2caf13. Read the comment docs.

src/client/datascience/interactive-ipynb/nativeEditor.ts Outdated Show resolved Hide resolved
src/datascience-ui/interactive-common/mainState.ts Outdated Show resolved Hide resolved
src/datascience-ui/interactive-common/mainState.ts Outdated Show resolved Hide resolved
src/datascience-ui/native-editor/nativeEditor.tsx Outdated Show resolved Hide resolved
src/datascience-ui/native-editor/nativeEditor.tsx Outdated Show resolved Hide resolved
src/client/datascience/interactive-ipynb/nativeEditor.ts Outdated Show resolved Hide resolved
src/datascience-ui/history-react/redux/mapping.ts Outdated Show resolved Hide resolved
src/datascience-ui/interactive-common/mainState.ts Outdated Show resolved Hide resolved
src/datascience-ui/interactive-common/mainState.ts Outdated Show resolved Hide resolved
@rchiodo
Copy link

rchiodo commented Dec 4, 2019

});

We should probably have a test for changing the current kernel and making sure the UI updates. Ideally also for restart/interrupt as well.


Refers to: src/test/datascience/interactive-ipynb/nativeEditor.unit.test.ts:464 in 5cc2346. [](commit_id = 5cc2346, deletion_comment = False)

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

David Kutugata added 6 commits December 6, 2019 17:40
- moved the session event handling to jupyterSession.ts
- moved the server and kernel select dropdown to interactiveBase.ts
- added the kernel select UI to the interactive window
- added telemetry
- moved kernel selection UI to its own react component
- call the kernelSelector when pressing the UI
Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use existing Settings.JupyterServerLocalLaunch

};

export interface IFont {
size: number;
family: string;
}

export interface IKernelState {
jupyterServerStatus: ServerStatus;
uri: string;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jupyter server status can't be a subset of kernel state.
It needs to be the other way around.
Id rename this type to IServerState

@@ -283,6 +283,9 @@
"DataScience.loadingMessage": "loading ...",
"DataScience.fetchingDataViewer": "Fetching data ...",
"DataScience.noRowsInDataViewer": "No rows match current filter",
"DataScience.jupyterServer": "Jupyter Server",
"DataScience.noKernel": "No Kernel",
"DataScience.localJupyterServer": "local",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a dup, we need to use the existing setting Settings.JupyterServerLocalLaunch.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to keep this here, but use it only for display

private async selectKernel() {
const settings = this.configuration.getSettings();

if (settings.datascience.jupyterServerURI === localize.DataScience.localJupyterServer()) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if this was in a central location. Here we added a new localizable setting to match this value against.
Matching against localized settings in such a way to determine whether something is local or not seems flaky,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional change.

Copy link

@DonJayamanne DonJayamanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shoudnt we update UI after the kernel switch has been successfully made?

}

if (kernel && kernel.kernelSpec && this.notebook) {
let name = kernel.kernelSpec?.display_name;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kernel.kernelSpec? isn't necessary, as the if condition has ensured kernelSpec isn't undefined.

}).ignoreErrors();

// Also actually tell the kernel.
await this.notebook.setKernelSpec(kernel.kernelSpec);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should't this be done first, before we update the UI?
What if this fails.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's probably better. Let me try that. I think I can eliminate the status update then too.


In reply to: 356777545 [](ancestors = 356777545)

@rchiodo rchiodo merged commit 6cadda5 into master Dec 11, 2019
@rchiodo rchiodo deleted the davidkutu/kernel_selection_UI branch December 11, 2019 21:16
DonJayamanne added a commit that referenced this pull request Dec 17, 2019
For #8866
When selecting a remote session, connect to that session instead of connecting to that kernel.
If we connect to a kernel, the API shutdowns the previously connected kernel.

With the new changes, when selecting a remote kernel, we're in-fact selecting a remote session that we connect to.
However the API is still indicates we're connecting to a kernel (however under the hoods we connect to a session).
DonJayamanne added a commit that referenced this pull request Dec 17, 2019
For #8866
When selecting a remote session, connect to that session instead of connecting to that kernel.
If we connect to a kernel, the API shutdowns the previously connected kernel.

With the new changes, when selecting a remote kernel, we're in-fact selecting a remote session that we connect to.
However the API is still indicates we're connecting to a kernel (however under the hoods we connect to a session).
DonJayamanne added a commit that referenced this pull request Dec 17, 2019
DonJayamanne added a commit that referenced this pull request Dec 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants