rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

Is R-Ubuntu required for r-cran... binary installs? #406

Closed ghost closed 4 years ago

ghost commented 4 years ago

Some of the information listed in the wiki and here in the repo suggests that I should always be choosing an r-base and debian:testing base image for deploying R within a container.

I'd like some clarity on whats supported in the future and whats not. As I have no dependency on Ubuntu vs. Debian, I want my team to have access to the most pre-compiled latest versions of R packages available.

Thanks.

eddelbuettel commented 4 years ago

You have choices, and things change, so things are in a flux:

You haven't really explained what it is you want to do so I stop here. Maybe the easiest is ... for you to experiment and report back? We can help with questions.

ghost commented 4 years ago

thanks @eddelbuettel . I've experimented with r-base and r-ubuntu. My goal was to automate via CI/CD pipeline an R application, incorporating Continuous Integration (GIT), Continuous Delivery and continuous deployment. Buzz wordy, sure.

What I found was that using R-base, debian:testing I'm able to install via source, which yields a 72 minute container build time. I did not try the binary's as I just discovered I likely could go that route. This ap only requires 15 packages or so, likely to be available. That would be something I can research.

With R-Ubuntu and binaries the build time for the same ap and container is 3-4 minutes depending on what Docker, git lab runners, network are doing. With multiple developers checking code in, the pipeline consumes quite a bit of resource and time.

But as I'm wrapping this presentation to our advanced analytic department it dawned on me that IDK if R-ubuntu is the only option to produce the 4 minute build time and maintain a reasonable pipeline.

After reading up I determined that you can use either depending on preference and dependency and probably get the same results.

so my next step is probably to experiment with debian and the r-cran packages and see what happens.

eddelbuettel commented 4 years ago
  1. I have been doing pretty much that since r-travis started in 2013 or so.
  2. I have and still do rely extensively on prebuild packages as I aim for low Travis CI runtime.
  3. Essentially all my CI builds / runs are in the single digit minutes, often low single digit.
  4. I add additional r-cran-* packages, sometimes via my own PPA via launchpad.
  5. This is generally Ubuntu based and does not use containers. (But read on...)
  6. At some point I became very frustrated by the old Ubuntu releases use by Travis and what it implied for possibly library builds and compilers. Then they started to allow Docker.
  7. I now have a mix. Some packages use Docker-based Travis CI. I tend to prebuild containers per repo. Works great.
  8. With that I am back to single digit minutes per repo even for complicated builds as all "fixed build cost" is borned once at container build time.
  9. I see no point in reinstalling the same binaries at each CI run so I do it once, and then only pull the actual git repo at hand.
  10. This deserves a wider discussion and writeup but no time yet.

None of this implies any issue with the containers at hand so I think we should close this ticket.

ghost commented 4 years ago

After running with the r-base, which uses debian:testing the build time is very similar and all my binary needs are taken care of.

Thanks for the info on the repos. I guess it comes down to which one has the packages your application is going to need and what OS works the best for your ap.

eddelbuettel commented 4 years ago

That's right, and info is a little tricky to come by.

Glad to know r-base works for you. It is generally a rock-solid. Too bad that we still don't have CRAN as binaries for this, but we are getting closer with the other ones. So ... trade-offs as usual.

ghost commented 4 years ago

Just when i thought i knew what I was talking about...

When you say don't have CRAN as binaries for this (r-base). you mean

install.packages('shiny', type='binary') 

vs apt-get install shiny which I'm meaning installs from one of those PPA's or repos as binary. ie does not compile the source when I install.

eddelbuettel commented 4 years ago

Yes. For any CRAN package foo you need to search for a possible. r-cran-foo. That is where 700 vs 4400 vs all 15800 matters. Or, to some extend not even if you prebuild the container for your CI run. It depends.