rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

question: choose rstudio version and choose r version #53

Closed statsccpr closed 6 years ago

statsccpr commented 7 years ago

I've treeaged the nested dockerfile "From" statements and i think its possible, but just not sure how.

Thru docker, can the user specify the rstudio version (say the 1.1+ with all the nifty new features) but also specify the r version (say 3.4) thru the docker command line? I'm guessing you use tags somewhere?

As a contrasting example, If i pull a rocker image with a explicit older R version tag, it kind of pigeon holes me into an older version of Rstudio server (without the new features)

I've looked at the various readmes and issues from the disparate rocker files and can't seem to find a clear answer

statsccpr commented 7 years ago

Just saw this

https://hub.docker.com/r/rocker/verse/

Am i correct where the only way to control the Rstudio version and R version is thru building the image from a dockerfile?

you can only choose the rstudio version during the image build stage (specified as a command line option of docker build)

he rocker/rstudio image builds with the latest version of RStudio by default. This can be customized by specifying the desired version in --build-arg RSTUDIO_VERSION=<VERSION> if building locally from its Dockerfile.

Is an alternative to daisy chain two containers together via docker-compose? A container with Rstudio only and a second container with R only?

cboettig commented 7 years ago

By default, the rocker/rstudio images builds with the latest stable release of RStudio (see this line in Dockerfile](https://github.com/rocker-org/rocker-versioned/blob/master/rstudio/Dockerfile#L27). This can be customized by building the rocker/rstudio image locally while passing an explicit version using a build args, as described in the README: https://github.com/rocker-org/rocker-versioned#images , e.g.

docker build --build-arg RSTUDIO_VERSION=1.1.383 rstudio/3.4.1

to build RStudio version 1.1.383 on R 3.4.1. Of course 1.1.383 is was just released yesterday and is now current default; it will just take a little bit poor DockerHub to finish rebuilding all the images in the stack (e.g. if you want verse)

If you want an older version of RStudio, you do indeed have to rebuild the stack. (We should probably lock older versions to their contemporary RStudio versions instead of building with latest, but I have to align those dates!

statsccpr commented 7 years ago

Thanks Carl,

locally building via docker build --build-arg RSTUDIO_VERSION=1.1.383 rstudio/3.4.1 was what I was looking for.

Just for illustration, a variation would be (assuming the image with base R is 3.3.1 is available) docker build --build-arg RSTUDIO_VERSION=1.1.383 rstudio/3.3.1

Seems like if the image with the desired base R version is not available, the sys admin can concurrently install many different side by side R versions and then resort to manually setting

export RSTUDIO_WHICH_R=/usr/local/bin/R

as in https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R

cboettig commented 6 years ago

Looks like this is resolved.

mikecuoco commented 3 years ago

Is it possible to specify RSTUDIO_VERSION when building images higher in the stack like rocker/tidyverse and rocker/verse? Or do I need to rebuild everything sequentially from the rocker/rstudio image?

cboettig commented 3 years ago

@mikecuoco yes, with the new stack this should work on image, regardless of where you are in the stack. you just need something like

RUN RSTUDIO_VERSION="daily" /rocker_scripts/install_rstudio.sh

in your Dockerfile. (You can also run this interactively via docker exec after a container has started to upgrade RStudio. if so, you may want to rerun /etc/cont-init.d/userconf immediately after to re-set and user settings like password specified at runtime. not necessary if you are doing this in a dockerfile).

mikecuoco commented 3 years ago

Thank you @cboettig! This solution worked for me.

I'm not sure if you've seen this issue yet, but all of my rocker images stopped working in singularity (I work on my university's HPC) after the RStudio 1.4 upgrade was built into all the images. The error messages indicated permissions issues with accessing /var/lib/rstudio-server/rstudio.sqlite when running the rserver command. Downgrading to RStudio 1.3 is a fix for this. I would guess many folks run these images on HPCs using singularity and might be running into the same issue. It has also been mentioned on RStudio Community and in this issue on rocker-versioned2.

cboettig commented 3 years ago

Thanks @mikecuoco . Yeah, the 1.4 version has created a range of problems that I think are all related (notably breaking both singularity and the jupyterhub integration). I haven't had a chance to get deep into it recently, but meanwhile have been hoping that they will be addressed upstream, but I could be wrong about that! I'll try and take a closer look