Repository navigation
Tell a hotfix seat's ssh session where the interpreters live - #175
Merged
Merged
Conversation
A VS Code shell is an ssh session, and sshd inherits none of the image's ENV - only the names in SESSION_ENV_NAMES survive. UV_PYTHON_INSTALL_DIR is not one of them, so it arrives unset and uv falls back to $HOME/.local/share/uv/python, inside the seat. Measured on p47-beamline, 2026-08-22, from a seat mounting the claim and running as the target's uid: uv sync, venv present -> home unchanged, on the claim (fine) uv add six -> home unchanged, on the claim (fine) .venv removed, uv sync -> home = /tmp/.local/share/uv/python/cpython-3.11.13... The last one is the case #160 calls silent. uv only consults UV_PYTHON_INSTALL_DIR when it has to *choose* an interpreter; with a venv already present it reuses the one pyvenv.cfg names, and that one is on the claim, which is why the common case looks fine. When it does choose, it writes a path the target cannot see - with no error, and a shebang that still reads #!/podbench/app/.venv/bin/python. The fix reverts at the next relaunch and nothing says so. The value is computed, not forwarded. Both podbench's image and every python-copier-template target set UV_PYTHON_INSTALL_DIR=/python, so carrying it by name would point a session working on the target's project at the *seat's* interpreter store - which is the bleed rather than the fix. It is also probed rather than assumed: an ordinary attach seat has no claim, and naming a path that does not exist would break uv there for no reason. Verified against the same failing case: with the session env this now writes, the rebuilt venv names /podbench/app/.python and the target runs it. Refs #160. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Kt5d2r5cnhr2iXEkddtaEz
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Partial fix for #160 — the half that fails silently. Not merged; opened for review only.
The question this answers
What does
uv syncdo in a VS Code shell? Measured onp47-beamlinefrom a seat mounting the claim and running as the target's uid, in the environment podbench's ssh transport actually creates:uv sync,.venvpresenthomeunchanged, on the claimuv add sixhomeunchanged, on the claim.venvremoved, thenuv synchome = /tmp/.local/share/uv/python/cpython-3.11.13-…uv consults
UV_PYTHON_INSTALL_DIRonly when it has to choose an interpreter. With a venv present it reuses the onepyvenv.cfgnames — and since 0.6.0 that one is on the claim, resolving to the same bytes in both namespaces. That is why the common case is genuinely fine.When it does choose, it writes a seat-local path the target cannot see. No error, and the shebang still reads
#!/podbench/app/.venv/bin/python, so it looks right. The fix reverts at the next relaunch and nothing says so.A VS Code shell is an ssh session, and sshd inherits none of the image's
ENV— onlySESSION_ENV_NAMESsurvives, andUV_PYTHON_INSTALL_DIRis not in it. So it arrives unset, and uv falls back to$HOME/.local/share/uv/pythoninside the seat.The fix
session_env()gains one computed entry, andensure_sshd_configsupplies it.Computed, not forwarded, and that distinction is the point: podbench's image and every python-copier-template target set
UV_PYTHON_INSTALL_DIR=/python, so carrying it by name would point a session working on the target's project at the seat's interpreter store — the bleed #160 describes, not the fix. There is a test asserting it is never inSESSION_ENV_NAMES.Probed, not assumed: an ordinary
attachseat has no claim, and naming a path that does not exist would break uv there for no reason.hotfix_interpreter_store()returnsNoneunless the claim's interpreter directory is actually present.Verified
Same failing case, with the session env this now writes:
and the target then runs what the seat built —
FastCS: 0.10.1.What this does not do
#160 also asks for
UV_PYTHON_INSTALL_DIRin the application container's chart env. I have left that out deliberately and #160 stays open for it: podbench's own rebuild already passes--pythonexplicitly, so the target is covered for podbench-driven syncs, and overriding the variable in the application container would point uv at an empty claim during image start-up — a plausible regression I have not measured. Worth doing as its own change with its own evidence.just checkgreen: 1564 passed, pyright strict clean. Test pod and seat deleted.