Diff of /Dockerfile.deepsomatic [000000] .. [5a4941]

Switch to unified view

a b/Dockerfile.deepsomatic
1
# Copyright 2019 Google LLC.
2
# This is used to build the DeepSomatic 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 -f Dockerfile.deepsomatic -t deepsomatic .
9
#
10
# To build for GPU, use a command like:
11
# $ sudo docker build -f Dockerfile.deepsomatic --build-arg=FROM_IMAGE=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 --build-arg=DV_GPU_BUILD=1 -t deepsomatic_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_DEEPSOMATIC=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
37
# Copying DeepVariant source code
38
COPY . /opt/deepvariant
39
40
WORKDIR /opt/deepvariant
41
42
RUN ./build-prereq.sh \
43
  && PATH="${HOME}/bin:${PATH}" ./build_release_binaries.sh  # PATH for bazel
44
45
FROM ${FROM_IMAGE}
46
ARG DV_GPU_BUILD
47
ARG VERSION_DEEPSOMATIC
48
ARG PYTHON_VERSION
49
ARG TF_ENABLE_ONEDNN_OPTS
50
ENV DV_GPU_BUILD=${DV_GPU_BUILD}
51
ENV VERSION_DEEPSOMATIC ${VERSION_DEEPSOMATIC}
52
ENV PYTHON_VERSION ${PYTHON_VERSION}
53
ENV TF_ENABLE_ONEDNN_OPTS ${TF_ENABLE_ONEDNN_OPTS}
54
55
WORKDIR /opt/
56
COPY --from=builder /opt/deepvariant/bazel-bin/licenses.zip .
57
58
WORKDIR /opt/deepvariant/bin/
59
COPY --from=builder /opt/conda /opt/conda
60
COPY --from=builder /opt/deepvariant/run-prereq.sh .
61
COPY --from=builder /opt/deepvariant/settings.sh .
62
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/make_examples_somatic.zip  .
63
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/call_variants.zip  .
64
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/postprocess_variants.zip  .
65
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/vcf_stats_report.zip  .
66
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/show_examples.zip  .
67
COPY --from=builder /opt/deepvariant/bazel-out/k8-opt/bin/deepvariant/runtime_by_region_vis.zip  .
68
COPY --from=builder /opt/deepvariant/scripts/run_deepsomatic.py ./deepsomatic/
69
RUN ./run-prereq.sh
70
71
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 0 && \
72
    update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 0
73
74
# Create shell wrappers for python zip files for easier use.
75
RUN \
76
  BASH_HEADER='#!/bin/bash' && \
77
  printf "%s\n%s\n" \
78
    "${BASH_HEADER}" \
79
    'python3 -u /opt/deepvariant/bin/make_examples_somatic.zip "$@"' > \
80
    /opt/deepvariant/bin/make_examples_somatic && \
81
  printf "%s\n%s\n" \
82
    "${BASH_HEADER}" \
83
    'python3 /opt/deepvariant/bin/call_variants.zip "$@"' > \
84
    /opt/deepvariant/bin/call_variants && \
85
  printf "%s\n%s\n" \
86
    "${BASH_HEADER}" \
87
    'python3 /opt/deepvariant/bin/postprocess_variants.zip "$@"' > \
88
    /opt/deepvariant/bin/postprocess_variants && \
89
  printf "%s\n%s\n" \
90
    "${BASH_HEADER}" \
91
    'python3 /opt/deepvariant/bin/vcf_stats_report.zip "$@"' > \
92
    /opt/deepvariant/bin/vcf_stats_report && \
93
  printf "%s\n%s\n" \
94
    "${BASH_HEADER}" \
95
    'python3 /opt/deepvariant/bin/show_examples.zip "$@"' > \
96
    /opt/deepvariant/bin/show_examples && \
97
  printf "%s\n%s\n" \
98
    "${BASH_HEADER}" \
