Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use images to provide python/R runtime environments #91

Open
bloodearnest opened this issue Feb 5, 2025 · 0 comments
Open

Use images to provide python/R runtime environments #91

bloodearnest opened this issue Feb 5, 2025 · 0 comments

Comments

@bloodearnest
Copy link
Member

bloodearnest commented Feb 5, 2025

Currently, we install the R version and packages from r:v1 and python version from python:v2 into the devcontainer image. These act as the foundation to provide LSP support for editing python and R files using the vscode editor.

However, it should be possible to provide these environments from the opensafely images.

e.g.

docker run --it -d --rm --name r-v2 r:v2 bash  # does nothing, but provides mount points
# note: this is for zfs, looks slightly different for overlayfs
mount=$(docker inspect r-v2 -f '{{.GraphDriver.Data.Mountpoint}}')
sudo mount --bind -ro "$mount/usr/bin/R" /usr/bin/R
sudo mount --bind -ro "$mount/usr/lib/R" /usr/lib/R
... # other directories may also need mounting, e.g. specific libs.

This requires some more PoC work to verify, but if it works, it provides more dynamic versions of the run times, and can support multiple images.

This step could be done on postAttach event, rather than baking in to the image, so would track image versions.

It's still only possibly to provide one version of an R or python version at a time, but that choice can be made per project, rather than once for all projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant