create_config: Backend configuration for containerisation

View source: R/config_create.R

create_configR Documentation

Backend configuration for containerisation

Description

It is advised to define the "BABELWHALE_BACKEND" environment variable as "docker" or "singularity".

When using singularity, also define the "SINGULARITY_CACHEDIR" environment variable, which is the folder where the singularity images will be cached.

When using apptainer, also define the "APPTAINER_CACHEDIR" environment variable, which is the folder where the singularity images will be cached.

Each TI method will require about 1GB of space.

Alternatively, you can create a config and save it using set_default_config().

Usage

create_config(
  backend = get_env_or_null("BABELWHALE_BACKEND") %||% detect_backend()
)

create_docker_config(environment_variables = character(0))

create_singularity_config(
  cache_dir = get_env_or_null("SINGULARITY_CACHEDIR") %||%
    get_env_or_null("APPTAINER_CACHEDIR") %||% ".singularity/",
  environment_variables = character(0)
)

get_default_config()

set_default_config(config, permanent = TRUE)

Arguments

backend

Which backend to use. Can be either "docker" or "singularity".

environment_variables

A character vector of environment variables. Format: c("ENVVAR=VALUE").

cache_dir

A folder in which to store the singularity images. A container typically requires 100MB to 2GB.

config

A config to save as default.

permanent

Whether or not to save the config file permanently

Examples

config <- create_docker_config()
set_default_config(config, permanent = FALSE)

config <- create_singularity_config(
  # ideally, this would be set to a non-temporary directory
  cache_dir = tempdir()
)
set_default_config(config, permanent = FALSE)


babelwhale documentation built on July 26, 2023, 5:24 p.m.