containerit
containerit copied to clipboard
Install binary if available
Fun and educational post: http://dirk.eddelbuettel.com/blog/2017/12/13/#013_faster_package_installation_two
Installation time is not really an issue for it, it would be cool if we could detect if a binary package is available and then install that.
@eddelbuettel: Is it possible to get the information whether an R package is available as a Debian binary from somewhere? Maybe some clever apt cache search
?
@nuest Yes, planned as the next blog post. Didn't get to it yet :)
Here is a short write up. Let me know if it is helpful and/or comprehensible: http://dirk.eddelbuettel.com/blog/2017/12/22#014_finding_binary_deb_packages
Yes, that helps:
library("sf")
library("RcppAPT")
pkgs <- names(sapply(c(sessionInfo()$otherPks, sessionInfo()$loadedOnly), function(p) p$package)) # probably a better way to do this... just a quick hack
pkgs <- tolower(paste("r-cran-", pkgs, sep = ""))
RcppAPT::hasPackages(pkgs)
gives me
r-cran-compiler r-cran-magrittr r-cran-class r-cran-tools r-cran-dbi
FALSE TRUE TRUE FALSE TRUE
r-cran-units r-cran-rcpp r-cran-udunits2 r-cran-grid r-cran-e1071
FALSE TRUE FALSE FALSE TRUE
r-cran-classint r-cran-tcltk
FALSE FALSE
which is just what I need.
Using binary might be worse for reproducibility, but I still like this as a feature for containerit
.
I am also a little undecided about wheter it is better for reproducability. On the one hand it "fixes" one more moving part: rebuilding a container gets you more things that are unchanged. But the container builder may have a little bit less control over the binaries -- just like with a distro.
Yes, that helps:
library("sf")
library("RcppAPT")
pkgs <- names(sapply(c(sessionInfo()$otherPks, sessionInfo()$loadedOnly), function(p) p$package)) # probably a better way to do this... just a quick hack
pkgs <- tolower(paste("r-cran-", pkgs, sep = ""))
RcppAPT::hasPackages(pkgs)
gives me
r-cran-compiler r-cran-magrittr r-cran-class r-cran-tools r-cran-dbi
FALSE TRUE TRUE FALSE TRUE
r-cran-units r-cran-rcpp r-cran-udunits2 r-cran-grid r-cran-e1071
FALSE TRUE FALSE FALSE TRUE
r-cran-classint r-cran-tcltk
FALSE FALSE
which is just what I need.
Using binary might be worse for reproducibility, but I still like this as a feature for containerit
.