rocker-versioned2 icon indicating copy to clipboard operation
rocker-versioned2 copied to clipboard

Qualification of Rocker Images

Open elimillera opened this issue 4 years ago • 5 comments

Hello,

Really appreciate all of the work that has been done with getting R and Docker working together as well as it does. I'm trying to do a couple of things to push forward using R and Docker in regulated environments. I'm trying to define a process to qualify R images. To that end, I am trying to replace something like this R-IQ-OQ process with docker images.

The idea would be to have a document for each community docker images (Rocker, RStudio, etc) that can be referenced when using them in a regulatory context. I'm still working on this document and structure but I've gotten what I need out of the r-ver images with a small change. To test the R installation I added a make install-tests to the install_R.sh file to add the 'tests' folder to the R installation. My question is would there be any ability to add the tests for R installations to existing/future Rocker images?

I'm thinking it would be easiest to pull the official images and add a layer on top that runs the tests and outputs the reports. So far with my testing, the only change necessary is the make install-tests line in the install_R.sh file.

elimillera avatar Jan 10 '21 05:01 elimillera

@elimillera I moved this over here where r-ver is being developed. It should be suitable. As for

To test the R installation I added a make install-tests to the install_R.sh file to add the 'tests' folder

it has always been puzzling to me that testthat does not install them by default -- which RUnit, tinytest, ... all do as one should. But I think there is an option --install-tests you can give to R CMD INSTALL which enforces copying tests. Now, of course, we use install2.r too which may need that feature added as well.

eddelbuettel avatar Jan 11 '21 02:01 eddelbuettel

@eddelbuettel You're right about --install-tests. Testing the installed packages as well as the base packages is also an important part so those tests would ideally be there. Let me know if you like an issue/PR to littler, I should have time for an update like that in the coming weeks if that helps.

elimillera avatar Jan 12 '21 00:01 elimillera

I haven't had time to look in detail but we could probably add a command-line switch to install2.r to also install tests. That's my side. @cboettig and @noamross need to still give you a green-light to make these somewhat hefty versioned containers a little heftier still. I guess more testing is better, OTOH containers are "deployment" vehicles to skinnier is better?

eddelbuettel avatar Jan 12 '21 01:01 eddelbuettel

yeah, interesting. Maybe a few ways to think about this. Is the goal to test the install in the container (i.e. to run the tests once, at build time) or have the tests permanently available? Silly question, but do the test installs have to be wrapped up into the installation (e.g. install_R.sh script) or can these be installed after-the-fact in a separate script?

@noamross suggested a while back adding 'smoke tests' to the build process, whereby we'd run a set of test scripts as the final command in the build process, and have those scripts clean up after themselves. this could help test the build without increasing image size.

cboettig avatar Jan 12 '21 20:01 cboettig

'smoke tests' is a good idea, but I am not sure I would recommend going behind R's back of first installing tests and then sneakily removing them.

We could just eat the extra space for the testthat packages that because of some never fully explained decisions (package authors always hand-wave and claimed "CRAN wants it that way" which is AFAICT simply not true, not stated anywhere -- and countered by RUnit and tinytest installing tests by default) do not install tests by default.

Or we could overengineer, install packages again into /tmp/lib/, say, tests thre and then blow /tmp/lib away. Saves on final space but is maybe weird because we then (temporarily) have two installations of packages? Should be bit identical though...

eddelbuettel avatar Jan 12 '21 20:01 eddelbuettel