yuvipanda / repo2jupyterlite-action

BSD 3-Clause "New" or "Revised" License
11 stars 1 forks source link

Figure out how to disable specific kernels #1

Open yuvipanda opened 1 year ago

yuvipanda commented 1 year ago

I wrote this up on how to disable specific kernels, but it doesn't seem to work?

By default, 3 kernels are made available in all JupyterLites built with this action:

  1. Pyodide (pyolite)
  2. Javascript
  3. XPython (xeus-python)

This might be quite confusing to your end users, as the two python kernels also have different behavior!

Pyodide doesn't have a way to pre-install packages (until []() is merged), while XPython doesn't support installing packages at runtime with micropip. While eventually they might all converge, for now, as the author of the GitHub repo, you need to make this choice for your users.

You can disable some kernels by creating a file named jupyter-lite.json with the following contents:

{
    "jupyter-lite-schema-version": 0,
    "jupyter-config-data": {
        "disabledExtensions": [
          "@jupyterlite/javascript-kernel-extension",
          "@jupyterlite/pyolite-kernel-extension"
        ]
    }
}
yuvipanda commented 1 year ago

I built it with (the equivalent of) jupyter lite build --contents <path> and there seems to be no effect here.

yuvipanda commented 1 year ago

@jtpio and @bollwyvl would love to hear what I might be doing wrong :)

bollwyvl commented 1 year ago

you have logs, or a broken site, or a version you tested with, or something? It could be the schema needs to change, if the upstream config has changed without us noticing, as we don't exercise that in our heavy duty site... but probably could with echo-kernel or something.

jtpio commented 1 year ago

@yuvipanda the location of jupyter-lite.json is also relevant, maybe it ends up in the wrong directory and is not picked up.