From 25e11125149a7ddee4ab34e5d307c41205f00dec Mon Sep 17 00:00:00 2001
From: alex <alex@tls-tautenburg.de>
Date: Mon, 29 Aug 2022 19:19:10 +0000
Subject: [PATCH] Add information to use the Singularity cache for LINC

---
 docs/source/installation.rst |  2 +-
 docs/source/running.rst      | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/docs/source/installation.rst b/docs/source/installation.rst
index d19d7cd4..9f838cfd 100644
--- a/docs/source/installation.rst
+++ b/docs/source/installation.rst
@@ -45,7 +45,7 @@ Once you have installed `cwltool`_ or `toil`_ locally on your system, LINC will
     You will find more details how to run **LINC** within an image on the page :doc:`how to run the pipeline<running>`.
 
 Manual installation
---------------------------
+-------------------
 .. note::
     Skip this section if you want to run **LINC** using software containers.
 
diff --git a/docs/source/running.rst b/docs/source/running.rst
index 3b850225..bb7a0ac8 100644
--- a/docs/source/running.rst
+++ b/docs/source/running.rst
@@ -173,6 +173,25 @@ You can restart a pipeline if using ``toil`` through adding the parameter ``--re
     
     ``toil``'s ``--restart`` option is only useful if a temporary error has occured, since it will always reuse the workflow and the data it originally has started with. If those needed to be changed (software update/corrupted or missing data), you will have to delete the ``jobStore`` and start a fresh run.
 
+Running **LINC** with a cached Singularity image
+------------------------------------------------
+
+Typical reasons for which you would like to run **LINC** with a cached Singularity image:
+
+    * when running into a Docker pull limit.
+    * when compute nodes do not have an outbound connection to the internet or any similar firewall restrictions.
+
+In such cases you need to set a special CWL environment variable to make use of it:
+
+    $ export CWL_SINGULARITY_CACHE=<cachedir>
+    $ export SINGULARITY_TMPDIR=<cachedir>/tmp
+
+where ``<cachedir>`` is your chosen location of the Singularity image. When running **LINC**, the location of the ``<cachedir>`` should be visible from all compute nodes or machines you want to use. Once set simply restart your pipeline with ``--singularity`` and the image should be put into the right directory and be used for all steps.
+Setting ``$SINGULARITY_TMPDIR`` is optional and avoids temporary mounting of the images in your ``/tmp``-directory. This is particularly helpful if your ``/tmp``-directory does not have much disk space.
+If you need to update your **LINC** Singularity image, simply remove the ``astronrd_linc.sif`` file in your ``<cachedir>`` and clean the Singularity cache:
+
+    $ singularity cache clean
+
 Troubleshooting
 ---------------
 
-- 
GitLab