diff --git a/Dockerfile b/Dockerfile index 13b7873..0685cbc 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,52 +1,23 @@ -FROM ubuntu:14.04 - -RUN apt-get update -RUN apt-get upgrade -y - -# install python and PIP -RUN apt-get install python2.7 python2.7-dev -y -RUN apt-get install cython -y -RUN apt-get install python-setuptools -y -RUN apt-get install python-pip -y -RUN apt-get install python-numpy -y -RUN apt-get install zlib1g-dev -y -# ideally, we don't want to use the ubuntu version -# here because this bloats the Docker image -# RUN apt-get install python-pandas -y -RUN easy_install -U distribute - -# numpy and such -RUN apt-get install build-essential -y -RUN apt-get install gfortran -y -RUN apt-get install -y libatlas-base-dev -RUN apt-get install pkg-config -y +FROM ubuntu:16.04 + +RUN apt-get update && apt-get upgrade -y +RUN apt-get install build-essential zlib1g-dev libbz2-dev pkg-config cmake libncurses5-dev autoconf -y +RUN apt-get install git bzip2 wget -y +RUN apt-get install python2.7 python2.7-dev python \ + python-setuptools \ + python-pip \ + python-psutil \ + cython \ + python-numpy \ + python-pandas \ + python-distribute \ + python-pysam \ + python-scipy \ + -y RUN apt-get install software-properties-common python-software-properties -y -RUN apt-get install cmake -y - -# hap.py v0.3.7+ requires g++ 4.9 -RUN add-apt-repository ppa:ubuntu-toolchain-r/test -y -RUN apt-get update -RUN apt-get install g++-4.9 -y -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 -RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 50 +RUN apt-get clean -y -# upgrade to newest versions / install -RUN pip install --upgrade cython -RUN pip install --upgrade numpy -RUN pip install --upgrade pandas -RUN pip install pybedtools -RUN pip install pysam RUN pip install bx-python -RUN pip install scipy - -# boost and cmake for hap.py -RUN apt-get install libncurses5-dev -y -RUN apt-get install git -y -RUN apt-get install samtools -y -RUN apt-get install bzip2 -y -RUN apt-get install wget -y -RUN apt-get install libbz2-dev -y - RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ add-apt-repository -y ppa:webupd8team/java && \ @@ -55,8 +26,6 @@ RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true rm -rf /var/lib/apt/lists/* && \ rm -rf /var/cache/oracle-jdk8-installer -RUN apt-get clean -y - # copy git repository into the image RUN mkdir -p /opt/hap.py-source COPY . /opt/hap.py-source/ @@ -67,14 +36,6 @@ RUN mkdir -p /opt/hap.py-data # download HG19 reference data WORKDIR /opt/hap.py-data -# This downloads from UCSC -RUN /opt/hap.py-source/src/sh/make_hg19.sh - -# this downloads our copy from box.com (once available) -# RUN wget https://illumina.app.box.com/s/1vwpu1w23p2qupukjjlrenq81mrtth1z/hg19.fa.bz2 -O /opt/hap.py-source/src/data/hg19.fa.bz2 -# RUN bzcat /opt/hap.py-source/src/data/hg19.fa.bz2 > /opt/hap.py-data/hg19.fa -RUN samtools faidx /opt/hap.py-data/hg19.fa - # get + install ant WORKDIR /opt RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.7-bin.tar.gz && \ @@ -82,14 +43,15 @@ RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.7-bin.tar.gz rm apache-ant-1.9.7-bin.tar.gz ENV PATH $PATH:/opt/apache-ant-1.9.7/bin -# run hap.py installer in the image +# run hap.py installer in the image, don't run tests since we don't have a reference file WORKDIR /opt/hap.py-source -RUN HG19=/opt/hap.py-data/hg19.fa python install.py /opt/hap.py --with-rtgtools +RUN python install.py /opt/hap.py --with-rtgtools --no-tests +WORKDIR /opt/hap.py + +# run basic tests +RUN bin/test_haplotypes + +# remove source folder WORKDIR / RUN rm -rf /opt/hap.py-source -# Optionally set up I/O folders -# RUN mkdir /data && chgrp users /data && chmod a+rwx /data -# VOLUME /data -# RUN useradd happy -m -s /bin/bash -G users -# USER happy diff --git a/Dockerfile.ubuntu-with-tests b/Dockerfile.ubuntu-with-tests new file mode 100755 index 0000000..e23ce80 --- /dev/null +++ b/Dockerfile.ubuntu-with-tests @@ -0,0 +1,59 @@ +FROM ubuntu:16.04 + +RUN apt-get update && apt-get upgrade -y +RUN apt-get install build-essential zlib1g-dev libbz2-dev pkg-config cmake libncurses5-dev autoconf -y +RUN apt-get install git bzip2 wget -y +RUN apt-get install python2.7 python2.7-dev python \ + python-setuptools \ + python-pip \ + python-psutil \ + cython \ + python-numpy \ + python-pandas \ + python-distribute \ + python-pysam \ + python-scipy \ + -y +RUN apt-get install software-properties-common python-software-properties -y +RUN apt-get clean -y + +RUN pip install bx-python + +RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \ + add-apt-repository -y ppa:webupd8team/java && \ + apt-get update && \ + apt-get install -y oracle-java8-installer && \ + rm -rf /var/lib/apt/lists/* && \ + rm -rf /var/cache/oracle-jdk8-installer + +# copy git repository into the image +RUN mkdir -p /opt/hap.py-source +COPY . /opt/hap.py-source/ + +# make minimal HG19 reference sequence +RUN mkdir -p /opt/hap.py-data + +# get + install ant +WORKDIR /opt +RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.9.7-bin.tar.gz && \ + tar xzf apache-ant-1.9.7-bin.tar.gz && \ + rm apache-ant-1.9.7-bin.tar.gz +ENV PATH $PATH:/opt/apache-ant-1.9.7/bin + +# run hap.py installer in the image, don't run tests since we don't have a reference file +WORKDIR /opt/hap.py-source +RUN python install.py /opt/hap.py --with-rtgtools --no-tests + +# download HG19 reference data +# This downloads from UCSC +WORKDIR /opt/hap.py-data +ENV PATH $PATH:/opt/hap.py/bin +RUN /opt/hap.py-source/src/sh/make_hg19.sh && samtools faidx /opt/hap.py-data/hg19.fa +# Run tests +ENV HG19 /opt/hap.py-data/hg19.fa +WORKDIR /opt/hap.py +RUN /opt/hap.py-source/src/sh/run_tests.sh + +# remove source folder +WORKDIR / +RUN rm -rf /opt/hap.py-source diff --git a/RELEASES.md b/RELEASES.md index 020b723..7360d7f 100755 --- a/RELEASES.md +++ b/RELEASES.md @@ -5,6 +5,8 @@ | Ticket | Description | |---------|------------------------------------------------------------------------------------| | HAP-317 | Update htslib to 1.4.1 and always check for BCF conversion errors | +| HAP-318 | Update rtgtools to 3.8.1 | +| HAP-319 | Slimmer docker image without hg19 reference | ## v0.3.8 diff --git a/external/make_dependencies.sh b/external/make_dependencies.sh index 455a4c4..d129738 100755 --- a/external/make_dependencies.sh +++ b/external/make_dependencies.sh @@ -115,9 +115,9 @@ if [[ ! -z $BUILD_VCFEVAL ]]; then cd ${TLD} mkdir -p ${TLD}/rtg-tools cd rtg-tools - wget http://github.com/RealTimeGenomics/rtg-tools/archive/3.7.1.tar.gz -O ${TLD}/rtg-tools/rtg-tools.tar.gz + wget http://github.com/RealTimeGenomics/rtg-tools/archive/3.8.1.tar.gz -O ${TLD}/rtg-tools/rtg-tools.tar.gz tar xvf rtg-tools.tar.gz - cd rtg-tools-3.7.1 + cd rtg-tools-3.8.1 if [[ ! -z ${ANT_HOME} ]]; then $ANT_HOME/bin/ant zip-nojre @@ -126,7 +126,7 @@ if [[ ! -z $BUILD_VCFEVAL ]]; then fi cd .. - RTG_ZIPFILE=$(ls rtg-tools-3.7.1/dist/*-nojre.zip | head -1) + RTG_ZIPFILE=$(ls rtg-tools-3.8.1/dist/*-nojre.zip | head -1) RTG_BASE=$(basename $RTG_ZIPFILE -nojre.zip) jar xvf $RTG_ZIPFILE mv $RTG_BASE ${ISD}/libexec/rtg-tools-install diff --git a/happy.requirements.txt b/happy.requirements.txt index ad76a18..4f64c87 100755 --- a/happy.requirements.txt +++ b/happy.requirements.txt @@ -1,7 +1,8 @@ Cython numpy pandas -pybedtools +psutil +pip pysam nose scipy