You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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 forinstallr
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 installRcppParallel
andMatrix
packages):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.
The text was updated successfully, but these errors were encountered: