-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
327 lines (308 loc) · 11.6 KB
/
Dockerfile
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
#########################################################################################
#
# Docker file for GATB-Tools project.
#
# It prepares a Docker container to run various GATB-Tools jobs:
#
# Simka : https://github.com/GATB/simka
# DSK : https://github.com/GATB/dsk
# BLOOCOO : https://github.com/GATB/bloocoo
# MindTheGap : https://github.com/GATB/MindTheGap
# MINIA : https://github.com/GATB/minia
# SHORT READ CONNECTOR: https://github.com/GATB/short_read_connector
# DISCOSNP : https://github.com/GATB/DiscoSnp
# TAKEABREAK : https://github.com/GATB/TakeABreak
#
#########################################################################################
#
# == Docker build command:
#
# docker build -f Dockerfile -t gatb_tools_machine .
#
# == Docker test command:
#
# docker run --rm -i -t gatb_tools_machine -c test
#
# -> you should see all GATB-Tools tests with some provided data.
#
# docker run --rm -i -t gatb_tools_machine -c version
#
# -> you should see version of all GATB-Tools contained here.
#
# == Running a Tool job:
#
# docker run --rm -i -t gatb_tools_machine -c <command> -- <arguments>
#
# where:
# <command>: see ./run-tool.sh
# <arguments>: see ./run-tool.sh
#
# == Sample Simka job with provided data:
#
# To illustrate the use of this GATB-Tools Docker Image, let's take the example of
# running SIMKA tool.
#
# docker run --rm -i -t -v $PWD:/tmp gatb_tools_machine -c simka -- -in /opt/simka/example/simka_input.txt -out /tmp/simka_results/ -out-tmp /tmp/simka_temp_output
#
# -> you should have results in $PWD/simka_results directory when Simka job is done.
#
# This command-line line explained:
#
# docker run [1]
# --rm [2]
# -i -t [3]
# -v $PWD:/tmp [4]
# gatb_tools_machine [5]
# -c simka [6]
# -- [7]
# -in /opt/simka/example/simka_input.txt [8]
# -out /tmp/simka_results/ [9]
# -out-tmp /tmp/simka_temp_output [10]
#
# [1]-[5]: Docker arguments
# [6]-[7]: simka container's invoker program
# [8]-[10]: 'bin/simka' arguments
#
# [1]: start Docker container
# [2]: destroy container when Docker finishes
# (it does NOT delete the 'gatb_tools_machine' image)
# [3]: start an interactive job
# (for instance, you'll see messages on stdout, if any)
# [4]: mount a volume. This is required to get the results from Simka.
# Here, we say that current local directory will be viewed as '/tmp'
# from the inside of the container.
# [5]: tell Docker which image to start: the 'gatb_tools_machine' of course.
# [6]: ask to start the simka program. See companion file 'run-tool.sh' for
# more information.
# [7]: '--' is required to separate arguments [6] from the rest of the
# command line
# [8]: the data file to process with simka. Here we use a data file
# provided with the simka software to test it.
# [9]: tells simka where to put results. Of course, simka will write
# within /tmp directory inside the container. However, since we
# have directive [4], data writing is actually done in $PWD, i.e.
# a local directory.
# [10]: tells simka where to put temporary files.
#
# == Additional notes
#
# Root access inside the container:
#
# - if running: docker exec -it gatb_tools_machine bash
#
# - if not yet running: docker run --rm -i -t gatb_tools_machine bash
#
#########################################################################################
# GATB-Tools binaries available on Github (see below) are built using a
# Debian 8 (jessie) based system on Inria Jenkins CI platform
FROM debian:jessie
# who to blame?
MAINTAINER Patrick Durand [email protected]
# ###
# Package installation and configuration
#
# 1. We need 'curl' for all tools to get them from Github.
# 2. GATB-Tools dependencies are as follows:
# a. Simka : python-2.7 and R
# b. Bloocoo : none
# c. DSK : none
# d. MindTheGap: bsdmainutils (MindTheGap test script requires the command
# 'column' which is included in bsdmainutils Debian package)
# e. Minia : none
# f. RConnector: none
# g. DiscoSnp : python-2.7
# h. TakeABreak: none
#
RUN apt-get update && apt-get -y dist-upgrade \
&& apt-get install -y --no-install-recommends bsdmainutils curl python2.7 r-base \
&& apt-get clean \
&& cd /usr/bin && ln -s python2.7 python
# ###
# SIMKA installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV SIMKA_VERSION=1.4.0
RUN cd /opt \
&& export SIMKA_TGZ=simka-v${SIMKA_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/simka/releases/download \
&& export SIMKA_URL=${GIT_URL}/v${SIMKA_VERSION}/${SIMKA_TGZ} \
&& curl -ksL ${SIMKA_URL} | tar xz \
&& rm -f ${SIMKA_TGZ} \
&& mv simka-v${SIMKA_VERSION}-bin-Linux simka \
&& cd simka/bin \
&& chmod +x simka* \
&& cd ../example \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# DSK installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV DSK_VERSION=2.2.0
RUN cd /opt \
&& export DSK_TGZ=dsk-v${DSK_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/dsk/releases/download \
&& export DSK_URL=${GIT_URL}/v${DSK_VERSION}/${DSK_TGZ} \
&& curl -ksL ${DSK_URL} | tar xz \
&& rm -f ${DSK_TGZ} \
&& mv dsk-v${DSK_VERSION}-bin-Linux dsk \
&& cd dsk/bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# BLOOCOO installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV BLOOCOO_VERSION=1.0.7
RUN cd /opt \
&& export BLOOCOO_TGZ=Bloocoo-v${BLOOCOO_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/bloocoo/releases/download \
&& export BLOOCOO_URL=${GIT_URL}/v${BLOOCOO_VERSION}/${BLOOCOO_TGZ} \
&& curl -ksL ${BLOOCOO_URL} | tar xz \
&& rm -f ${BLOOCOO_TGZ} \
&& mv Bloocoo-v${BLOOCOO_VERSION}-bin-Linux bloocoo \
&& cd bloocoo/bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# MINDTHEGAP installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV MIND_VERSION=2.0.2
RUN cd /opt \
&& export MIND_TGZ=MindTheGap-v${MIND_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/MindTheGap/releases/download \
&& export MIND_URL=${GIT_URL}/v${MIND_VERSION}/${MIND_TGZ} \
&& curl -ksL ${MIND_URL} | tar xz \
&& rm -f ${MIND_TGZ} \
&& mv MindTheGap-v${MIND_VERSION}-bin-Linux MindTheGap \
&& cd MindTheGap/bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# GATB-Core installation: get the binary release from Github mirror.
# Note: we only keep HDF5 utility tools: dbgh5, dbginfo, h5dump
#
# We always use the latest official binary release available.
ENV GCORE_VERSION=1.3.0
RUN cd /opt \
&& export GCORE_TGZ=gatb-core-${GCORE_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/gatb-core/releases/download \
&& export GCORE_URL=${GIT_URL}/v${GCORE_VERSION}/${GCORE_TGZ} \
&& curl -ksL ${GCORE_URL} | tar xz \
&& rm -f ${GCORE_TGZ} \
&& mv gatb-core-${GCORE_VERSION}-bin-Linux gatb-core \
&& cd gatb-core \
&& rm -rf examples include lib test/gatb-core-cppunit \
&& cd bin \
&& chmod +x * \
&& mv gatb-h5dump h5dump
COPY test-gcore.sh /opt/gatb-core
RUN cd /opt/gatb-core && ./test-gcore.sh && rm -f /opt/gatb-core/bin/reads3.fa.h5
# ###
# MINIA installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV MINIA_VERSION=2.0.7
RUN cd /opt \
&& export MINIA_TGZ=minia-v${MINIA_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/minia/releases/download \
&& export MINIA_URL=${GIT_URL}/v${MINIA_VERSION}/${MINIA_TGZ} \
&& curl -ksL ${MINIA_URL} | tar xz \
&& rm -f ${MINIA_TGZ} \
&& mv minia-v${MINIA_VERSION}-bin-Linux minia \
&& cd minia/bin \
&& chmod +x *
# ###
# SHORT-READ-CONNECTOR installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV SRC_VERSION=1.1.0
RUN cd /opt \
&& export SRC_TGZ=rconnector-v${SRC_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/short_read_connector/releases/download \
&& export SRC_URL=${GIT_URL}/v${SRC_VERSION}/${SRC_TGZ} \
&& curl -ksL ${SRC_URL} | tar xz \
&& rm -f ${SRC_TGZ} \
&& mv rconnector-v${SRC_VERSION}-bin-Linux rconnector \
&& cd rconnector \
&& chmod +x *.sh \
&& cd bin \
&& chmod +x * \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# DISCO-SNP installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV DSNP_VERSION=2.3.0
RUN cd /opt \
&& export DSNP_TGZ=DiscoSNP.-v${DSNP_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/DiscoSnp/releases/download \
&& export DSNP_URL=${GIT_URL}/v${DSNP_VERSION}/${DSNP_TGZ} \
&& curl -ksL ${DSNP_URL} | tar xz \
&& rm -f ${DSNP_TGZ} \
&& mv DiscoSNP++-v${DSNP_VERSION}-bin-Linux discosnp \
&& cd discosnp \
&& chmod +x *.sh \
&& cd bin \
&& chmod +x * \
&& cd ../scripts \
&& chmod +x *.sh \
&& cd ../test \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# TAKE-A-BREAK installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
ENV TABK_VERSION=1.1.2
RUN cd /opt \
&& export TABK_TGZ=TakeABreak-v${TABK_VERSION}-bin-Linux.tar.gz \
&& export GIT_URL=https://github.com/GATB/TakeABreak/releases/download \
&& export TABK_URL=${GIT_URL}/v${TABK_VERSION}/${TABK_TGZ} \
&& curl -ksL ${TABK_URL} | tar xz \
&& rm -f ${TABK_TGZ} \
&& mv TakeABreak-v${TABK_VERSION}-bin-Linux TakeABreak \
&& cd TakeABreak/bin \
&& chmod +x * \
&& cd ../tests \
&& chmod +x *.sh \
&& ./simple_test.sh
# ###
# BCALM installation: get the binary release from Github mirror.
#
# We always use the latest official binary release available.
#
# COMMENTED OUT: tests failed (i.e. run-tiny.sh)!
#
#ENV BCALM_VERSION=2.1.0-beta1
#RUN cd /opt \
# && export BCALM_TGZ=bcalm-binaries-v${BCALM_VERSION}-Linux.tar.gz \
# && export GIT_URL=https://github.com/GATB/bcalm/releases/download \
# && export BCALM_URL=${GIT_URL}/v${BCALM_VERSION}/${BCALM_TGZ} \
# && curl -ksL ${BCALM_URL} | tar xz \
# && rm -f ${BCALM_TGZ} \
# && mv bcalm-binaries-v${BCALM_VERSION}-Linux bcalm \
# && cd bcalm/bin \
# && chmod +x * \
# && cd ../example \
# && chmod +x *.sh \
# && ./run-tiny.sh
# ###
# Starter script.
#
COPY run-tool.sh /opt
# Fix: ensure script has exec permission
RUN chmod +x /opt/run-tool.sh
# ###
# Start a GATB-Tool. See "run-tool.sh" header for more information.
#
ENTRYPOINT ["/opt/run-tool.sh"]