forked from hail-is/hail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.pr-builder
111 lines (95 loc) · 4.09 KB
/
Dockerfile.pr-builder
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM debian:9.5
MAINTAINER Hail Team <[email protected]>
USER root
# - libnlopt-dev is for nloptr, a dependency of SKAT:
# https://github.com/jyypma/nloptr/issues/40
#
# - r-cran-ncdf4, r-cran-rnetcdf, libcurl4-openssl-dev, and libxml2-dve are
# - depenendencies for the three biolite packages
RUN apt-get update && \
apt-get -y install gnupg2 lsb-release curl apt-transport-https && \
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \
echo "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" >> /etc/apt/sources.list && \
echo "deb http://ftp.debian.org/debian $(lsb_release -cs) main contrib non-free" >> /etc/apt/sources.list && \
apt-get update && \
apt-get -y install \
bash \
cmake \
docker-ce \
g++ \
git \
libcurl4-openssl-dev \
liblz4-dev \
libnlopt-dev \
libxml2-dev \
openjdk-8-jdk-headless \
pandoc \
python3 \
python3-pip \
r-base \
r-cran-ncdf4 \
r-cran-rnetcdf \
tar \
unzip \
wget \
xsltproc \
&& \
pip3 install --no-cache-dir flake8 pylint && \
rm -rf /var/lib/apt/lists/*
RUN wget https://repo.anaconda.com/miniconda/Miniconda2-4.5.4-Linux-x86_64.sh -O miniconda.sh && \
/bin/bash miniconda.sh -b -p /opt/conda && \
rm miniconda.sh
ENV PATH $PATH:/opt/conda/bin
RUN Rscript -e 'install.packages(c("jsonlite", "SKAT", "logistf"), repos = "http://cran.us.r-project.org")' && \
Rscript -e 'source("https://bioconductor.org/biocLite.R"); biocLite("GENESIS"); biocLite("SNPRelate"); biocLite("GWASTools")'
# this seems easier than getting the keys right for apt
#
# source: https://cloud.google.com/storage/docs/gsutil_install#linux
RUN /bin/sh -c 'curl https://sdk.cloud.google.com | bash' && \
mv /root/google-cloud-sdk / && \
/google-cloud-sdk/bin/gcloud components install beta
ENV PATH $PATH:/google-cloud-sdk/bin
RUN wget -O /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.11.3/bin/linux/amd64/kubectl && \
chmod +x /usr/local/bin/kubectl
WORKDIR /spark
RUN wget -O spark-2.2.0-bin-hadoop2.7.tgz https://archive.apache.org/dist/spark/spark-2.2.0/spark-2.2.0-bin-hadoop2.7.tgz && \
tar --strip-components=1 -xvzf spark-2.2.0-bin-hadoop2.7.tgz -C /spark && \
rm -rf spark-2.2.0-bin-hadoop2.7.tgz
ENV SPARK_HOME /spark/
WORKDIR /plink
RUN wget -O plink_linux_x86_64.zip https://storage.googleapis.com/hail-common/plink_linux_x86_64_20181202.zip && \
unzip plink_linux_x86_64.zip && \
rm -rf plink_linux_x86_64.zip && \
ln -s /plink/plink /bin/plink
WORKDIR /qctool
RUN wget -O qctool_v2.0.1-CentOS6.8-x86_64.tgz http://www.well.ox.ac.uk/~gav/resources/qctool_v2.0.1-CentOS6.8-x86_64.tgz && \
tar --strip-components=1 -xvzf qctool_v2.0.1-CentOS6.8-x86_64.tgz -C /qctool && \
rm -rf qctool_v2.0.1-CentOS6.8-x86_64.tgz && \
ln -s /qctool/qctool /bin/qctool
RUN wget -O /usr/local/include/catch.hpp https://github.com/catchorg/Catch2/releases/download/v2.4.2/catch.hpp
# creates /hail
WORKDIR /hail
RUN mkdir -p /gradle-cache
COPY hail/gradlew hail/build.gradle hail/settings.gradle hail/deployed-spark-versions.txt ./
COPY hail/gradle gradle
COPY hail/python/hail/dev-environment.yml python/hail/dev-environment.yml
COPY batch/environment.yml batch/environment.yml
COPY ci/environment.yml ci/environment.yml
COPY pipeline/environment.yml pipeline/environment.yml
RUN useradd --create-home --shell /bin/bash hail && \
usermod -a -G docker hail && \
chown -R hail:hail /hail /gradle-cache
USER hail
# cache (almost all) gradle dependencies (and gradle itself)
#
# Some plugin we use hides its dependencies in a so-called "detached
# configuration" so there is no way for us to ensure it gets cached.
RUN ./gradlew downloadDependencies --gradle-user-home /gradle-cache
RUN conda env create -f ./python/hail/dev-environment.yml && \
conda env create -f batch/environment.yml && \
conda env create -f ci/environment.yml && \
conda env create -f pipeline/environment.yml && \
rm -rf /home/hail/.conda/pkgs/*
# gcloud iam key files will be stored here
VOLUME /secrets
WORKDIR /hail