Add pluggable notebook sandbox backends - #10697
Draft
manzt wants to merge 2 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Contributor
Coverage Report for ./frontend
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
NotebookSandbox owns one notebook manifest and environment lifecycle. Mutations edit and synchronize as one operation, package inspection stays read-only, and rebinding defers environment work until the next launch or mutation. Backend adapters keep uv and pixi command paths independent, so sandbox=pixi requires only pixi and sandbox=uv requires only uv. SINGLE and MULTI remain process topologies that route through the same session-owned interface. A bare requirement added through the panel is pinned to the version the synchronized environment resolved, so a shared notebook reproduces its environment without a lockfile. An upgrade reopens the pin so the solve can advance. The module-level launch verbs dispatch through the same adapters, so backend policy lives in the adapter alone, and the runners report the exact argv they execute. Failures from either manager derive from `EnvironmentManagerError`, and backend-agnostic callers catch one error.
The package panel previously inferred sandbox mode from a synthetic tree root, so it could not identify the selected backend or distinguish a managed script environment from a configurable package manager. Carry the effective installation context with the dependency tree. Sandbox sessions expose a fixed Pixi or uv manifest tree, while regular sessions retain list and tree views and a configurable package manager. Use native tree output from each backend and mark repeated subtrees as deduplicated instead of cycles. Pixi trees are filtered to PyPI packages so Conda implementation details do not leak into the notebook manifest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sandboxing is specialized to uv: session code invokes uv directly, so a second environment manager has nothing to plug into.
This PR introduces
NotebookSandbox, the session-owned interface to one notebook's environment manager, with uv and pixi adapters behind it.--sandbox=pixiselects pixi (prefix-dev/pixi#6648);--sandboxand--sandbox=uvremain equivalent. Mutations edit the manifest and synchronize as one operation, and package inspection stays read-only.Bare requirements are pinned to the version the environment resolved, so a shared notebook reproduces its environment without a lockfile. The package panel shows the sandbox's manifest and resolved tree.