99
    'python3 /opt/deepvariant/bin/runtime_by_region_vis.zip "$@"' > \
100
    /opt/deepvariant/bin/runtime_by_region_vis && \
101
  printf "%s\n%s\n" \
102
    "${BASH_HEADER}" \
103
    'python3 -u /opt/deepvariant/bin/deepsomatic/run_deepsomatic.py "$@"' > \
104
    /opt/deepvariant/bin/deepsomatic/run_deepsomatic && \
105
  chmod +x /opt/deepvariant/bin/make_examples_somatic \
106
    /opt/deepvariant/bin/call_variants \
107
    /opt/deepvariant/bin/postprocess_variants \
108
    /opt/deepvariant/bin/vcf_stats_report \
109
    /opt/deepvariant/bin/show_examples \
110
    /opt/deepvariant/bin/runtime_by_region_vis \
111
    /opt/deepvariant/bin/deepsomatic/run_deepsomatic
112
113
# Copy models
114
WORKDIR /opt/models/deepsomatic/wgs
115
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs.savedmodel/fingerprint.pb .
116
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs.savedmodel/saved_model.pb .
117
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs.savedmodel/example_info.json .
118
WORKDIR /opt/models/deepsomatic/wgs/variables
119
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs.savedmodel/variables/variables.data-00000-of-00001 .
120
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs.savedmodel/variables/variables.index .
121
RUN chmod -R +r /opt/models/deepsomatic/wgs/*
122
123
WORKDIR /opt/models/deepsomatic/wes
124
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wes.savedmodel/fingerprint.pb .
125
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wes.savedmodel/saved_model.pb .
126
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wes.savedmodel/example_info.json .
127
WORKDIR /opt/models/deepsomatic/wes/variables
128
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wes.savedmodel/variables/variables.data-00000-of-00001 .
129
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wes.savedmodel/variables/variables.index .
130
RUN chmod -R +r /opt/models/deepsomatic/wes/*
131
132
WORKDIR /opt/models/deepsomatic/pacbio
133
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio.savedmodel/fingerprint.pb .
134
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio.savedmodel/saved_model.pb .
135
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio.savedmodel/example_info.json .
136
WORKDIR /opt/models/deepsomatic/pacbio/variables
137
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio.savedmodel/variables/variables.data-00000-of-00001 .
138
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio.savedmodel/variables/variables.index .
139
RUN chmod -R +r /opt/models/deepsomatic/pacbio/*
140
141
WORKDIR /opt/models/deepsomatic/ont
142
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont.savedmodel/fingerprint.pb .
143
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont.savedmodel/saved_model.pb .
144
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont.savedmodel/example_info.json .
145
WORKDIR /opt/models/deepsomatic/ont/variables
146
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont.savedmodel/variables/variables.data-00000-of-00001 .
147
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont.savedmodel/variables/variables.index .
148
RUN chmod -R +r /opt/models/deepsomatic/ont/*
149
150
WORKDIR /opt/models/deepsomatic/ffpe_wgs
151
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wgs.savedmodel/fingerprint.pb .
152
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wgs.savedmodel/saved_model.pb .
153
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wgs.savedmodel/example_info.json .
154
WORKDIR /opt/models/deepsomatic/ffpe_wgs/variables
155
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wgs.savedmodel/variables/variables.data-00000-of-00001 .
156
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wgs.savedmodel/variables/variables.index .
157
RUN chmod -R +r /opt/models/deepsomatic/ffpe_wgs/*
158
159
WORKDIR /opt/models/deepsomatic/ffpe_wes
160
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wes.savedmodel/fingerprint.pb .
161
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wes.savedmodel/saved_model.pb .
162
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wes.savedmodel/example_info.json .
163
WORKDIR /opt/models/deepsomatic/ffpe_wes/variables
164
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wes.savedmodel/variables/variables.data-00000-of-00001 .
165
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ffpe_wes.savedmodel/variables/variables.index .
166
RUN chmod -R +r /opt/models/deepsomatic/ffpe_wes/*
167
168
# Tumor-only models
169
WORKDIR /opt/models/deepsomatic/wgs_tumor_only
170
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs_tumor_only.savedmodel/fingerprint.pb .
171
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs_tumor_only.savedmodel/saved_model.pb .
172
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs_tumor_only.savedmodel/example_info.json .
173
WORKDIR /opt/models/deepsomatic/wgs_tumor_only/variables
174
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs_tumor_only.savedmodel/variables/variables.data-00000-of-00001 .
175
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.wgs_tumor_only.savedmodel/variables/variables.index .
176
RUN chmod -R +r /opt/models/deepsomatic/wgs_tumor_only/*
177
178
WORKDIR /opt/models/deepsomatic/pacbio_tumor_only
179
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio_tumor_only.savedmodel/fingerprint.pb .
180
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio_tumor_only.savedmodel/saved_model.pb .
181
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio_tumor_only.savedmodel/example_info.json .
182
WORKDIR /opt/models/deepsomatic/pacbio_tumor_only/variables
183
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio_tumor_only.savedmodel/variables/variables.data-00000-of-00001 .
184
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.pacbio_tumor_only.savedmodel/variables/variables.index .
185
RUN chmod -R +r /opt/models/deepsomatic/pacbio_tumor_only/*
186
187
WORKDIR /opt/models/deepsomatic/ont_tumor_only
188
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont_tumor_only.savedmodel/fingerprint.pb .
189
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont_tumor_only.savedmodel/saved_model.pb .
190
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont_tumor_only.savedmodel/example_info.json .
191
WORKDIR /opt/models/deepsomatic/ont_tumor_only/variables
192
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont_tumor_only.savedmodel/variables/variables.data-00000-of-00001 .
193
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/savedmodels/deepsomatic.ont_tumor_only.savedmodel/variables/variables.index .
194
RUN chmod -R +r /opt/models/deepsomatic/ont_tumor_only/*
195
196
# PONs and AF VCF files
197
WORKDIR /opt/models/deepsomatic/pons
198
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/AF_ilmn_PON_DeepVariant.GRCh38.AF0.05.vcf.gz .
199
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/AF_ilmn_PON_DeepVariant.GRCh38.AF0.05.vcf.gz.tbi .
200
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/AF_pacbio_PON_CoLoRSdb.GRCh38.AF0.05.vcf.gz .
201
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/AF_pacbio_PON_CoLoRSdb.GRCh38.AF0.05.vcf.gz.tbi .
202
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/PON_dbsnp138_gnomad_ILMN1000g_pon.vcf.gz .
203
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/PON_dbsnp138_gnomad_ILMN1000g_pon.vcf.gz.tbi .
204
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/PON_dbsnp138_gnomad_PB1000g_pon.vcf.gz .
205
ADD https://storage.googleapis.com/deepvariant/models/DeepSomatic/${VERSION_DEEPSOMATIC}/pons/PON_dbsnp138_gnomad_PB1000g_pon.vcf.gz.tbi .
206
RUN chmod -R +r /opt/models/deepsomatic/pons/*
207
208
ENV PATH="${PATH}":/opt/conda/bin:/opt/conda/envs/bio/bin:/opt/deepvariant/bin/deepsomatic:/opt/deepvariant/bin
209
210
RUN apt-get -y update && \
211
  apt-get install -y parallel python3-pip && \
212
  PATH="${HOME}/.local/bin:$PATH" python3 -m pip install absl-py==0.13.0 && \
213
  apt-get clean autoclean && \
214
  apt-get autoremove -y --purge && \
215
  rm -rf /var/lib/apt/lists/*
216
217
218
WORKDIR /opt/deepvariant
219
220
CMD ["/opt/deepvariant/bin/deepsomatic/run_deepsomatic", "--help"]