Skip to content

Commit ac49f01

Browse files
authored
Merge pull request #69 from cancerit/feature/docker
Feature/docker
2 parents 1f83f42 + 07a3bcd commit ac49f01

File tree

7 files changed

+310
-77
lines changed

7 files changed

+310
-77
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/LICENCE
2+
/prerelease.sh
3+
/README.md
4+
/INSTALL
5+
/LICENCE
6+
/CHANGES.md
7+
/.gitignore
8+
/.git
9+
/perl/docs
10+
/perl/docs.tar.gz

.travis.yml

Lines changed: 23 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,30 @@ notifications:
22
slack: wtsi-cgpit:ptUMR1tkNyZJYd9TpGoss8WR
33
email: false
44

5-
env:
6-
- CC=gcc
5+
sudo: false
76

8-
addons:
9-
apt:
10-
update: true
11-
packages:
12-
- build-essential
13-
- autoconf
14-
- bsdtar
15-
- time
16-
- curl
17-
- libcurl4-openssl-dev
18-
- nettle-dev
19-
- zlib1g-dev
20-
- libncurses5-dev
21-
- libpstreams-dev
22-
- unzip
23-
- libpng12-dev
24-
- libexpat1-dev
25-
- libgoogle-perftools-dev
26-
- lsof
27-
- libbz2-dev
28-
- liblzma-dev
29-
- libgnutls-dev
30-
- libtasn1-6-dev
31-
- p11-kit
32-
- libxml2-dev
33-
- libgd-dev
34-
- psmisc
35-
- libdb-dev
36-
37-
install: true
38-
39-
language: perl
40-
41-
perl:
42-
- "5.22-shrplib"
7+
services:
8+
- docker
439

4410
script:
4511
- set -e
46-
- export PATH=$HOME/install/bin:$HOME/install/biobambam2/bin:$PATH
47-
- git clone --depth 1 --single-branch --branch develop https://github.com/cancerit/cgpBigWig.git
48-
- cd cgpBigWig
49-
- ./setup.sh $HOME/PCAP-opt
50-
- cd ../
51-
- git clone --depth 1 --single-branch --branch develop https://github.com/cancerit/PCAP-core.git
52-
- cd PCAP-core
53-
- ./setup.sh $HOME/PCAP-opt
54-
- cd ../
55-
- git clone --depth 1 --single-branch --branch dev https://github.com/cancerit/cgpVcf.git
56-
- cd cgpVcf
57-
- ./setup.sh $HOME/PCAP-opt
58-
- cd ../
59-
- ./setup.sh $HOME/PCAP-opt
12+
- echo 'Build and check docker image'
13+
- docker build -t cgppindel .
14+
- docker images | grep -c cgppindel
15+
- echo 'Verify program(s) from each inherited base image - dockstore-cgpbigwig'
16+
- docker run -t --rm cgppindel bwjoin --version
17+
- echo 'Verify program(s) from each inherited base image - dockstore-cgpmap'
18+
- docker run -t --rm cgppindel bwa_mem.pl -version
19+
- docker run -t --rm cgppindel bammarkduplicates2 --version
20+
- docker run -t --rm cgppindel samtools --version
21+
- docker run -t --rm cgppindel bash -c 'bwa 2>&1 | grep Version'
22+
- echo 'Verify program(s) from this repo'
23+
- docker run -t --rm cgppindel pindel.pl --version
24+
- docker run -t --rm cgppindel pindel_input_gen.pl --version
25+
- docker run -t --rm cgppindel pindel_2_combined_vcf.pl --version
26+
- docker run -t --rm cgppindel FlagVcf.pl --version
27+
- docker run -t --rm cgppindel pindel_merge_vcf_bam.pl --version
28+
- docker run -t --rm cgppindel pindel_np_from_vcf.pl --version
29+
- docker run -t --rm cgppindel pindel_germ_bed.pl --version
30+
- docker run -t --rm cgppindel which pindel
31+
- docker run -t --rm cgppindel which filter_pindel_reads

CHANGES.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGES
22

