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

Recommend rstudio build from tidyverse rather than the other way around. #10

Closed jsonbecker closed 7 years ago

jsonbecker commented 7 years ago

I'm not sure if others would agree with me, but I don't really need to load all of RStudio and to have access to an RStudio environment in my containers. I do, however, use many of the packages in the tidyverse and it would be convenient to use a container that has all of the work to install those packages and their Linux dependencies for me.

tidyverse seems exactly designed for using R with those packages and their Linux dependencies, but it comes along with the baggage of RStudio (which I love locally but don't use remote, and certainly not in production). Since I can easily see a use for tidyverse sans RStudio, but I think it makes perfect sense to have tidyverse in place when using RStudio, I wonder if the dependencies should be reversed.

eddelbuettel commented 7 years ago

So start from the rbase container and load the package you think are essential to you.

As you point out in your opening line, no one size fits all so treat this as a toolkit and build on it.

jsonbecker commented 7 years ago

I'm trying, and will obviously do that as needed. But it's tricky, which is why it's so great to have community resources. Happy to close this as not something folks are interested in, but as I really appreciate the presence of versioned images and the movement of LaTeX out of the tidyverse container, I thought it'd be worth mentioning that I think there's a lot of use for a slightly different dependency graph.

cboettig commented 7 years ago

I hear you and I have thought about this, but which-ever order we put any of the stack there will be people who want it the other way around. (For instance, this stack puts all the LaTeX stuff only in verse, though LaTeX has been an important dependency for many R users for much longer than tidyverse or rstudio have even been around).

Still welcome your feedback and just want to understand your use case. Unfortunately Docker doesn let us mix and match stacks that well, and maintaining stacks in multiple orders is simply messy.

My thinking is that is relatively easy for any user to install tidyverse on top of r-ver, (particularly since users who use R in CLI or batch mode are more likely to be capable than those (like my students) who only access R via RStudio interface, whether locally or remotely). I imagine most users of the tidyverse container are already valuing pre-installed convenience over minimal image size or they would be using a custom image stripped down to their needs anyhow and they might overlook the extra weight of RStudio.

jsonbecker commented 7 years ago

Primarily, just trying to stack the tidyverse stuff on top of r-ver I ran into issues with littler because of some of the path setting that happens in the rstudio container and I'm continuing to have issues getting rJava to install right.

Most of this is my own inexperience to be sure. But as I sat here trying to figure out which components truly built on one another, I thought that it was likely the case that other folks would want to do something similar and that the project might consider breaking it down differently.

cboettig commented 7 years ago

@jsonbecker Ah, you were probably missing https://github.com/rocker-org/rocker-versioned/blob/master/rstudio/Dockerfile#L56-L60, which arguably should have been put in r-ver instead of rocker (they are already set up this way in r-base). Thanks for the report, I should fix that. With those in place (and maybe some of the apt-gets listed in rstudio), the tidyverse Dockerfile should probably build just by swapping out FROM rocker/rstudio with FROM rocker/r-ver, which is probably what you expected should just work if layers really added only what they said in the name ;-)

Like you say, learning how to tune these things is a community process

jsonbecker commented 7 years ago

I'm going to close this issue as I think it's clear this isn't the solution that would be preferred. But thanks @cboettig, I think that should be a large help. I think you've captured the spirit of my recommendation.

cboettig commented 7 years ago

@jsonbecker np. note that I did fix this so you should just be able to swap out the FROM line to have the tidyverse Dockerfile build on r-ver intead of rstudio. (For rJava, just installing default-java-jdk with apt-get should be sufficient for install.packages('rJava') to work onrocker/tidyverse`...

jsonbecker commented 7 years ago

Yup, I got confused by default-java-jdk being in the BUILDDEPS and thought it was installed. That turned out to be as easy as adding default-jdk to apt-get and running R CMD javareconf.

twfs commented 6 years ago

Oldish posts I know, but for someone who falls into the same trap as me. default-java-jdk above is a typo I think, it's called default-jdk and yes it does appear in the r-ver builds in the BUILDDEPS and you see the jdk getting unpacked etc in the build log. However, it is subsequently removed (look later in the log file) and so it isn't there when you look in the final image. So to use rJava you do need to do apply the above to the r-ver image.

Thanks for rocker!!