Repository navigation
Link default R and Python onto PATH in workbench and session images - #245
Draft
ianpittwood wants to merge 1 commit into
Draft
ianpittwood wants to merge 1 commit into
ianpittwood wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Refs posit-dev/images-shared#839
Depends on posit-dev/images-shared#888. The templates need that Bakery release to re-render. The rendered files are committed, so CI builds work without it.
Changes
workbench (Standard)
r.run_install(Dependencies.R, link_to_path=True)andpython.copy_from_build_stage(Dependencies.python, link_to_path=True)./opt/R/defaultpoints to/opt/R/4.6.2and/opt/python/defaultpoints to/opt/python/3.14.10.R,Rscript,python,python3,pipandpip3are linked into/usr/local/binthrough thosedefaultpaths.workbench-session (matrix)
$R_VERSION/$PYTHON_VERSION.ARG PYTHON_VERSIONmoved above the PythonCOPYso the linkRUNsees it.Both images
path_link_checksandpath_link_targetsfor R (R,Rscript) and Python (python,python3,pip,pip3). In the server image these run for Standard only.pyyamlandnbclientare added to the same base-Python pip install asipykernel. Theipykernel install --userline is unchanged.python3used to be the system/usr/bin/python3, which has no Jupyter, soquarto checkskipped its Jupyter test. Now the default is the managed Python. It hasjupyter_core(from ipykernel) but had noyaml/nbclient, soquarto check jupyterfailed (ModuleNotFoundError: yaml).Verify Quartogoss check passes again, andquarto renderof Jupyter docs works with the defaultpython3./opt/python/defaultalways targets the versioned interpreter, never the/opt/python/jupytervenv./usr/local/bin/jupyteris unchanged.workbench-session-complete
Docs
workbench-session/README.mdandworkbench/README.mddocument the default links and that pip is externally managed.Notes
workbench/template/conf/launcher/launcher-env.jinja2is not changed. ItsPATH=/opt/python/default/bin:$PATHbecomes valid again for session images.rm -rf .../site-packages/tornado/test. It is harmless.workbench-session-init,workbench-positron-init.Verification
bakery buildforworkbench-sessionR4.6.2-python3.14.10, Ubuntu 24.04, Minimal, linux/amd64: passed.bakery dgoss runwith the same filters: 57/57 passed. This includes the 12 new link checks andVerify Quarto.Verify Quartofailed)./usr/bin/python3(system 3.12) is shadowed by/usr/local/bin/python3(3.14.10) on the default PATH.su - <user>anddocker run -u 4242both resolve all six binaries to/usr/local/bin, with R home at/opt/R/4.6.2.pip installreturnsexternally-managed-environment.RUNlines.Open risks
/opt/R/*. Their docs don't say whether a symlinked/opt/R/defaultis de-duplicated, so either may listdefaultas an extra R version.r-versions-scan = 0.positron.r.interpreters.exclude.Rscriptorpython3gets the image default. This matters mainly for the server image.--break-system-packages.ipykernel install --userkernelspec is a separate, pre-existing issue that this PR does not address.workbench-session-completegoss does not assert the links yet (see above).