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

Support connecting to a currently running remote kernel #3571

Closed
IanMatthewHuff opened this issue Mar 5, 2019 · 16 comments
Closed

Support connecting to a currently running remote kernel #3571

IanMatthewHuff opened this issue Mar 5, 2019 · 16 comments
Assignees

Comments

@IanMatthewHuff
Copy link
Member

Currently our Remote support involves connecting to a remote server, finding a matching kernel spec, and then starting up a new untitled document on the server. What this doesn't allow is for looking at kernels that are already running and started on that server and then attaching to one of them. Currently you can do this via the jupyter command line via jupyter console --existing. We have a request from one customer who would like this as we don't support everything that the notebook currently can so they would like to connect both a notebook and the Interactive Window to one running kernel so they can share variables and state.

Stack Overflow Link here:
https://stackoverflow.com/questions/54987778/is-it-possible-to-link-the-interactive-python-window-to-a-running-jupyter-notebo

@rchiodo
Copy link
Contributor

rchiodo commented Mar 5, 2019

microsoft/vscode-python#3429 might make this unnecessary for this user. So +1 on supporting ipywidgets

@gstoel
Copy link

gstoel commented Mar 5, 2019

I am the original requestor on stack overflow... I am not so much looking for ipywidgets support, but more for interactive plots (eg bokeh) or code completion that for example includes column names...

@rchiodo
Copy link
Contributor

rchiodo commented Mar 5, 2019

Bokeh should already work? It's certainly not on par with support in Jupyter, but it does show a plot.

Can you elaborate on what you mean by code completion for column names?

@gstoel
Copy link

gstoel commented Mar 5, 2019

In notebooks on pandas dataframes when code completion kicks in it does not only show method names or attribute names (static coming from the object definition) but also the column names of the dataframe. This is of course only possible with compiled and running code since before runtime this is not interpretable. So as an example if a data frame df has the following columns: distance_km, distance_relative and height, after typing df. in any of the notebook cells would include those three columns in the alfabetically sorted code completion drop-down.

Besides this I personally also find the dataframes printed and scrollable in the notebook much more readable and usable compared to the text ones as seen in terminals.

My 2 cts ;) if you look at the comments under the post in SO you'll see some work around without using the interactive window in VS Code...

@vnijs
Copy link

vnijs commented Apr 20, 2019

+1 would also like to be able to connect to a specific running kernel. FYI Hydrogen has this as an option and shows the running kernels you can connect to or gives an option to start a new kernel

@ajasja
Copy link

ajasja commented Jun 14, 2019

This would be super useful as it is hard for any IDE to keep up and compete with all the jupyter notebook interactive features.

@greazer
Copy link
Member

greazer commented Aug 8, 2019

@gstoel, issue #1561 captures your comments about getting column names for dataframes. We'll be considering doing this.

@DonJayamanne DonJayamanne self-assigned this Dec 13, 2019
@rchiodo
Copy link
Contributor

rchiodo commented Dec 18, 2019

Validated. This should ship in our next release

@rchiodo rchiodo closed this as completed Dec 18, 2019
@gstoel
Copy link

gstoel commented Dec 18, 2019

Cool guys..... Looking forward to test it out in the next release.

@vnijs
Copy link

vnijs commented Dec 18, 2019

I just tried this out with the development release. Maybe it is not working as expected but when I click on "Idle" as shown in the screenshot below I only see different python kernels I can start, but not the python kernel I already have running in Jupyter. Is that expected? Am I missing something?

image

@rchiodo
Copy link
Contributor

rchiodo commented Dec 18, 2019

@vnijs where did you get the development release? The latest insider's is not necessarily the latest working version that we're validating against. And to be sure, you're connected to a remote server, right? This only works for remote servers.

@vnijs
Copy link

vnijs commented Dec 18, 2019

Thanks for the reply @rchiodo. I got the insider build from https://pvsc.blob.core.windows.net/extension-builds/ms-python-insiders.vsix

I can confirm that connecting to a (local) docker container from VSCode does work (i.e., I can see variables defined in Jupyter, in the kernel selected in VSCode).

Is it possible to get this to work also if both VS Code and Jupyter are running on the same linux box (i.e., without docker or a remote server)?

@rchiodo
Copy link
Contributor

rchiodo commented Dec 18, 2019

That would be a separate issue, but yes it's possible. Can you describe your use case? Are you sharing the same kernel between two different notebooks?

@vnijs
Copy link

vnijs commented Dec 18, 2019

Just trying to connect to a (local) kernel between jupyter and vscode on linux. This would also be very convenient when running Jupyter and VSCode/CodeServer (https://github.com/cdr/code-server) from a single docker container

@rchiodo
Copy link
Contributor

rchiodo commented Dec 18, 2019

I believe that should still be possible. You just specify the URI in the VS code settings. The only way this doesn't work is if we start the jupyter server for you (which is what we define as 'local', a server running on http://localhost is still considered remote)

@vnijs
Copy link

vnijs commented Dec 19, 2019

Great! I can now see variables defined in a python kernel launched through Jupyter!

image

@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
@microsoft microsoft unlocked this conversation Nov 14, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants