janpfeifer / gonb

GoNB, a Go Notebook Kernel for Jupyter
https://github.com/janpfeifer/gonb
MIT License
631 stars 35 forks source link

Just a question about the version differences I get notified about #68

Closed oderwat closed 1 year ago

oderwat commented 1 year ago

When I run the latest(?) Jupyter-Lab + gonb I get the line "Adapting from protocol version 5.2 (kernel a8ade612-83a1-4efd-b151-49f5574ae005) to 5.3 (client)". What does this actually mean?

janpfeifer commented 1 year ago

I'm not sure. But my guess is that the latest version of JupyterLab (4.0.2 think) may have updated the protocol to 5.3. And GoNB advertises using protocol v5.2 I think.

What is the version of JupyterLab you are using ? And where do you get the message, in the JupyterLab output ?

oderwat commented 1 year ago

This is (more or less) the script I made for my co-workers to quickly get up and running:

go install github.com/janpfeifer/gonb@main
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/gopls@latest
if [[ -z $(conda env list | grep "jupyterlab") ]]; then
   conda create -n jupyterlab python=3.10
fi
source "$HOME/miniconda3/etc/profile.d/conda.sh"
conda activate jupyterlab
pip install jupyterlab==4.0.5
gonb --install
cd "$HOME/devsys/workspace/go" || exit
jupyter-lab

The message appears in the terminal after jupyter-lab was started.

[I 2023-09-04 19:17:36.033 ServerApp] Package jupyterlab took 0.0000s to import
[I 2023-09-04 19:17:36.052 ServerApp] Package jupyter_lsp took 0.0186s to import
[W 2023-09-04 19:17:36.052 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-09-04 19:17:36.059 ServerApp] Package jupyter_server_terminals took 0.0067s to import
[I 2023-09-04 19:17:36.060 ServerApp] Package notebook_shim took 0.0000s to import
[W 2023-09-04 19:17:36.060 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2023-09-04 19:17:36.060 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-09-04 19:17:36.063 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2023-09-04 19:17:36.068 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-09-04 19:17:36.332 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-09-04 19:17:36.366 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-09-04 19:17:36.397 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-09-04 19:17:36.398 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2023-09-04 19:17:36.399 LabApp] JupyterLab extension loaded from /Users/me/miniconda3/envs/jupyterlab/lib/python3.10/site-packages/jupyterlab
[I 2023-09-04 19:17:36.399 LabApp] JupyterLab application directory is /Users/me/miniconda3/envs/jupyterlab/share/jupyter/lab
[I 2023-09-04 19:17:36.400 LabApp] Extension Manager is 'pypi'.
[I 2023-09-04 19:17:36.402 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-09-04 19:17:36.403 ServerApp] Serving notebooks from local directory: /Users/me/devsys/workspace/go
[I 2023-09-04 19:17:36.403 ServerApp] Jupyter Server 2.7.2 is running at:
[I 2023-09-04 19:17:36.403 ServerApp] http://localhost:8888/lab?token=a924272dc48edfcce1c7cde90822f110dde809186155a7a9
[I 2023-09-04 19:17:36.403 ServerApp]     http://127.0.0.1:8888/lab?token=a924272dc48edfcce1c7cde90822f110dde809186155a7a9
[I 2023-09-04 19:17:36.403 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-09-04 19:17:36.416 ServerApp]

    To access the server, open this file in a browser:
        file:///Users/me/Library/Jupyter/runtime/jpserver-82584-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=a924272dc48edfcce1c7cde90822f110dde809186155a7a9
        http://127.0.0.1:8888/lab?token=a924272dc48edfcce1c7cde90822f110dde809186155a7a9
[I 2023-09-04 19:17:36.936 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
janpfeifer commented 1 year ago

Odd, here I also have:

$ jupyter-lab --version
4.0.5

But, the included JupyterServer is version 2.7.3:

$ jupyter-lab --no-browser
...
[I 2023-09-04 19:36:45.703 ServerApp] Jupyter Server 2.7.3 is running at:
...

Now I didn't see in the output you pasted, the line you mentioned about Adapting from protocol version 5.2 (kernel a8ade612-83a1-4efd-b151-49f5574ae005) to 5.3 (client). Does it show it after you start the kernel, in the JupyterLab logs ?

But in anycase, if this is only a warning message in the logs, it should be fine. The protocol from 5.2 to 5.3 changes very little, in a way that GoNB doesn't use, so it shouldn't matter. But pls let me know if it actually crashes or something.

Btw, GoNB advertised procotol version number is here. But the protocol should be backwards compatible, so all should be fine... (I hope...)

oderwat commented 1 year ago

I updated the jupyter-server to 2.7.3 and confirmed that it is being used, but it still reports the same message. But if you are using 5.2 in the kernel, I think it is just saying that the client is newer. I wonder why this is not happening on your machine.

janpfeifer commented 1 year ago

Just a quick update that I also see the message now, in the Jupyter logs.

It is innocuous as far as I've seen. And in the upcoming change I'm slowly building, I already updated the advertised protocol version to 5.4 and then it complains in reverse. But also without any functionality issues (the changes are minimal, and don't affect GoNB).

But I'll move the next release to protocol version 5.3 (it's the one I've been using to test the most) so there won't be any warnings.

janpfeifer commented 1 year ago

Marking as fixed (I hope) with the new release -- let me know if you see it again.

Btw, check out the new widgets support, it can be handy if experimenting with something interactive.