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

Server kernels are all named "Python 3", can't tell which notebook they belong to #2174

Closed
jdanbrown opened this issue Mar 11, 2020 · 5 comments
Assignees

Comments

@jdanbrown
Copy link

Feature: Notebook Editor, Interactive Window, Python Editor cells

Description

  • I like using a jupyter server to manage my kernels externally so that they can outlive vscode restarts, and also so they can run on remote machines
  • However, when I need to reconnect to an existing kernel managed by an external jupyter server, I don't have enough information to figure out which notebook was using which kernel, because all of the kernels have the same name, e.g. "Python 3"
  • This makes server kernels unusable (unless the user only uses one notebook at a time)
  • Server kernels should be named in some informative way to avoid this, e.g. naming them after the notebook path/filename that started them
Selecting a local kernel — good Selecting a server kernel — impossible :(
image image

Microsoft Data Science for VS Code Engineering Team: @rchiodo, @IanMatthewHuff, @DavidKutu, @DonJayamanne, @greazer

@rchiodo
Copy link
Contributor

rchiodo commented Mar 11, 2020

Unfortunately I don't believe we have any information about what notebook is being used for a kernel. We only have the last activity time. You can see the data we get on this call here:

http://petstore.swagger.io/?url=https://raw.githubusercontent.com/jupyter/notebook/master/notebook/services/api/api.yaml#/kernels/get_api_kernels

@rchiodo rchiodo closed this as completed Mar 11, 2020
@rchiodo
Copy link
Contributor

rchiodo commented Mar 11, 2020

This would require a change to jupyter I believe to indicate what notebooks are currently using a kernel.

@jdanbrown
Copy link
Author

jdanbrown commented Mar 12, 2020

What about using /api/sessions instead of /api/kernels? It includes a notebook.path field that atom/hydrogen uses to display which kernel was started by which notebook.

$ http localhost:8889/api/sessions
HTTP/1.1 200 OK
Content-Length: 365
Content-Type: application/json
Date: Thu, 12 Mar 2020 23:57:49 GMT
Etag: "0f45a05372a936d532e5359006055785d4691fdb"
Server: TornadoServer/4.5.3
X-Content-Type-Options: nosniff

[
    {
        "id": "f55db7d0-3754-4409-bdc0-c21687056a0f",
        "kernel": {
            "connections": 1,
            "execution_state": "idle",
            "id": "e8ab37b7-fdbf-4cf3-bd26-3e0c6cac0580",
            "last_activity": "2020-03-12T23:31:51.724382Z",
            "name": "python3"
        },
        "notebook": {
            "path": "/path/to/notebook.ipynb-36852600-affa-4621-9be4-13895db8e998"
        }
    }
]

@rchiodo
Copy link
Contributor

rchiodo commented Mar 13, 2020

That might work, worth a try.

@rchiodo rchiodo reopened this Mar 13, 2020
@rchiodo rchiodo self-assigned this Apr 14, 2020
@IanMatthewHuff IanMatthewHuff self-assigned this Apr 21, 2020
@IanMatthewHuff
Copy link
Member

Validated, now shows the active notebook path.

image.png

@lock lock bot locked as resolved and limited conversation to collaborators May 6, 2020
@microsoft microsoft unlocked this conversation Nov 13, 2020
@DonJayamanne DonJayamanne transferred this issue from microsoft/vscode-python Nov 13, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 8, 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

3 participants