3+
## NEXT
4+
5+
* Added Dockerfile and docker documentation
6+
37
## 3.2.0
48

59
* Tabix search for high depth/excluded regions now performed in memory using IntervalTrees
@@ -153,15 +157,4 @@ Comparing sites in VCF files...
153157
Found 15321 SNPs common to both files.
154158
Found 0 SNPs only in main file.
155159
Found 0 SNPs only in second file.
156-
After filtering, kept 16309 out of a possible 16309 Sites
157-
Run Time = 6.00 seconds
158-
```
159-
160-
## 2.0.4
161-
162-
* Permits empty results files
163-
164-
## 2.0.0
165-
166-
* Migrates all Tabix and Bio::DB::Sam to Bio::DB::HTS::Tabix and Bio::DB::Sam
167-
* Cleans up install
160+
After

Dockerfile

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
FROM quay.io/wtsicgp/dockstore-cgpmap:3.1.4 as builder
2+
3+
USER root
4+
5+
# ALL tool versions used by opt-build.sh
6+
ENV VER_CGPVCF="v2.2.1"
7+
ENV VER_VCFTOOLS="0.1.16"
8+
9+
RUN apt-get -yq update
10+
RUN apt-get install -yq --no-install-recommends \
11+
locales \
12+
g++ \
13+
make \
14+
gcc \
15+
pkg-config \
16+
zlib1g-dev
17+
18+
RUN locale-gen en_US.UTF-8
19+
RUN update-locale LANG=en_US.UTF-8
20+
21+
ENV OPT /opt/wtsi-cgp
22+
ENV PATH $OPT/bin:$OPT/biobambam2/bin:$PATH
23+
ENV PERL5LIB $OPT/lib/perl5
24+
ENV LD_LIBRARY_PATH $OPT/lib
25+
ENV LC_ALL en_US.UTF-8
26+
ENV LANG en_US.UTF-8
27+
28+
# build tools from other repos
29+
ADD build/opt-build.sh build/
30+
RUN bash build/opt-build.sh $OPT
31+
32+
# build the tools in this repo, separate to reduce build time on errors
33+
COPY . .
34+
RUN bash build/opt-build-local.sh $OPT
35+
36+
FROM ubuntu:16.04
37+
38+
LABEL maintainer="cgphelp@sanger.ac.uk" \
39+
uk.ac.sanger.cgp="Cancer, Ageing and Somatic Mutation, Wellcome Trust Sanger Institute" \
40+
version="1.0.0" \
41+
description="cgpPindel docker"
42+
43+
RUN apt-get -yq update
44+
RUN apt-get install -yq --no-install-recommends \
45+
apt-transport-https \
46+
locales \
47+
curl \
48+
ca-certificates \
49+
libperlio-gzip-perl \
50+
bzip2 \
51+
psmisc \
52+
time \
53+
zlib1g \
54+
liblzma5 \
55+
libncurses5 \
56+
p11-kit \
57+
unattended-upgrades && \
58+
unattended-upgrade -d -v && \
59+
apt-get remove -yq unattended-upgrades && \
60+
apt-get autoremove -yq
61+
62+
RUN locale-gen en_US.UTF-8
63+
RUN update-locale LANG=en_US.UTF-8
64+
65+
ENV OPT /opt/wtsi-cgp
66+
ENV PATH $OPT/bin:$OPT/biobambam2/bin:$PATH
67+
ENV PERL5LIB $OPT/lib/perl5
68+
ENV LD_LIBRARY_PATH $OPT/lib
69+
ENV LC_ALL en_US.UTF-8
70+
ENV LANG en_US.UTF-8
71+
72+
RUN mkdir -p $OPT
73+
COPY --from=builder $OPT $OPT
74+
75+
## USER CONFIGURATION
76+
RUN adduser --disabled-password --gecos '' ubuntu && chsh -s /bin/bash && mkdir -p /home/ubuntu
77+
78+
USER ubuntu
79+
WORKDIR /home/ubuntu
80+
81+
CMD ["/bin/bash"]

README.md

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
cgpPindel contains the Cancer Genome Projects workflow for [Pindel][pindel-core].
44

5+
[![Quay Badge][quay-status]][quay-repo]
6+
57
| Master | Develop |
68
| --------------------------------------------- | ----------------------------------------------- |
79
| [![Master Badge][travis-master]][travis-base] | [![Develop Badge][travis-develop]][travis-base] |
@@ -18,25 +20,30 @@ Contents:
1820

1921
<!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 -->
2022

21-
- [Docker, Singularity and Dockstore](#docker-singularity-and-dockstore)
22-
- [Dependencies/Install](#dependenciesinstall)
23-
- [Creating a release](#creating-a-release)
24-
- [Preparation](#preparation)
25-
- [Cutting the release](#cutting-the-release)
26-
- [LICENCE](#licence)
23+
- [cgpPindel](#cgppindel)
24+
- [Docker, Singularity and Dockstore](#docker-singularity-and-dockstore)
25+
- [Dependencies/Install](#dependenciesinstall)
26+
- [Creating a release](#creating-a-release)
27+
- [Preparation](#preparation)
28+
- [Release process](#release-process)
29+
- [Code changes](#code-changes)
30+
- [Docker image](#docker-image)
31+
- [Cutting the release](#cutting-the-release)
32+
- [LICENCE](#licence)
2733

2834
<!-- /TOC -->
2935

3036
## Docker, Singularity and Dockstore
3137

3238
There are pre-built images containing this codebase on quay.io.
3339

40+
* [cgpPindel][cgpPindel-git]: Contained within this repository - contains the cgpPindel package
3441
* [dockstore-cgpwxs][ds-cgpwxs-git]: Contains tools specific to WXS analysis.
3542
* [dockstore-cgpwgs][ds-cgpwgs-git]: Contains additional tools for WGS analysis.
3643

3744
These were primarily designed for use with dockstore.org but can be used as normal containers.
3845

39-
The docker images are know to work correctly after import into a singularity image.
46+
The docker images are known to work correctly after import into a singularity image.
4047

4148
## Dependencies/Install
4249

@@ -66,15 +73,34 @@ Please be aware that this expects basic C compilation libraries and tools to be
6673
* Commit/push all relevant changes.
6774
* Pull a clean version of the repo and use this for the following steps.
6875

69-
### Cutting the release
76+
### Release process
77+
78+
This project is maintained using HubFlow.
79+
80+
#### Code changes
81+
82+
1. Make appropriate changes
83+
2. Update `perl/lib/Sanger/CGP/Pindel.pm` to the correct version (adding rc/beta to end if applicable).
84+
3. Update `CHANGES.md` to show major items.
85+
4. Run `./prerelease.sh`
86+
5. Check all tests and coverage reports are acceptable.
87+
6. Commit the updated docs and updated module/version.
88+
7. Push commits.
89+
90+
#### Docker image
7091

71-
1. Update `perl/lib/Sanger/CGP/Pindel.pm` to the correct version (adding rc/beta to end if applicable).
72-
1. Update `CHANGES.md` to show major items.
73-
1. Run `./prerelease.sh`
74-
1. Check all tests and coverage reports are acceptable.
75-
1. Commit the updated docs and updated module/version.
76-
1. Push commits.
7792
1. Use the GitHub tools to draft a release.
93+
2. Build image locally
94+
3. Run example inputs and verify any changes are acceptable
95+
4. Bump version in `Dockerfile`
96+
5. Push changes
97+
98+
#### Cutting the release
99+
100+
1. Check state on Travis
101+
2. Generate the release (add notes to GitHub)
102+
3. Confirm that image has been built on [quay.io][quay-builds]
103+
4. Update the [dockstore][dockstore-cgpPindel] entry, see [their docs][dockstore-get-started].
78104

79105
## LICENCE
80106

@@ -114,9 +140,18 @@ identical to a statement that reads ‘Copyright (c) 2005, 2006, 2007, 2008,
114140
[pcap-core-rel]: https://github.com/cancerit/PCAP-core/releases
115141
[ds-cgpwxs-git]: https://github.com/cancerit/dockstore-cgpwxs
116142
[ds-cgpwgs-git]: https://github.com/cancerit/dockstore-cgpwgs
143+
[cgpPindel-git]: https://github.com/cancerit/cgpPindel
117144
[pindel-core]: http://gmt.genome.wustl.edu/pindel/current
118145

119146
<!-- Travis -->
120147
[travis-base]: https://travis-ci.org/cancerit/cgpPindel
121148
[travis-master]: https://travis-ci.org/cancerit/cgpPindel.svg?branch=master
122149
[travis-develop]: https://travis-ci.org/cancerit/cgpPindel.svg?branch=dev
150+
151+
<!-- Quay.io -->
152+
[quay-status]: https://quay.io/repository/wtsicgp/cgpPindel/status
153+
[quay-repo]: https://quay.io/repository/wtsicgp/cgpPindel
154+
[quay-builds]: https://quay.io/repository/wtsicgp/cgpPindel?tab=builds
155+
156+
<!-- Dockstore -->
157+
[dockstore-cgpPindel]: https://dockstore.org/containers/quay.io/wtsicgp/cgpPindel

build/opt-build-local.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#! /bin/bash
2+
3+
set -xe
4+
5+
if [[ -z "${TMPDIR}" ]]; then
6+
TMPDIR=/tmp
7+
fi
8+
9+
set -u
10+
11+
if [ "$#" -lt "1" ] ; then
12+
echo "Please provide an installation path such as /opt/ICGC"
13+
exit 1
14+
fi
15+
16+
# get path to this script
17+
SCRIPT_PATH=`dirname $0`;
18+
SCRIPT_PATH=`(cd $SCRIPT_PATH && pwd)`
19+
20+
# get the location to install to
21+
INST_PATH=$1
22+
mkdir -p $1
23+
INST_PATH=`(cd $1 && pwd)`
24+
echo $INST_PATH
25+
26+
# get current directory
27+
INIT_DIR=`pwd`
28+
29+
CPU=`grep -c ^processor /proc/cpuinfo`
30+
if [ $? -eq 0 ]; then
31+
if [ "$CPU" -gt "6" ]; then
32+
CPU=6
33+
fi
34+
else
35+
CPU=1
36+
fi
37+
echo "Max compilation CPUs set to $CPU"
38+
39+
SETUP_DIR=$INIT_DIR/install_tmp
40+
mkdir -p $SETUP_DIR/distro # don't delete the actual distro directory until the very end
41+
mkdir -p $INST_PATH/bin
42+
cd $SETUP_DIR
43+
44+
# make sure tools installed can see the install loc of libraries
45+
set +u
46+
export LD_LIBRARY_PATH=`echo $INST_PATH/lib:$LD_LIBRARY_PATH | perl -pe 's/:\$//;'`
47+
export PATH=`echo $INST_PATH/bin:$PATH | perl -pe 's/:\$//;'`
48+
export MANPATH=`echo $INST_PATH/man:$INST_PATH/share/man:$MANPATH | perl -pe 's/:\$//;'`
49+
export PERL5LIB=`echo $INST_PATH/lib/perl5:$PERL5LIB | perl -pe 's/:\$//;'`
50+
set -u
51+
52+
## cgpPindel - should be the build root
53+
if [ ! -e $SETUP_DIR/cgpPindel.success ]; then
54+
cd $INIT_DIR
55+
if [ ! -e $SETUP_DIR/cgpPindel_c.success ]; then
56+
g++ -O3 -o $INST_PATH/bin/pindel c++/pindel.cpp
57+
g++ -O3 -o $INST_PATH/bin/filter_pindel_reads c++/filter_pindel_reads.cpp
58+
touch $SETUP_DIR/cgpPindel_c.success
59+
fi
60+
cd perl
61+
cpanm --no-interactive --notest --mirror http://cpan.metacpan.org --notest -l $INST_PATH --installdeps .
62+
cpanm -v --no-interactive --mirror http://cpan.metacpan.org -l $INST_PATH .
63+
cd $SETUP_DIR
64+
touch $SETUP_DIR/cgpPindel.success
65+
fi

0 commit comments

Comments
 (0)