From bdbbb9bf62b6dde8a0dc90e963665184fda4d1d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Clerget?= Date: Thu, 7 Oct 2021 17:48:25 +0200 Subject: [PATCH] Document restrictions/workaround regarding build and bind option --- build_a_container.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/build_a_container.rst b/build_a_container.rst index b057a61..c4d3d91 100755 --- a/build_a_container.rst +++ b/build_a_container.rst @@ -296,12 +296,24 @@ The ``--update`` option is only valid when used with sandbox containers. This flag allows you to mount the Nvidia CUDA libraries of your host into your build environment. Libraries are mounted during the execution of ``post`` and ``test`` sections. +.. note:: + + This option can't be set via the environment variable `SINGULARITY_NV`. + Singularity will attempt to bind binaries listed in SINGULARITY_CONFDIR/nvliblist.conf, + if the mount destination doesn't exist inside the container, they are ignored. + ``--rocm`` ========== This flag allows you to mount the AMD Rocm libraries of your host into your build environment. Libraries are mounted during the execution of ``post`` and ``test`` sections. +.. note:: + + This option can't be set via the environment variable `SINGULARITY_ROCM`. + Singularity will attempt to bind binaries listed in SINGULARITY_CONFDIR/rocmliblist.conf, + if the mount destination doesn't exist inside the container, they are ignored. + ``--bind`` ========== @@ -310,6 +322,25 @@ the same way as ``--bind`` for ``shell``, ``exec`` and ``run`` and can be specif multiple times, see :ref:`user defined bind paths `. Bind mount occurs during the execution of ``post`` and ``test`` sections. +.. note:: + + This option can't be set via the environment variables `SINGULARITY_BIND` and `SINGULARITY_BINDPATH` + +**Beware that the mount points must exist in the built image** prior to executing ``post`` and ``test``. +So if you want to bind ``--bind /example`` and it doesn't exist in the bootstrap image, you have to +workaround that by adding a ``setup`` section: + +.. code-block:: none + + %setup + mkdir $SINGULARITY_ROOTFS/example + +.. note:: + + Binding your directory to `/mnt` is another workaround, as this directory is often present in + distribution images and is intended for that purpose, you could avoid the directory creation + in the definition file. + ----------------- More Build topics -----------------