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

Suggestion: r-minimal developer image #98

Open
assaron opened this issue Feb 25, 2025 · 1 comment
Open

Suggestion: r-minimal developer image #98

assaron opened this issue Feb 25, 2025 · 1 comment

Comments

@assaron
Copy link

assaron commented Feb 25, 2025

I was trying to use r-minimal image on an HPC cluster at my university, which the scheduler that only accepts docker-based jobs. To decrease the start-up time I want to use the vanilla r-minimal image and have installed packages to be stored on the file system and mounted to docker container as a volume. However, it turned out that I can't use installr script to install packages to the docker volume since the docker jobs on cluster are executed under low-privileged user, while root access is required for installr to work.

As a workaround I created an r-minimal based docker image with compilers preinstalled. That way I can use it to install packages via R's install.packages, and use vanilla r-minimal to run the scripts. I'm not sure how this scenario could be useful to other people, but in case it is, I would suggest to create a separate docker image with some build dependencies. The following Dockerfile worked well for me (to install RcppParallel and Matrix packages):

from rhub/r-minimal:4.4.1
RUN installr -c -a "linux-headers gfortran"

Alternatively, and probably a more systematic solution, would be to make installr work without root permissions, but I'm not sure if it's possible. Unfortunately I also not sure how to reproduce this behavior locally: it's probably a version of a rootless docker, but I don't know the details.

@gaborcsardi
Copy link
Collaborator

I don't really understand the full extent of the problem, but indeed to install system packages you'll need to have root access in some way.

One solution is indeed to create an image that has the tools and packages you need, and then use that on your cluster. That's essentially how r-minimal works best: it helps you create your own image that is as small as possible.

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

2 participants