Setup Singularity cache

Setup singularity cache

You can configure the cache by setting the CWL_SINGULARITY_CACHE env variable.

If you are on juno:

For argos-cwl the cache is already setup:

export CWL_SINGULARITY_CACHE=/juno/work/ci/cwl_singularity_cache

If you are using another cwl or you want to generate your own cache:

Create a folder for your cache and set it to [cache] in this template. It must be in /juno/work if you want to use lsf

/juno/work/ci/docker_extract/update_cache.sh -s [cache] -c [cwl_path]
export CWL_SINGULARITY_CACHE=[cache]

If you are not on juno or you want to set up the cache manually:

Create a new venv, source it and upgrade pip

Make sure to create a new venv to avoid conflicts with the TOIL venv

python3 -m venv cwl_utils_venv
source cwl_utils_venv/bin/activate
pip install --upgrade pip

Install cwl-utils

pip install "git+https://github.com/mskcc/cwl-utils.git"

Load singularity

module load singularity/3.7.1

Create the cache

mkdir [cache]
docker_extract.py -s [cache] [path_to_cwl]

Setup automatic cache generation

CWL can also build the cache dynamically as it is running the workflow. In our experience, this can have issues if you have new images that need to be added to the cache

export SINGULARITY_CACHEDIR=$PWD/singularity_cache

Make sure to use SINGULARITY_CACHEDIR for the cache directory instead of CWL_SINGULARITY_CACHE when running the workflow

Last updated

Was this helpful?