-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
296 lines (252 loc) · 8.89 KB
/
Makefile
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
ID = "default"
ifeq ($(ID), "default")
BEMOVI = bemovi
else
BEMOVI = bemovi.$(ID)
endif
TS = $(shell /bin/date '+%Y-%m-%d--%H-%M-%S')
######################################
##### create directory structure #####
######################################
dirs:
# mkdir -p ~/LEFF/00.general.parameter
# mkdir -p ~/LEEF/0.raw.data
mkdir -p ~/LEEF/1.pre-processed.data
mkdir -p ~/LEEF/2.extracted.data
mkdir -p ~/LEEF/3.archived.data
mkdir -p ~/LEEF/9.backend
mkdir -p ~/LEEF_pipeline
cp -r ./pipeline/* ~/LEEF_pipeline
#################################
##### build #####
#################################
leef-2.base: .PHONY
docker build --tag leefuzh/leef-2.base:latest leef-2.base
leef-2.base.force: .PHONY
docker build --no-cache --tag leefuzh/leef-2.base:latest leef-2.base
build: leef-2
leef-2: .PHONY
docker build --tag leefuzh/leef-2:latest leef-2
build.force: leef-2.force
leef-2.force: .PHONY
docker build --no-cache --tag leefuzh/leef-2:latest leef-2
#################################
##### pull #####
#################################
update: pull
pull:
docker pull leefuzh/leef-2
#################################
##### run #####
#################################
run.leef.base:
docker run \
--rm \
-p 8787:8787 \
-e PASSWORD=none \
-ti \
leefuzh/leef-2
rstudio: run.leef.rstudio
run.leef.rstudio: dirs
docker run \
--rm \
-p 8787:8787 \
-e PASSWORD=none \
\
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
\
-v ~/LEEF/0.raw.data:/home/rstudio/LEEF/0.raw.data \
-v ~/LEEF/1.pre-processed.data:/home/rstudio/LEEF/1.pre-processed.data \
-v ~/LEEF/2.extracted.data:/home/rstudio/LEEF/2.extracted.data \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
--memory-swap=-1 \
-ti \
leefuzh/leefleef-2
bash: run.leef.bash
run.leef.bash: dirs
docker run \
--rm \
-p 8787:8787 \
-e PASSWORD=none \
\
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
\
-v ~/LEEF/0.raw.data:/home/rstudio/LEEF/0.raw.data \
-v ~/LEEF/1.pre-processed.data:/home/rstudio/LEEF/1.pre-processed.data \
-v ~/LEEF/2.extracted.data:/home/rstudio/LEEF/2.extracted.data \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
bash
R: run.leef.R
run.leef.R: dirs
docker run \
--rm \
-p 8787:8787 \
-e PASSWORD=none \
\
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
\
-v ~/LEEF/0.raw.data:/home/rstudio/LEEF/0.raw.data \
-v ~/LEEF/1.pre-processed.data:/home/rstudio/LEEF/1.pre-processed.data \
-v ~/LEEF/2.extracted.data:/home/rstudio/LEEF/2.extracted.data \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
R
#################################
##### run pipeline #####
#################################
pipeline.bemovi: run.pipeline.bemovi
run.pipeline.bemovi: dirs
docker run \
--rm \
-e PASSWORD=none \
\
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
\
-v ~/LEEF/0.raw.data/$(BEMOVI):/home/rstudio/LEEF/0.raw.data/bemovi \
-v ~/LEEF/1.pre-processed.data/$(BEMOVI):/home/rstudio/LEEF/1.pre-processed.data/bemovi \
-v ~/LEEF/2.extracted.data/$(BEMOVI):/home/rstudio/LEEF/2.extracted.data/bemovi \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
-v ~/LEEF_pipeline:/home/rstudio/LEEF/pipeline \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
/home/rstudio/LEEF/pipeline/run.pipeline.bemovi $(ID)
pipeline.conductivity: run.pipeline.conductivity
run.pipeline.conductivity: dirs
docker run \
--rm \
-e PASSWORD=none \
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
-v ~/LEEF/0.raw.data/conductivity:/home/rstudio/LEEF/0.raw.data/conductivity \
-v ~/LEEF/1.pre-processed.data/conductivity:/home/rstudio/LEEF/1.pre-processed.data/conductivity \
-v ~/LEEF/2.extracted.data/conductivity:/home/rstudio/LEEF/2.extracted.data/conductivity \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
-v ~/LEEF_pipeline:/home/rstudio/LEEF/pipeline \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
/home/rstudio/LEEF/pipeline/run.pipeline.conductivity
pipeline.flowcam: run.pipeline.flowcam
run.pipeline.flowcam: dirs
docker run \
--rm \
-e PASSWORD=none \
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
-v ~/LEEF/0.raw.data/flowcam:/home/rstudio/LEEF/0.raw.data/flowcam \
-v ~/LEEF/1.pre-processed.data/flowcam:/home/rstudio/LEEF/1.pre-processed.data/flowcam \
-v ~/LEEF/2.extracted.data/flowcam:/home/rstudio/LEEF/2.extracted.data/flowcam \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
-v ~/LEEF_pipeline:/home/rstudio/LEEF/pipeline \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
/home/rstudio/LEEF/pipeline/run.pipeline.flowcam
pipeline.flowcytometer: run.pipeline.flowcytometer
run.pipeline.flowcytometer: dirs
docker run \
--rm \
-e PASSWORD=none \
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
-v ~/LEEF/0.raw.data/flowcytometer:/home/rstudio/LEEF/0.raw.data/flowcytometer \
-v ~/LEEF/1.pre-processed.data/flowcytometer:/home/rstudio/LEEF/1.pre-processed.data/flowcytometer \
-v ~/LEEF/2.extracted.data/flowcytometer:/home/rstudio/LEEF/2.extracted.data/flowcytometer \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
-v ~/LEEF_pipeline:/home/rstudio/LEEF/pipeline \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
/home/rstudio/LEEF/pipeline/run.pipeline.flowcytometer
pipeline.manualcount: run.pipeline.manualcount
run.pipeline.manualcount: dirs
docker run \
--rm \
-e PASSWORD=none \
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
-v ~/LEEF/0.raw.data/manualcount:/home/rstudio/LEEF/0.raw.data/manualcount \
-v ~/LEEF/1.pre-processed.data/manualcount:/home/rstudio/LEEF/1.pre-processed.data/manualcount \
-v ~/LEEF/2.extracted.data/manualcount:/home/rstudio/LEEF/2.extracted.data/manualcount \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
-v ~/LEEF_pipeline:/home/rstudio/LEEF/pipeline \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
/home/rstudio/LEEF/pipeline/run.pipeline.manualcount
pipeline.o2meter: run.pipeline.o2meter
run.pipeline.o2meter: dirs
docker run \
--rm \
-e PASSWORD=none \
-v ~/LEEF/00.general.parameter:/home/rstudio/LEEF/00.general.parameter \
-v ~/LEEF/0.raw.data/o2meter:/home/rstudio/LEEF/0.raw.data/o2meter \
-v ~/LEEF/1.pre-processed.data/o2meter:/home/rstudio/LEEF/1.pre-processed.data/o2meter \
-v ~/LEEF/2.extracted.data/o2meter:/home/rstudio/LEEF/2.extracted.data/o2meter \
-v ~/LEEF/3.archived.data:/home/rstudio/LEEF/3.archived.data \
-v ~/LEEF/9.backend:/home/rstudio/LEEF/9.backend \
-v ~/LEEF_pipeline:/home/rstudio/LEEF/pipeline \
--memory-swap=-1 \
-ti \
leefuzh/leef-2 \
/home/rstudio/LEEF/pipeline/run.pipeline.o2meter
#################################
##### stop #####
#################################
stop:
docker stop leefuzh/leef-2
#################################
##### start #####
#################################
start:
docker start leefuzh/leef-2
#################################
##### remove #####
#################################
remove: remove.leef.base remove.leef
remove.leef.base: stop
docker image rm leefuzh/leef-2.base
remove.leef: stop
docker image rm leefuzh/leef-2
#################################
##### phony #####
#################################
.PHONY:
@echo "\n\n"
@echo "##############################################"
@echo "### Building LEEF docker images locally... ###"
@echo "##############################################"
@echo "\n\n"
#################################
##### Help targets #####
#################################
list: list_variables list_targets
list_variables:
@echo
@echo "#############################################"
@echo "## Variables ################################"
make -pn | grep -A1 "^# makefile"| grep -v "^#\|^--" | sort | uniq
@echo "#############################################"
@echo ""
## from https://stackoverflow.com/a/26339924/632423
list_targets:
@echo
@echo "#############################################"
@echo "## Targets ###############################"
@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
@echo "#############################################"
@echo
list: list_variables list_targets
#################################
##### the end #####
#################################