containerit
containerit copied to clipboard
Transparently expose different methods for finding dependencies
The user should be able to select which methods are applied to find the dependencies which are put in the Dockerfile. These might be combined or follow each other, and even depend on each other
- parsing-based (with
automagic
) - execution-based (for scripts and R Markdown files; might need previous
- sysreqs-based (for finding system dependencies)
- #176
These different steps should have a common API and be chainable, i.e. be able to rely on the previous results.
df <- dockerfile(from = "sessionInfo.Rdata", methods = c(cntnrt_parse, cntnrt_execute, cntnrt_sysdeps), ...)
Internally this might result in
df <- cntnrt_parse(from)
df <- cntnrt_execute(df, from, preinstallAlreadyDetectedPackages = TRUE)
df <- cntnrt_parse(df, from, goOnline = TRUE)
See also ideas in #101
Can also have one option cntnrt_all
that creates a union of all options, and cntnrit_parse
should be a union of cntnrt_automagic
and cntnrt_requirements
:
> library("requirements")
> require
require requireMethods requireNamespace requirements::
> requirements::req_
requirements::req_file requirements::req_code requirements::req_namespace
> requirements::req_file("main.Rmd")
[1] "rmarkdown" "sdmpredictors" "randomForest" "summarytools"
[5] "Boruta" "caret" "raster" "ggplot2"
[9] "GGally" "rgdal" "corrplot" "splitstackshape"
[13] "e1071"
> library("automagic")
> automagic::
automagic::automagic automagic::install_package_guess automagic::get_package_details automagic::install_deps_file
automagic::%>% automagic::make_deps_file automagic::parse_packages automagic::get_dependent_packages
> automagic::parse_packages("main.Rmd")
[1] "sdmpredictors" "randomForest" "summarytools" "Boruta"
[5] "caret" "raster" "ggplot2" "GGally"
[9] "rgdal" "corrplot" "splitstackshape" "e1071"
>
sysreqs
is still not on CRAN, see https://github.com/r-hub/sysreqs/issues/5