benmarwick / rrtools

rrtools: Tools for Writing Reproducible Research in R
Other
671 stars 85 forks source link

evaluate package containerit for use_dockerfile() #19

Closed nuest closed 4 years ago

nuest commented 7 years ago

Just learned about this today and hope you will evaluate containerit for the function rrtools::use_dockerfile(). More info:

benmarwick commented 7 years ago

Thanks for your suggestion, yes, it's a project I admire a lot. I have tried it. My experience was that it was not immediately suitable here because:

But perhaps I had a bad experience. If you can help me debug I would be happy to try again!

But when I was experimenting with it, I noticed the sysreqs package and service, which we could use to get the linux libraries that some R packages need.

Here's what I see:

library("containerit")
library("rprojroot")

# get file path to the root of my package
root <- find_root(has_file("DESCRIPTION"))

# make dockerfile according to the "Packaging a workspace directory" instructions
df_custom <- dockerfile(from = root, image = "rocker/verse:3.4.0")

And the output is:

> df_custom <- dockerfile(from = root, image = "rocker/verse:3.4.0")
> rmarkdown::render(C:\\\\Users\\\\bmarwick\\\\Desktop\\\\rrtools\\\\analysis\\\\paper\\\\paper.Rmd)
Error: unexpected input in "rmarkdown::render(C:\"
Execution halted
Error in obtain_localSessionInfo(rmd_file = file, vanilla = vanilla, slave = silent,  : 
  Failed to execute the script locally! A sessionInfo could not be determined.
In addition: Warning messages:
1: In dockerfileFromWorkspace(path = from, .dockerfile = .dockerfile,  :
  Found both scripts and weaved documents (Rmd, Rnw) in the given directory. Using the first document for packaging: 
    C:/Users/bmarwick/Desktop/rrtools/analysis/paper/paper.Rmd
2: running command '"R" --silent --vanilla -e "rmarkdown::render(\"C:\\\\Users\\\\bmarwick\\\\Desktop\\\\rrtools\\\\analysis\\\\paper\\\\paper.Rmd\")" -e "info <- sessionInfo()" -e "save(list = \"info\", file = \"C:\\\\Users\\\\bmarwick\\\\AppData\\\\Local\\\\Temp\\\\RtmpINc2mn\\\\rdata-sessioninfo290c57f95f03\")"' had status 1 
> sessionInfo()
R version 3.4.0 Patched (2017-05-10 r72670)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=English_Australia.1252                           
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=English_Australia.1252                          
[4] LC_NUMERIC=C                                                
[5] LC_TIME=English_Australia.1252                              

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rprojroot_1.2     containerit_0.2.0

loaded via a namespace (and not attached):
 [1] compiler_3.4.0       backports_1.1.0      rjson_0.2.15        
 [4] magrittr_1.5         futile.logger_1.4.3  tools_3.4.0         
 [7] lambda.r_1.1.9       yaml_2.1.14          futile.options_1.0.0
[10] stringi_1.1.5        stringr_1.2.0        fortunes_1.5-4  
nuest commented 7 years ago

Thanks @benmarwick for trying out the package, I will look into the issue hopefully soon.

On the rocker/verse topic: right, base images can simplify a lot, you can stay updated on that here: https://github.com/o2r-project/containerit/issues/93

nuest commented 4 years ago

Just wondering: with the filtering of existing packages based on the base image, would you re-consider this idea?

Alternatively, rrtools could use sysreqs directly and at least suggest system dependencies a user might have to add to the Dockerfile.

benmarwick commented 4 years ago

Will take another and continue this issue at #107