A container with binaries of bedtools and samtools
2.7K
Installation of BioContainers through quay. Generate a module, bash wrapper recipe and singularity image ready for take-off on a HPC cluster
Overall Tutorial
Presentation
Example:
I intend to install the star package.
Searching star in bioconda leads me to here
I select star/tags to see the quay repo.
I decide to install star version 2.7.0,
so I specify software_quay as 'star' and version_quay as '2.7.0d--0'
I then run the following
create_container_from_quay \
--yaml yamls/star.yaml \
--output-dir containers \
--module-template templates/module \
--bash-template templates/bash_wrapper.sh \
--singularity-template templates/Singularity._quay_.File
for file in `find -L containers -type f -not -name '*.simg'`; do
git add $file;
done
package_name='my_package'
for file in `find -L containers/${package_name} -type f -not -name '*.simg'`; do
git add $file;
done
git diff --name-only --cached
git diff --name-only
for recipe in `find containers -name '*.recipe'`; do
# Get image
image=${recipe%.recipe}.simg
# Build image
sudo singularity build $image $recipe
done
Chances are, your module files want to go to your MODULEPATH
so we'll leave them behind.
HPC_CONTAINER_PATH=/path/to/containers
rsync --links --archive --prune-empty-dirs \
--include='*/' --exclude='module' \
--verbose \
containers/ ${HPC_CONTAINER_PATH}/
In each module template, the CONTAINER_DIR variable component remains unset.
This way, modules are transferrable between HPC clusters and organisations.
To customise this to your HPC the following code should suffice.
You may wish to also fork this repo and change the module template.
HPC_CONTAINER_PATH=/path/to/containers
for module in `find containers -type f -name module`; do
sed -i "s%__CONTAINER_DIR__%${HPC_CONTAINER_PATH}%g" ${module}
done
HPC_MODULEPATH=/path/to/modules
for module in `find containers -type f -name module`; do
# Get software
software=$(basename $(dirname $(dirname $(dirname ${module}))))
# Get version
version=$(basename $(dirname $(dirname ${module})))
# Create software directory if it doesn't exist
mkdir -p ${HPC_MODULEPATH}/$software
# Copy module over to software
rsync --checksum $module ${HPC_MODULEPATH}/$software/$version
done
Check out the help component of the module file.
You should see by specifying DRY_RUN_<SOFTWARE> to '1', that you can enter dry-run mode for a given software.
You can also see the environment that the software would be running in by setting the dry-run environment variable to 2.
# I want to see what STAR would run (but not actually run it)
module load star
export DRY_RUN_STAR=1
STAR --help
This is likely due to /var/tmp existing during the installation of the job.
/var/tmp links to /tmp at run-time so likely your /var/tmp during installation is also just a link to /tmp
Append rm /var/tmp to the end of your %post script.
DO NOT delete /tmp during post, do not use rm -rf /var/tmp as this will likely delete the contents inside /tmp.
Since /tmp is mounted to /tmp to build time
This is the entire host's /tmp directory.
fgbio/0.8.0
If your container has been created with busybox, you're out of luck.
Your best bet is to use the bioconda singularity template. You'll need to rename the version_quay item in the yaml to the version in bioconda and use the Singularity.bioconda.File template rather than the quay template.
See the picard 2.18.27 recipe for as an example.
The quay container has a rogue link to it's /etc/resolv.conf. By default Singularity will mount this at runtime from the host (so it doesn't need to exist). In this case you will need to remove the link during the %post script.
See the fgbio 0.8.0 recipe as an example.
Content type
Image
Digest
Size
614.1 MB
Last updated
almost 7 years ago
docker pull agrf/bedtools-samtools:2.28.0.1.9