|
a |
|
b/Dockerfile |
|
|
1 |
# Copyright 2019 Google LLC. |
|
|
2 |
# This is used to build the DeepVariant release docker image. |
|
|
3 |
# It can also be used to build local images, especially if you've made changes |
|
|
4 |
# to the code. |
|
|
5 |
# Example command: |
|
|
6 |
# $ git clone https://github.com/google/deepvariant.git |
|
|
7 |
# $ cd deepvariant |
|
|
8 |
# $ sudo docker build -t deepvariant . |
|
|
9 |
# |
|
|
10 |
# To build for GPU, use a command like: |
|
|
11 |
# $ sudo docker build --build-arg=FROM_IMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 --build-arg=DV_GPU_BUILD=1 -t deepvariant_gpu . |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
ARG FROM_IMAGE=ubuntu:22.04 |
|
|
15 |
# PYTHON_VERSION is also set in settings.sh. |
|
|
16 |
ARG PYTHON_VERSION=3.10 |
|
|
17 |
ARG DV_GPU_BUILD=0 |
|
|
18 |
ARG VERSION=1.8.0 |
|
|
19 |
ARG TF_ENABLE_ONEDNN_OPTS=1 |
|
|
20 |
|
|
|
21 |
FROM continuumio/miniconda3 as conda_setup |
|
|
22 |
RUN conda config --add channels defaults && \ |
|
|
23 |
conda config --add channels bioconda && \ |
|
|
24 |
conda config --add channels conda-forge |
|
|
25 |
RUN conda create -n bio \ |
|
|
26 |
bioconda::bcftools=1.15 \ |
|
|
27 |
bioconda::samtools=1.15 \ |
|
|
28 |
&& conda clean -a |
|
|
29 |
|
|
|
30 |
FROM ${FROM_IMAGE} as builder |
|
|
31 |
COPY --from=conda_setup /opt/conda /opt/conda |
|
|
32 |
LABEL maintainer="https://github.com/google/deepvariant/issues" |
|
|
33 |
|
|
|
34 |
ARG DV_GPU_BUILD |
|
|
35 |
ENV DV_GPU_BUILD=${DV_GPU_BUILD} |
|
|
36 |
ENV DV_BIN_PATH=/opt/deepvariant/bin |
|
|
37 |
|
|
|
38 |
# Copying DeepVariant source code |
|
|
39 |
COPY . /opt/deepvariant |
|
|
40 |
|
|
|
41 |
ARG VERSION |
|
|
42 |
ENV VERSION=${VERSION} |
|
|
43 |
|
|
|
44 |
WORKDIR /opt/deepvariant |
|
|
45 |
|
|
|
46 |
RUN echo "Acquire::http::proxy \"$http_proxy\";\n" \ |
|
|
47 |
"Acquire::https::proxy \"$https_proxy\";" > "/etc/apt/apt.conf" |
|
|
48 |
|
|
|
49 |
RUN ./build-prereq.sh \ |
|
|
50 |
&& PATH="${HOME}/bin:${PATH}" ./build_release_binaries.sh # PATH for bazel |
|
|
51 |
|
|
|
52 |
FROM ${FROM_IMAGE} |
|
|
53 |
ARG DV_GPU_BUILD |
|
|
54 |
ARG VERSION |
|
|
55 |
ARG PYTHON_VERSION |
|
|
56 |
ARG TF_ENABLE_ONEDNN_OPTS |
|
|
57 |
ENV DV_GPU_BUILD=${DV_GPU_BUILD} |
|
|
58 |
ENV VERSION ${VERSION} |
|
|
59 |
ENV PYTHON_VERSION ${PYTHON_VERSION} |
|
|
60 |
ENV TF_ENABLE_ONEDNN_OPTS ${TF_ENABLE_ONEDNN_OPTS} |
|
|
61 |
|
|
|
62 |
RUN echo "Acquire::http::proxy \"$http_proxy\";\n" \ |
|
|
63 |
"Acquire::https::proxy \"$https_proxy\";" > "/etc/apt/apt.conf" |
|
|
64 |
|
|
|
65 |
WORKDIR /opt/ |
|
|
66 |
COPY --from=builder /opt/deepvariant/bazel-bin/licenses.zip . |
|
|
67 |
|
|
|
68 |
WORKDIR /opt/deepvariant/bin/ |
|
|
69 |
COPY --from=builder /opt/conda /opt/conda |
|
|
70 |
COPY --from=builder /opt/deepvariant/run-prereq.sh . |
|
|
71 |
COPY --from=builder /opt/deepvariant/settings.sh . |
|
|
72 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/make_examples.zip . |
|
|
73 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/call_variants.zip . |
|
|
74 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/postprocess_variants.zip . |
|
|
75 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/vcf_stats_report.zip . |
|
|
76 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/show_examples.zip . |
|
|
77 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/runtime_by_region_vis.zip . |
|
|
78 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/multisample_make_examples.zip . |
|
|
79 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/labeler/labeled_examples_to_vcf.zip . |
|
|
80 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/make_examples_somatic.zip . |
|
|
81 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/train.zip . |
|
|
82 |
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/fast_pipeline . |
|
|
83 |
COPY --from=builder /opt/deepvariant/scripts/run_deepvariant.py . |
|
|
84 |
COPY --from=builder /opt/deepvariant/scripts/run_deepsomatic.py . |
|
|
85 |
|
|
|
86 |
RUN ./run-prereq.sh |
|
|
87 |
|
|
|
88 |
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 0 && \ |
|
|
89 |
update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 0 |
|
|
90 |
|
|
|
91 |
# Create shell wrappers for python zip files for easier use. |
|
|
92 |
RUN \ |
|
|
93 |
BASH_HEADER='#!/bin/bash' && \ |
|
|
94 |
printf "%s\n%s\n" \ |
|
|
95 |
"${BASH_HEADER}" \ |
|
|
96 |
'python3 /opt/deepvariant/bin/make_examples.zip "$@"' > \ |
|
|
97 |
/opt/deepvariant/bin/make_examples && \ |
|
|
98 |
printf "%s\n%s\n" \ |
|
|
99 |
"${BASH_HEADER}" \ |
|
|
100 |
'python3 /opt/deepvariant/bin/call_variants.zip "$@"' > \ |
|
|
101 |
/opt/deepvariant/bin/call_variants && \ |
|
|
102 |
printf "%s\n%s\n" \ |
|
|
103 |
"${BASH_HEADER}" \ |
|
|
104 |
'python3 /opt/deepvariant/bin/postprocess_variants.zip "$@"' > \ |
|
|
105 |
/opt/deepvariant/bin/postprocess_variants && \ |
|
|
106 |
printf "%s\n%s\n" \ |
|
|
107 |
"${BASH_HEADER}" \ |
|
|
108 |
'python3 /opt/deepvariant/bin/vcf_stats_report.zip "$@"' > \ |
|
|
109 |
/opt/deepvariant/bin/vcf_stats_report && \ |
|
|
110 |
printf "%s\n%s\n" \ |
|
|
111 |
"${BASH_HEADER}" \ |
|
|
112 |
'python3 /opt/deepvariant/bin/show_examples.zip "$@"' > \ |
|
|
113 |
/opt/deepvariant/bin/show_examples && \ |
|
|
114 |
printf "%s\n%s\n" \ |
|
|
115 |
"${BASH_HEADER}" \ |
|
|
116 |
'python3 /opt/deepvariant/bin/runtime_by_region_vis.zip "$@"' > \ |
|
|
117 |
/opt/deepvariant/bin/runtime_by_region_vis && \ |
|
|
118 |
printf "%s\n%s\n" \ |
|
|
119 |
"${BASH_HEADER}" \ |
|
|
120 |
'python3 /opt/deepvariant/bin/multisample_make_examples.zip "$@"' > \ |
|
|
121 |
/opt/deepvariant/bin/multisample_make_examples && \ |
|
|
122 |
printf "%s\n%s\n" \ |
|
|
123 |
"${BASH_HEADER}" \ |
|
|
124 |
'python3 -u /opt/deepvariant/bin/labeled_examples_to_vcf.zip "$@"' > \ |
|
|
125 |
/opt/deepvariant/bin/labeled_examples_to_vcf && \ |
|
|
126 |
printf "%s\n%s\n" \ |
|
|
127 |
"${BASH_HEADER}" \ |
|
|
128 |
'python3 -u /opt/deepvariant/bin/make_examples_somatic.zip "$@"' > \ |
|
|
129 |
/opt/deepvariant/bin/make_examples_somatic && \ |
|
|
130 |
printf "%s\n%s\n" \ |
|
|
131 |
"${BASH_HEADER}" \ |
|
|
132 |
'python3 -u /opt/deepvariant/bin/run_deepvariant.py "$@"' > \ |
|
|
133 |
/opt/deepvariant/bin/run_deepvariant && \ |
|
|
134 |
printf "%s\n%s\n" \ |
|
|
135 |
"${BASH_HEADER}" \ |
|
|
136 |
'python3 -u /opt/deepvariant/bin/run_deepsomatic.py "$@"' > \ |
|
|
137 |
/opt/deepvariant/bin/run_deepsomatic && \ |
|
|
138 |
printf "%s\n%s\n" \ |
|
|
139 |
"${BASH_HEADER}" \ |
|
|
140 |
'python3 /opt/deepvariant/bin/train.zip "$@"' > \ |
|
|
141 |
/opt/deepvariant/bin/train && \ |
|
|
142 |
chmod +x /opt/deepvariant/bin/make_examples \ |
|
|
143 |
/opt/deepvariant/bin/call_variants \ |
|
|
144 |
/opt/deepvariant/bin/postprocess_variants \ |
|
|
145 |
/opt/deepvariant/bin/vcf_stats_report \ |
|
|
146 |
/opt/deepvariant/bin/show_examples \ |
|
|
147 |
/opt/deepvariant/bin/runtime_by_region_vis \ |
|
|
148 |
/opt/deepvariant/bin/multisample_make_examples \ |
|
|
149 |
/opt/deepvariant/bin/run_deepvariant \ |
|
|
150 |
/opt/deepvariant/bin/run_deepsomatic \ |
|
|
151 |
/opt/deepvariant/bin/labeled_examples_to_vcf \ |
|
|
152 |
/opt/deepvariant/bin/make_examples_somatic \ |
|
|
153 |
/opt/deepvariant/bin/train |
|
|
154 |
|
|
|
155 |
# Copy models |
|
|
156 |
WORKDIR /opt/models/wgs |
|
|
157 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wgs.savedmodel/fingerprint.pb . |
|
|
158 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wgs.savedmodel/saved_model.pb . |
|
|
159 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wgs.savedmodel/example_info.json . |
|
|
160 |
WORKDIR /opt/models/wgs/variables |
|
|
161 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wgs.savedmodel/variables/variables.data-00000-of-00001 . |
|
|
162 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wgs.savedmodel/variables/variables.index . |
|
|
163 |
RUN chmod -R +r /opt/models/wgs/* |
|
|
164 |
|
|
|
165 |
WORKDIR /opt/models/wes |
|
|
166 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wes.savedmodel/fingerprint.pb . |
|
|
167 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wes.savedmodel/saved_model.pb . |
|
|
168 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wes.savedmodel/example_info.json . |
|
|
169 |
WORKDIR /opt/models/wes/variables |
|
|
170 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wes.savedmodel/variables/variables.data-00000-of-00001 . |
|
|
171 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.wes.savedmodel/variables/variables.index . |
|
|
172 |
RUN chmod -R +r /opt/models/wes/* |
|
|
173 |
|
|
|
174 |
WORKDIR /opt/models/pacbio |
|
|
175 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.pacbio.savedmodel/fingerprint.pb . |
|
|
176 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.pacbio.savedmodel/saved_model.pb . |
|
|
177 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.pacbio.savedmodel/example_info.json . |
|
|
178 |
WORKDIR /opt/models/pacbio/variables |
|
|
179 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.pacbio.savedmodel/variables/variables.data-00000-of-00001 . |
|
|
180 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.pacbio.savedmodel/variables/variables.index . |
|
|
181 |
RUN chmod -R +r /opt/models/pacbio/* |
|
|
182 |
|
|
|
183 |
WORKDIR /opt/models/hybrid_pacbio_illumina |
|
|
184 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.hybrid.savedmodel/fingerprint.pb . |
|
|
185 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.hybrid.savedmodel/saved_model.pb . |
|
|
186 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.hybrid.savedmodel/example_info.json . |
|
|
187 |
WORKDIR /opt/models/hybrid_pacbio_illumina/variables |
|
|
188 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.hybrid.savedmodel/variables/variables.data-00000-of-00001 . |
|
|
189 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.hybrid.savedmodel/variables/variables.index . |
|
|
190 |
RUN chmod -R +r /opt/models/hybrid_pacbio_illumina/* |
|
|
191 |
|
|
|
192 |
WORKDIR /opt/models/ont_r104 |
|
|
193 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.ont.savedmodel/fingerprint.pb . |
|
|
194 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.ont.savedmodel/saved_model.pb . |
|
|
195 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.ont.savedmodel/example_info.json . |
|
|
196 |
WORKDIR /opt/models/ont_r104/variables |
|
|
197 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.ont.savedmodel/variables/variables.data-00000-of-00001 . |
|
|
198 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.ont.savedmodel/variables/variables.index . |
|
|
199 |
RUN chmod -R +r /opt/models/ont_r104/* |
|
|
200 |
|
|
|
201 |
WORKDIR /opt/models/masseq |
|
|
202 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.masseq.savedmodel/fingerprint.pb . |
|
|
203 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.masseq.savedmodel/saved_model.pb . |
|
|
204 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.masseq.savedmodel/example_info.json . |
|
|
205 |
WORKDIR /opt/models/masseq/variables |
|
|
206 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.masseq.savedmodel/variables/variables.data-00000-of-00001 . |
|
|
207 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/savedmodels/deepvariant.masseq.savedmodel/variables/variables.index . |
|
|
208 |
RUN chmod -R +r /opt/models/masseq/* |
|
|
209 |
|
|
|
210 |
# Copy small models |
|
|
211 |
WORKDIR /opt/smallmodels/wgs |
|
|
212 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.wgs.smallmodel/fingerprint.pb . |
|
|
213 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.wgs.smallmodel/saved_model.pb . |
|
|
214 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.wgs.smallmodel/keras_metadata.pb . |
|
|
215 |
WORKDIR /opt/smallmodels/wgs/variables |
|
|
216 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.wgs.smallmodel/variables/variables.data-00000-of-00001 . |
|
|
217 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.wgs.smallmodel/variables/variables.index . |
|
|
218 |
RUN chmod -R +r /opt/smallmodels/wgs/* |
|
|
219 |
|
|
|
220 |
WORKDIR /opt/smallmodels/pacbio |
|
|
221 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.pacbio.smallmodel/fingerprint.pb . |
|
|
222 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.pacbio.smallmodel/saved_model.pb . |
|
|
223 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.pacbio.smallmodel/keras_metadata.pb . |
|
|
224 |
WORKDIR /opt/smallmodels/pacbio/variables |
|
|
225 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.pacbio.smallmodel/variables/variables.data-00000-of-00001 . |
|
|
226 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.pacbio.smallmodel/variables/variables.index . |
|
|
227 |
RUN chmod -R +r /opt/smallmodels/pacbio/* |
|
|
228 |
|
|
|
229 |
WORKDIR /opt/smallmodels/hybrid_pacbio_illumina |
|
|
230 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.hybrid.smallmodel/fingerprint.pb . |
|
|
231 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.hybrid.smallmodel/saved_model.pb . |
|
|
232 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.hybrid.smallmodel/keras_metadata.pb . |
|
|
233 |
WORKDIR /opt/smallmodels/hybrid_pacbio_illumina/variables |
|
|
234 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.hybrid.smallmodel/variables/variables.data-00000-of-00001 . |
|
|
235 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.hybrid.smallmodel/variables/variables.index . |
|
|
236 |
RUN chmod -R +r /opt/smallmodels/hybrid_pacbio_illumina/* |
|
|
237 |
|
|
|
238 |
WORKDIR /opt/smallmodels/ont_r104 |
|
|
239 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.ont.smallmodel/fingerprint.pb . |
|
|
240 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.ont.smallmodel/saved_model.pb . |
|
|
241 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.ont.smallmodel/keras_metadata.pb . |
|
|
242 |
WORKDIR /opt/smallmodels/ont_r104/variables |
|
|
243 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.ont.smallmodel/variables/variables.data-00000-of-00001 . |
|
|
244 |
ADD https://storage.googleapis.com/deepvariant/models/DeepVariant/${VERSION}/smallmodels/deepvariant.ont.smallmodel/variables/variables.index . |
|
|
245 |
RUN chmod -R +r /opt/smallmodels/ont_r104/* |
|
|
246 |
|
|
|
247 |
ENV PATH="${PATH}":/opt/conda/bin:/opt/conda/envs/bio/bin:/opt/deepvariant/bin |
|
|
248 |
|
|
|
249 |
RUN apt-get -y update && \ |
|
|
250 |
apt-get install -y parallel python3-pip && \ |
|
|
251 |
PATH="${HOME}/.local/bin:$PATH" python3 -m pip install absl-py==0.13.0 && \ |
|
|
252 |
apt-get clean autoclean && \ |
|
|
253 |
apt-get autoremove -y --purge && \ |
|
|
254 |
rm -rf /var/lib/apt/lists/* |
|
|
255 |
|
|
|
256 |
WORKDIR /opt/deepvariant |
|
|
257 |
|
|
|
258 |
CMD ["/opt/deepvariant/bin/run_deepvariant", "--help"] |