jupyter-server / jupyverse

A Jupyter server based on FastAPI :rocket:
https://jupyter-server.github.io/jupyverse
Other
247 stars 30 forks source link

Cannot use external kernal via allow_external_kernels and kernels.external_connection_dir #385

Open bldrvnlw opened 9 months ago

bldrvnlw commented 9 months ago

Description

And external program is serving a kernel (in my case using the xeus code) and jupyverse is started with the options

 --set "kernels.external_connection_dir=<directory_containing_connection.json> --set "kernels.allow_external_kernels=true"

In the jupyverse webserver the kernel is not visible

Note: it maybe that that I'm misunderstanding the intention of the _kernels.allow_externalkernels and _kernels.external_connectiondir options. This has also been discussed on the Jupyter Discourse Forym

AFAICT there is code to pickup and existing connection.json file but this does not configure a connectable kernel in the web interface.

Reproduce

  1. Start an external kernel with a connection.json file e.g. :

    {
    "transport": "tcp",
        "ip": "127.0.0.1",
    "control_port": 55684,
    "shell_port":  60315,
    "stdin_port":  55844,
    "iopub_port":  52554,
    "hb_port":  63106,
    "signature_scheme": "hmac-sha256",
    "key": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "kernel_name": "MyKernel"
    }
  2. Start jupyverse pointing to the directory containing this kernel

jupyverse.exe" --set "kernels.external_connection_dir=<connection.json_dir>" --set "kernels.allow_external_kernels=true" --port=8800

Expected behavior

Kernel MyKernel will be an option in the web interface

Context

I added some logger.info statements to check that the connection.json file was being read - see the ouput lines with ** below

Command Line Output
```
[2024-02-06 09:20:13,172 INFO] Running in development mode
[2024-02-06 09:20:13,368 INFO] Starting application
[2024-02-06 09:20:18,112 INFO] Scanning kernel config in D:\TempProj\DevBundle\Jupyter\install\Debug\external_kernels\ManiVault **
[2024-02-06 09:20:18,147 INFO] Processing connection files
[2024-02-06 09:20:18,147 INFO] Processing file at path D:\TempProj\DevBundle\Jupyter\install\Debug\external_kernels\ManiVault\connection.json **
[2024-02-06 09:20:18,148 INFO] Adding kernel : MyKernel **
[2024-02-06 09:20:18,269 INFO]
[2024-02-06 09:20:18,269 INFO] To access the server, copy and paste this URL:
[2024-02-06 09:20:18,269 INFO] http://127.0.0.1:8800/?token=5c56ca0a7a474549afc3fcc3b88f6944
[2024-02-06 09:20:18,269 INFO]
[2024-02-06 09:20:18,380 INFO] Started server process [49084]
[2024-02-06 09:20:18,380 INFO] Uvicorn running on http://127.0.0.1:8800 (Press CTRL+C to quit)
```
Browser Output
MyKernel is not visible in the select kernel options

welcome[bot] commented 9 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada: