apptainerize {rang} | R Documentation |
Create an Apptainer/Singularity Definition File of The Resolved Result
Description
This function exports the result from resolve()
to an Apptainer/Singularity definition file. For R version >= 3.1.0, the file is based on the versioned Rocker Docker image.
For R version < 3.1.0, the Apptainer/Singularity definition is based on Debian and it compiles R from source.
Usage
apptainerize(
rang,
output_dir,
materials_dir = NULL,
post_installation_steps = NULL,
image = c("r-ver", "rstudio", "tidyverse", "verse", "geospatial"),
rang_as_comment = TRUE,
cache = FALSE,
verbose = TRUE,
lib = NA,
cran_mirror = "https://cran.r-project.org/",
check_cran_mirror = TRUE,
bioc_mirror = "https://bioconductor.org/packages/",
no_rocker = FALSE,
debian_version = c("lenny", "squeeze", "wheezy", "jessie", "stretch"),
skip_r17 = TRUE,
insert_readme = TRUE,
copy_all = FALSE
)
apptainerize_rang(...)
apptainerise(...)
apptainerise_rang(...)
singularize(...)
singularize_rang(...)
singularise(...)
singularise_rang(...)
Arguments
rang |
output from |
output_dir |
character, where to put the Apptainer/Singularity definition file and associated content |
materials_dir |
character, path to the directory containing additional resources (e.g. analysis scripts) to be copied into |
post_installation_steps |
character, additional steps to be added before the in the end of |
image |
character, which versioned Rocker image to use. Can only be "r-ver", "rstudio", "tidyverse", "verse", "geospatial" This applies only to R version >= 3.1 |
rang_as_comment |
logical, whether to write resolved result and the steps to reproduce
the file to |
cache |
logical, whether to cache the packages now. Please note that the system requirements are not cached. For query with non-CRAN packages, this option is strongly recommended. For query with local packages, this must be TRUE regardless of R version. For R version < 3.1, this must be also TRUE if there is any non-CRAN packages. |
verbose |
logical, pass to |
lib |
character, pass to |
cran_mirror |
character, which CRAN mirror to use |
check_cran_mirror |
logical, whether to check the CRAN mirror |
bioc_mirror |
character, which Bioconductor mirror to use |
no_rocker |
logical, whether to skip using Rocker images even when an appropriate version is available. Please keep this as |
debian_version |
when Rocker images are not used, which EOL version of Debian to use. Can only be "lenny", "etch", "squeeze", "wheezy", "jessie", "stretch". Please keep this as default "lenny" unless you know what you are doing |
skip_r17 |
logical, whether to skip R 1.7.x. Currently, it is not possible to compile R 1.7.x (R 1.7.0 and R 1.7.1) with the method provided by |
insert_readme |
logical, whether to insert a README file |
copy_all |
logical, whether to copy everything in the current directory into the container. If |
... |
arguments to be passed to |
Details
The idea behind this is to determine the installation order of R packages locally. Then, the installation script can be deployed to another
fresh R session to install R packages. dockerize()
and apptainerize()
are more reasonable ways because a fresh R session with all system requirements
is provided. The current approach does not work in R < 2.1.0.
Value
output_dir
, invisibly
References
Kurtzer, G. M., Sochat, V., & Bauer, M. W. (2017) Singularity: Scientific containers for mobility of compute. PLOS ONE, 12(5):e0177459. doi:10.1371/journal.pone.0177459
Ripley, B. (2005) Packages and their Management in R 2.1.0. R News, 5(1):8–11.
See Also
resolve()
, export_rang()
, use_rang()
Examples
if (interactive()) {
graph <- resolve(
pkgs = c("openNLP", "LDAvis", "topicmodels", "quanteda"),
snapshot_date = "2020-01-16"
)
apptainerize(graph, ".")
## An example of using post_installation_steps to install quarto
install_quarto <- c("apt-get install -y curl git && \\
curl -LO https://quarto.org/download/latest/quarto-linux-amd64.deb && \\
dpkg -i quarto-linux-amd64.deb && \\
quarto install tool tinytex")
apptainerize(graph, ".", post_installation_steps = install_quarto)
}