Expand description
Per-repository kernelspecs: the only stock-jupyter channel for a
per-kernel WARATAH_REPO.
jupyter-server 2.21 (see python/requirements.lock) has no kernel env
allowlist — request-supplied env is dropped by the API handlers and
no trait re-enables it (that is a jupyter-enterprise-gateway feature the
work order assumed existed; verified absent against the pin). What stock
jupyter does support:
- kernels inherit the sidecar process environment (covers
WARATAH_URLand the defaultWARATAH_REPO), and - a kernelspec’s
envstanza is applied over the inherited environment at kernel launch (jupyter_clientpre_launch:env.update(...)).
So the engine writes one spec per repository —
{runtime_dir}/kernels/python3-{repo}/kernel.json with
"env": {"WARATAH_REPO": repo} — and discovers them by putting
{runtime_dir} on the sidecar’s JUPYTER_PATH. The proxy turns the
UI’s per-request env.WARATAH_REPO into that kernelspec name
(waratah_notebook::proxy), keeping the documented UI contract
working on a stack without request-env support.
Functions§
- kernel_
spec_ name - Kernelspec name for one Waratah repository.
- valid_
repo_ id - Repository ids are the engine’s
MAIN_REPOSITORY_ID-style ids; keep them filesystem-safe because they become kernelspec directory names. - write_
spec - Write the kernelspec for
repounder{runtime_dir}/kernels/.