Discovery Containers

The HPC Team builds different containers on Discovery and makes them available through the environment module system.

Using Discovery Containers

To find a container on Discovery, you can use the module spider command as shown below:

module --terse --redirect spider SIF | grep SIF

Output

cst_studio_suite/2021-SIF
cst_studio_suite/2022-SIF
guppy/6.4.2-CPU-SIF
guppy/6.4.2-GPU-SIF
julia/1.6.7-SIF
julia/1.8.5-SIF
julia/1.9.2-SIF
julia/1.10.0-SIF
matlab/2022b-Proxy-Cuda-VSCode-Jupyter-SIF
matlab/2023a-Proxy-Cuda-VSCode-Jupyter-SIF
r/4.1.2-RStudio_Server_2022.02.2.485-SIF
r/4.1.3-RStudio_Server_2022.02.2.485-SIF
r/4.2.0-RStudio_Server_2022.02.2.485-SIF
r/4.2.3-RStudio_Server-VSCode-Jupyter-SIF
r/4.3.2-RStudio_Server-VSCode-Jupyter-SIF
saga-gis/7.3.0-VSCode-SIF
saga-gis/7.6.1-VSCode-SIF
saga-gis/8.5.0-VSCode-SIF
All modules that use Apptainer containers have a name that ends with -SIF.

To load a container in your environment, you need to find its module dependencies. For example, before loading r/4.1.2-RStudio_Server_2022.02.2.485-SIF module, run:

module spider r/4.1.2-RStudio_Server_2022.02.2.485-SIF

Output

--------------------------------------------------------------------------------------------------------------------------------------------------------------
  r: r/4.1.2-RStudio_Server_2022.02.2.485-SIF
--------------------------------------------------------------------------------------------------------------------------------------------------------------

    You will need to load all module(s) on any one of the lines below before the "r/4.1.2-RStudio_Server_2022.02.2.485-SIF" module is available to load.

      custom/2022a

    Help:
      For help contact your site administrators.

The above output shows that you need to load the custom/2022a module before loading the intended module.

module load custom/2022a

Now you can load the module:

module load r/4.1.2-RStudio_Server_2022.02.2.485-SIF

After the module is loaded, an environmental variable named SIF will be set to the full path to the container.

$ echo "$SIF"
/fs1/software/sstack/rhel_8/stacks/custom/2022a/packages/r/4.1.2-RStudio_Server_2022.02.2.485-SIF/R.sif

Helper binaries to access the equivalent executables inside the SIF container are commonly provided. These can be used just like any other non-containerized software instead of using the apptainer command.

For example, if you list the files in the path of the SIF file you will see two helper binaries, R and Rsript.

$ ls "$(dirname "$SIF")"
R  Rscript  R.sif

$ cat "$(dirname "$SIF")/R"
if [ -n "$XDG_RUNTIME_DIR" ] && [ -d "$XDG_RUNTIME_DIR" ]; then
	export APPTAINER_BIND="$XDG_RUNTIME_DIR"
else
	unset XDG_RUNTIME_DIR
fi

if [ -z "$CUDA_VISIBLE_DEVICES" ]; then
	apptainer exec "$SIF" r "$@"
else
	apptainer exec --nv "$SIF" r "$@"
fi

$ R --version
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under the terms of the
GNU General Public License versions 2 or 3.
For more information about these matters see
https://www.gnu.org/licenses/.
You can also use the apptainer command to interact with the container as shown in the page Using Containers.