Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document restrictions/workaround regarding build and bind option #411

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions build_a_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
DrDaveD marked this conversation as resolved.
Show resolved Hide resolved

.. 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``
==========

Expand All @@ -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 <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
-----------------
Expand Down