Skip to content

Instantly share code, notes, and snippets.

Created May 4, 2017 20:32
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Complete bootstrap definition file, with runscript
# vim: ts=4 sw=4 noet
# Stanford Quake Lab bufferbox workflow container bootstrap
BootStrap: yum
OSVersion: 7
Include: perl
TMPDIR=`mktemp -d`
echo "(Files being downloaded to ${TMPDIR})"
echo 'Downloading and unpacking the workflow software...'
curl -o ${TMPDIR}/ ''
unzip ${TMPDIR}/ -d ${TMPDIR}
mkdir ${SINGULARITY_ROOTFS}/workflow
mv ${TMPDIR}/quake-bufferbox-workflow-release*/* ${SINGULARITY_ROOTFS}/workflow/
echo 'Downloading and installing bcl2fastq package...'
curl -o ${TMPDIR}/bcl2fastq.rpm '' || exit 1
rpm --root ${SINGULARITY_ROOTFS} -i ${TMPDIR}/bcl2fastq.rpm
echo 'Downloading and installing EPEL key and release package...'
curl -o ${TMPDIR}/epel-key.gpg ''
curl -o ${TMPDIR}/epel-release.rpm -L ''
rpm --root ${SINGULARITY_ROOTFS} --import ${TMPDIR}/epel-key.gpg
rpm --root ${SINGULARITY_ROOTFS} -i ${TMPDIR}/epel-release.rpm
echo 'Installing EPEL-based packages'
yum --installroot ${SINGULARITY_ROOTFS} -y install perl-Email-MIME perl-Email-Send
echo 'Cleaning up'
rmdir ${TMPDIR}/quake-bufferbox-workflow-release*
rm ${TMPDIR}/
rm ${TMPDIR}/bcl2fastq.rpm
rm ${TMPDIR}/epel-key.gpg ${TMPDIR}/epel-release.rpm
rmdir ${TMPDIR}
if [ $# -eq 0 ]; then
echo 'Hello! This is the Mr. Workflow runscript.'
echo 'Please run this again, with either "NextSeq" or "MiSeq" as the next parameter.'
echo 'That will run either the NextSeq workflow script, or the MiSeq workflow script.'
echo 'For example (if the container is called "container.img"):'
echo ' ./container.img nextseq scan path/to/runfolders'
echo ' ./container.img miseq deliver path/to/a/runfolder'
exit 0
case "${1,,}" in
exec /workflow/bbox-workflow-miseq $*
exec /workflow/bbox-workflow-nextseq $*
echo "I'm sorry; I didn't recognize what you want me to do."
echo "Please make 'nextseq' or 'miseq' the first argument, before anything else (like 'run' or 'scan')."
echo 'Thanks!'
exit 1
# Nothing should ever reach here!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment