voila-dashboards / voici

Voici turns any Jupyter Notebook into a static web application
https://voici.readthedocs.io/
Other
143 stars 8 forks source link

[Do not merge] Support both lite and remote kernel #118

Open trungleduc opened 2 months ago

trungleduc commented 2 months ago

References

This is an experiment on adding support for the remote kernels to voici dashboards.

How to test

jupyter server --ServerApp.token='' --ServerApp.password='' --ServerApp.disable_check_xsrf=True --no-browser --port=8000 --ServerApp.allow_origin="*"

{
  "VoilaConfiguration": {
    "extension_config": {
      "VoiciRemoteKernel": {
        "name-of-notebook-using-remote-kernel.ipynb": {
          "baseUrl": "http://127.0.0.1:8000/",
          "wsUrl": "ws://127.0.0.1:8000/"
        }
      }
    }
  }
}

The notebooks with names in the VoiciRemoteKernel section will use the remote kernel, other notebooks still use lite kernel.

Code changes

Backwards-incompatible changes

github-actions[bot] commented 2 months ago

lite-badge :point_left: Try it on ReadTheDocs

jtpio commented 1 month ago

Is it something that should be specific to Voici, or could this also be useful in JupyterLite?

jtpio commented 1 month ago

Thinking that with something like https://github.com/jupyterlab/jupyterlab/issues/15329 that would allow configuring the service manager with extensions, we could have such functionality live in a regular JupyterLab extension, so it could be installed on Voici and JupyterLite deployments if desired.

trungleduc commented 1 month ago

Thinking that with something like jupyterlab/jupyterlab#15329 that would allow configuring the service manager with extensions, we could have such functionality live in a regular JupyterLab extension, so it could be installed on Voici and JupyterLite deployments if desired.

indeed, I want to test it first in voici to see if swapping the server setting is enough to make the kernel work. But ideally, a custom service manager supporting both types of kernel should be the way to go.

jtpio commented 1 month ago

Nice, that makes sense, it would be faster to get a proof-of-concept up and running this way.

This would actually benefit not just Voici or JupyterLite, but could allow for hybrid (in-browser / remote) kernels in JupyterLab (or other lab-based apps) too (and progressively make lab and lite converge).

Thanks for looking into this!