Skip to content

Kernel selection UI - #8866

Merged
Rich Chiodo (rchiodo) merged 22 commits into
masterfrom
davidkutu/kernel_selection_UI
Dec 11, 2019
Merged

Kernel selection UI#8866
Rich Chiodo (rchiodo) merged 22 commits into
masterfrom
davidkutu/kernel_selection_UI

Conversation

@DavidKutu

@DavidKutu David Kutugata (DavidKutu) commented Dec 2, 2019

Copy link
Copy Markdown

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

Codecov (codecov-io) commented Dec 3, 2019

Copy link
Copy Markdown

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.

Comment thread src/client/datascience/interactive-ipynb/nativeEditor.ts Outdated
Comment thread src/datascience-ui/interactive-common/mainState.ts Outdated
Comment thread src/datascience-ui/interactive-common/mainState.ts Outdated
Comment thread src/datascience-ui/native-editor/nativeEditor.tsx Outdated
Comment thread src/datascience-ui/native-editor/nativeEditor.tsx Outdated
Comment thread src/client/datascience/interactive-ipynb/nativeEditor.ts Outdated
Comment thread src/datascience-ui/history-react/redux/mapping.ts Outdated
Comment thread src/datascience-ui/interactive-common/mainState.ts Outdated
Comment thread src/datascience-ui/interactive-common/mainState.ts Outdated
Comment thread src/datascience-ui/native-editor/nativeEditor.tsx
Comment thread src/client/datascience/interactive-ipynb/nativeEditor.ts Outdated
Comment thread src/client/datascience/jupyter/jupyterServer.ts Outdated
Comment thread src/client/datascience/jupyter/liveshare/guestJupyterServer.ts Outdated
Comment thread src/datascience-ui/react-common/locReactSide.ts
Comment thread src/datascience-ui/history-react/redux/mapping.ts Outdated
Comment thread src/datascience-ui/interactive-common/redux/store.ts Outdated
Comment thread src/datascience-ui/native-editor/nativeEditor.tsx Outdated
@rchiodo

Copy link
Copy Markdown
});

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)

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🕐

Comment thread src/client/common/utils/localize.ts Outdated
Comment thread src/datascience-ui/native-editor/nativeEditor.less Outdated
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

@rchiodo Rich Chiodo (rchiodo) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

:shipit:

Copy link
Copy Markdown

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 IKernelState {
jupyterServerStatus: ServerStatus;
uri: string;

Copy link
Copy Markdown

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

Comment thread package.nls.json
"DataScience.noRowsInDataViewer": "No rows match current filter",
"DataScience.jupyterServer": "Jupyter Server",
"DataScience.noKernel": "No Kernel",
"DataScience.localJupyterServer": "local",

Copy link
Copy Markdown

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
Copy Markdown

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()) {

Copy link
Copy Markdown

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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Optional change.

Copy link
Copy Markdown

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;

Copy link
Copy Markdown

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);

Copy link
Copy Markdown

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
Copy Markdown

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
Rich Chiodo (rchiodo) merged commit 6cadda5 into master Dec 11, 2019
@rchiodo
Rich Chiodo (rchiodo) deleted the davidkutu/kernel_selection_UI branch December 11, 2019 21:16
Don Jayamanne (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).
Don Jayamanne (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).
@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