Skip to content

Commit debdf35

Browse files
committed
Add note on possibility of using --apptainer-args when running jobs with Apptainer/Singularity
1 parent c6cff2f commit debdf35

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

docs/snakefiles/deployment.rst

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ otherwise, it assumes the given specification to point to an existing environmen
422422
Running jobs in containers
423423
--------------------------
424424

425-
As an alternative to using Conda (see above), it is possible to define, for each rule, a (docker) container to use, e.g.,
425+
As an alternative to using Conda (see above), it is possible to define, for each rule, a (Docker) container to use, e.g.,
426426

427427
.. code-block:: python
428428
@@ -448,6 +448,10 @@ it will execute the job within a container that is spawned from the given image.
448448
Allowed image urls entail everything supported by apptainer (e.g., ``shub://`` and ``docker://``).
449449
However, ``docker://`` is preferred, as other container runtimes will be supported in the future (e.g. podman).
450450

451+
Note that the isolation of jobs running in containers depends on the container engine.
452+
For example, Docker does not pass any host environment variables to the container, whereas Apptainer/Singularity passes everything.
453+
To override the default behaviour, consider using ``--apptainer-args`` or ``--singularity-args``, e.g. to pass ``--cleanenv``.
454+
451455
Defining global container images
452456
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
453457

@@ -633,10 +637,10 @@ and reproduce the data analysis at any time in the future.
633637
Global workflow dependencies
634638
----------------------------
635639

636-
Often, your workflow will depend on some additional packages that need to be present
640+
Often, your workflow will depend on some additional packages that need to be present
637641
along with Snakemake in order to handle actions before any rule is executed.
638-
Classical examples for this are `pandas <https://pandas.pydata.org/>`_,
639-
`pep <https://pep.databio.org>`_ (also see :ref:`snakefiles-peps`) and
642+
Classical examples for this are `pandas <https://pandas.pydata.org/>`_,
643+
`pep <https://pep.databio.org>`_ (also see :ref:`snakefiles-peps`) and
640644
:ref:`storage plugins <storage-support>`.
641645

642646
Snakemake allows to define such global dependencies using a global ``conda`` directive
@@ -655,8 +659,8 @@ With ``envs/global.yaml`` containing e.g.::
655659
dependencies:
656660
- pandas=1.0.3
657661
- snakemake-storage-plugin-s3
658-
659-
Under the hood, this is implemented using `conda-inject <https://github.com/koesterlab/conda-inject>`_,
662+
663+
Under the hood, this is implemented using `conda-inject <https://github.com/koesterlab/conda-inject>`_,
660664
which modifies the python searchpath and the PATH variable on the fly during execution,
661665
pointing to additional environments that do not alter the environment in which Snakemake
662666
has been installed.

0 commit comments

Comments
 (0)