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

Remote jupyter connections in Native Nb to same degree as webviews #4390

Merged
merged 70 commits into from
Jan 20, 2021

Conversation

DonJayamanne
Copy link
Contributor

@DonJayamanne DonJayamanne commented Jan 14, 2021

For #254

@rchiodo @IanMatthewHuff @joyceerhl @DavidKutu
Testing is hanging, will fix that (tests work locally).
Else ready for review.

Damn, forgot to display the Uri of the server in status bar

@codecov-io
Copy link

codecov-io commented Jan 14, 2021

Codecov Report

Merging #4390 (e49a3f4) into main (27cfffe) will decrease coverage by 0%.
The diff coverage is 75%.

@@          Coverage Diff           @@
##            main   #4390    +/-   ##
======================================
- Coverage     75%     75%    -1%     
======================================
  Files        392     396     +4     
  Lines      25746   25861   +115     
  Branches    3680    3710    +30     
======================================
+ Hits       19407   19488    +81     
- Misses      4826    4845    +19     
- Partials    1513    1528    +15     
Impacted Files Coverage Δ
...lient/datascience/jupyter/jupyterSessionManager.ts 73% <0%> (+1%) ⬆️
src/client/datascience/jupyter/kernels/helpers.ts 57% <0%> (-1%) ⬇️
...atascience/jupyter/liveshare/guestJupyterServer.ts 73% <ø> (ø)
src/client/datascience/jupyter/serverUriStorage.ts 81% <ø> (ø)
...ce/raw-kernel/liveshare/hostRawNotebookProvider.ts 74% <0%> (-3%) ⬇️
.../datascience/interactive-common/interactiveBase.ts 71% <9%> (ø)
...ient/datascience/jupyter/kernels/kernelSelector.ts 77% <50%> (-2%) ⬇️
src/client/common/application/encryptedStorage.ts 39% <54%> (+1%) ⬆️
src/client/datascience/notebook/kernelProvider.ts 61% <55%> (-8%) ⬇️
src/client/datascience/jupyter/serverSelector.ts 73% <69%> (ø)
... and 36 more

@@ -469,7 +469,7 @@ jobs:
python: [3.8] # Use flaky tests to run against more versions of Python.
# integration: Tests with VS Code, Python extension & real Jupyter
# notebook: Notebook Tests with VS Code, Python extension & real Jupyter
test-suite: [integration, notebook, notebookWithoutPythonExt, conda]
test-suite: [integration, notebook, remoteNotebook, notebookWithoutPythonExt, conda]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Run native notebook tests with remote jupyter as a separate job (faster & easier to manage)

@@ -209,6 +209,7 @@
"VSC_JUPYTER_RUN_NB_TEST": "true", // Initialize this to run notebook tests (must be using VSC Insiders).
"VSC_JUPYTER_LOAD_EXPERIMENTS_FROM_FILE": "true",
"TEST_FILES_SUFFIX": "vscode.test",
"XVSC_JUPYTER_REMOTE_NATIVE_TEST": "1", // Remove 'X' prefix to run the Native Notebook tests with remote jupyter connections.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ability to run remote jupyter locally

selection.interpreter = await this.kernelService.findMatchingInterpreter(selection.kernelSpec);
}
selection.interpreter = item.selection.interpreter || (await activeInterpreter);
if (isPythonKernelConnection(selection)) {
selection.kernelSpec.interpreterPath =
selection.kernelSpec.interpreterPath || selection.interpreter?.path;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found a bug while testing, we weren't setting this

* @param {Kernel.IKernelConnection} kernel
* @memberof KernelSelector
*/
public addKernelToIgnoreList(kernel: Kernel.IKernelConnection): void {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved from KernelSelector class to this so that it can be used by NativeNotebooks (this class is already used by native notebooks as it doesn't have UI specific code)

@inject(IPythonExtensionChecker) private readonly extensionChecker: IPythonExtensionChecker,
@inject(PreferredRemoteKernelIdProvider)
private readonly preferredRemoteKernelIdProvider: PreferredRemoteKernelIdProvider
) {
disposableRegistry.push(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this code to another class.

@@ -52,6 +52,35 @@ export class JupyterServerSelector {
const multiStep = this.multiStepFactory.create<{}>();
return multiStep.run(this.startSelectingURI.bind(this, allowLocal), {});
}
@captureTelemetry(Telemetry.SetJupyterURIToLocal)
public async setJupyterURIToLocal(): Promise<void> {
Copy link
Contributor Author

@DonJayamanne DonJayamanne Jan 15, 2021

Choose a reason for hiding this comment

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

Public to enable setting these in tests, else no changes to this file

}
}

public async setJupyterURIToRemote(userURI: string): Promise<void> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Public to enable setting these in tests, else no changes to this file

}
});
disposeHandler = kernel.onDisposed(() => {
if (disposeHandler) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added code to ensure we dispose the handlers (clean up code).

@DonJayamanne DonJayamanne marked this pull request as ready for review January 15, 2021 18:29
@DonJayamanne DonJayamanne requested a review from a team as a code owner January 15, 2021 18:29
@DonJayamanne DonJayamanne changed the title Remote logging parity Enable current style of remote notebooks in native notebooks Jan 15, 2021
@DonJayamanne DonJayamanne changed the title Enable current style of remote notebooks in native notebooks Enable support of current style of remote jupyter in native notebooks Jan 15, 2021
package.json Outdated Show resolved Hide resolved
Copy link
Contributor Author

@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.

Pending status & test fixes.

@DonJayamanne DonJayamanne changed the title Enable support of current style of remote jupyter in native notebooks Support remote jupyter server connections in Native Notebooks to same degree as webviews Jan 15, 2021
.github/workflows/main.yml Outdated Show resolved Hide resolved
@@ -681,6 +679,7 @@ jobs:
VSC_JUPYTER_FORCE_LOGGING: 1
VSC_PYTHON_FORCE_LOGGING: 1
VSC_JUPYTER_CI_RUN_NON_PYTHON_NB_TEST: 1
VSC_JUPYTER_REMOTE_NATIVE_TEST: ${{ contains(matrix.test-suite, 'remote') }}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks @rchiodo

@DonJayamanne DonJayamanne changed the title Support remote jupyter server connections in Native Notebooks to same degree as webviews Remote jupyter connections in Native Nb to same degree as webviews Jan 20, 2021
@DonJayamanne DonJayamanne merged commit 91ebb08 into main Jan 20, 2021
@DonJayamanne DonJayamanne deleted the remoteParity branch January 20, 2021 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants