-
Notifications
You must be signed in to change notification settings - Fork 10
422 lines (381 loc) · 15.3 KB
/
build-docker.yml
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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
name: build-docker-images
on:
push:
branches: [ main ]
paths-ignore:
- "*.md"
pull_request:
branches: [ main ]
paths-ignore:
- "*.md"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
BUILDKIT_PROGRESS: "plain" # Full logs for CI build.
REGISTRY_URL: "docker.io" # docker.io or other target registry URL: where to push images to.
REGISTRY_SRC: "docker.io" # For BASE_NAMESPACE of images: where to pull base images from.
# DOCKER_REGISTRY_USERNAME and DOCKER_REGISTRY_PASSWORD is required for docker image push, they should be set in CI secrets.
DOCKER_REGISTRY_USERNAME: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.DOCKER_REGISTRY_PASSWORD }}
# used to sync image to mirror registry
DOCKER_MIRROR_REGISTRY_USERNAME: ${{ secrets.DOCKER_MIRROR_REGISTRY_USERNAME }}
DOCKER_MIRROR_REGISTRY_PASSWORD: ${{ secrets.DOCKER_MIRROR_REGISTRY_PASSWORD }}
jobs:
qpod_base:
name: 'atom,base,python-3.12'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image atom latest docker_atom/Dockerfile && push_image
build_image python-3.12 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.12"
alias_image python-3.12 latest base latest && push_image
qpod_python:
name: 'python-3.7,python-3.11'
needs: 'qpod_base'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image python-3.7 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.7" && push_image
build_image python-3.11 latest docker_base/Dockerfile --build-arg "PYTHON_VERSION=3.11" && push_image
qpod_core:
name: 'core'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image core latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=base,datascience,mkl,database,nlp,cv,chem,tf2,torch" \
--build-arg "ARG_PROFILE_R=base,datascience,rstudio,rshiny" \
--build-arg "ARG_PROFILE_NODEJS=base" \
--build-arg "ARG_PROFILE_JAVA=base,maven" \
--build-arg "ARG_PROFILE_LATEX=base,cjk"
push_image core
qpod_py-data:
name: 'py-data'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image py-data latest docker_core/Dockerfile --build-arg "ARG_PROFILE_PYTHON=datascience,mkl,database" && push_image
qpod_py-chem:
name: 'py-chem'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image py-chem latest docker_core/Dockerfile --build-arg "ARG_PROFILE_PYTHON=datascience,mkl,chem" && push_image
qpod_py-std:
name: 'py-std'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image py-std latest docker_core/Dockerfile --build-arg "ARG_PROFILE_PYTHON=datascience,mkl,database,nlp,cv,chem" && push_image
qpod_py-jdk:
name: 'py-jdk'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image py-jdk latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=datascience,mkl,database,nlp,cv,chem" \
--build-arg "ARG_PROFILE_JAVA=base"
push_image
qpod_r-base:
name: 'r-base'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image r-base latest docker_core/Dockerfile --build-arg "ARG_PROFILE_R=base" && push_image
qpod_r-std:
name: 'r-std'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image r-std latest docker_core/Dockerfile --build-arg "ARG_PROFILE_R=base,datascience" --build-arg "ARG_PROFILE_JAVA=base" && push_image
qpod_r-studio:
name: 'r-studio'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image r-studio latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_R=base,datascience,rstudio,rshiny" \
--build-arg "ARG_PROFILE_JAVA=base" \
--build-arg "ARG_PROFILE_LATEX=base,cjk"
push_image
qpod_node:
name: 'node'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image node latest docker_core/Dockerfile --build-arg "ARG_PROFILE_NODEJS=base" && push_image
qpod_jdk:
name: 'jdk,jdk-8,jdk-11,jdk-17'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image jdk-17 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=17"
build_image jdk-11 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=11"
build_image jdk-8 latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JAVA=base" --build-arg "VERSION_JDK=8"
alias_image jdk-11 latest jdk latest
push_image jdk
qpod_julia:
name: 'julia'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image julia latest docker_core/Dockerfile --build-arg "ARG_PROFILE_JULIA=base" && push_image
qpod_go:
name: 'go,go-stack'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image go latest docker_core/Dockerfile --build-arg "ARG_PROFILE_GO=base"
build_image go-stack latest docker_core/Dockerfile --build-arg "ARG_PROFILE_GO=base" --build-arg "ARG_PROFILE_NODEJS=base"
push_image go
qpod_rust:
name: 'rust'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: source ./tool.sh && build_image rust latest docker_core/Dockerfile --build-arg "ARG_PROFILE_RUST=base" && push_image
qpod_data-science-stack:
name: 'data-science-stack'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image data-science-stack latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=base,database" \
--build-arg "ARG_PROFILE_R=base,rstudio,rshiny" \
--build-arg "ARG_PROFILE_NODEJS=base" \
--build-arg "ARG_PROFILE_JULIA=base"
push_image data-science-stack
qpod_full-stack:
name: 'full-stack'
needs: qpod_base
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image full-stack latest docker_core/Dockerfile \
--build-arg "ARG_PROFILE_PYTHON=base,database" \
--build-arg "ARG_PROFILE_R=base,rstudio,rshiny" \
--build-arg "ARG_PROFILE_NODEJS=base" \
--build-arg "ARG_PROFILE_JAVA=base,maven" \
--build-arg "ARG_PROFILE_JULIA=base" \
--build-arg "ARG_PROFILE_GO=base" \
--build-arg "ARG_PROFILE_RUST=base"
push_image full-stack
# cuda docker image tags: https://hub.docker.com/r/nvidia/cuda/tags
# latest cuda supported by torch: https://pytorch.org/get-started/locally/
# latest cuda supported by tensorflow: https://tensorflow.google.cn/install/source?hl=en#gpu
# latest cuda supported by paddlepadle: https://www.paddlepaddle.org.cn/
qpod_cuda_118:
name: 'cuda,cuda_11.8'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image tmp latest docker_atom/Dockerfile --build-arg "BASE_IMG=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04" && clear_images nvidia/cuda
build_image tmp latest docker_base/Dockerfile --build-arg "BASE_IMG=tmp"
build_image cuda_11.8 latest docker_cuda/Dockerfile --build-arg "BASE_IMG=tmp"
alias_image cuda_11.8 latest cuda latest
push_image cuda
qpod_cuda_123:
name: 'cuda_12.3'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image tmp latest docker_atom/Dockerfile --build-arg "BASE_IMG=nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04" && clear_images nvidia/cuda
build_image tmp latest docker_base/Dockerfile --build-arg "BASE_IMG=tmp"
build_image cuda_12.3 latest docker_cuda/Dockerfile --build-arg "BASE_IMG=tmp"
push_image cuda
qpod_cuda_120:
name: 'cuda_12.0'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image tmp latest docker_atom/Dockerfile --build-arg "BASE_IMG=nvidia/cuda:12.0.1-cudnn8-devel-ubuntu22.04" && clear_images nvidia/cuda
build_image tmp latest docker_base/Dockerfile --build-arg "BASE_IMG=tmp"
build_image cuda_12.0 latest docker_cuda/Dockerfile --build-arg "BASE_IMG=tmp"
push_image cuda
qpod_cuda_112:
name: 'cuda_11.2'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image tmp latest docker_atom/Dockerfile --build-arg "BASE_IMG=nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04" && clear_images nvidia/cuda
build_image tmp latest docker_base/Dockerfile --build-arg "BASE_IMG=tmp" --build-arg "PYTHON_VERSION=3.8"
build_image cuda_11.2 latest docker_cuda/Dockerfile --build-arg "BASE_IMG=tmp"
push_image cuda
qpod_tf2:
name: 'tf2,tf2-cuda123'
needs: qpod_cuda_123
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image tf2-cuda123 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_12.3" --build-arg "ARG_PROFILE_PYTHON=tf2"
alias_image tf2-cuda123 latest tf2 latest
push_image
qpod_torch_cuda118:
name: 'torch,torch-cuda118'
needs: qpod_cuda_118
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image torch-cuda118 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_11.8" --build-arg "ARG_PROFILE_PYTHON=torch"
alias_image torch-cuda118 latest torch latest
push_image
qpod_torch_cuda112:
name: 'torch-cuda123'
needs: qpod_cuda_123
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image torch-cuda123 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_12.3" --build-arg "ARG_PROFILE_PYTHON=torch"
push_image
qpod_paddle_cuda120:
name: 'paddle-cuda,paddle-cuda120'
needs: qpod_cuda_120
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image paddle-cuda120 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_12.0" --build-arg "ARG_PROFILE_PYTHON=paddle,mkl"
alias_image paddle-cuda120 latest paddle-cuda latest
push_image
qpod_paddle_cuda112:
name: 'paddle-cuda112'
needs: qpod_cuda_112
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image paddle-cuda112 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_11.2" --build-arg "ARG_PROFILE_PYTHON=paddle,mkl"
push_image
qpod_py-nlp:
name: 'py-nlp,py-nlp-cuda118'
needs: qpod_cuda_118
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image py-nlp-cuda118 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_11.8" --build-arg "ARG_PROFILE_PYTHON=datascience,mkl,torch,nlp"
alias_image py-nlp-cuda118 latest py-nlp latest
push_image
qpod_py-nlp-cuda112:
name: 'py-nlp-cuda112'
needs: qpod_cuda_112
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image py-nlp-cuda112 latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_11.2" --build-arg "ARG_PROFILE_PYTHON=datascience,mkl,torch,nlp"
push_image
qpod_py-cv:
name: 'py-cv'
needs: qpod_cuda_118
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image py-cv latest docker_core/Dockerfile --build-arg "BASE_IMG=cuda_11.8" --build-arg "ARG_PROFILE_PYTHON=datascience,mkl,torch,cv"
push_image
qpod_core-cuda:
name: 'core-cuda,full-cuda-11.8'
needs: qpod_cuda_118
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && free_diskspace
build_image full-cuda-11.8 latest docker_core/Dockerfile \
--build-arg "BASE_IMG=cuda_11.8" \
--build-arg "ARG_PROFILE_PYTHON=base,datascience,mkl,database,nlp,cv,chem,tf2,torch" \
--build-arg "ARG_PROFILE_R=base,datascience,rstudio,rshiny" \
--build-arg "ARG_PROFILE_NODEJS=base" \
--build-arg "ARG_PROFILE_JAVA=base,maven" \
--build-arg "ARG_PROFILE_LATEX=base,cjk"
alias_image full-cuda-11.8 latest core-cuda latest && push_image cuda
## Postgres
qpod_postgres:
name: 'postgres-15,postgres-16'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
build_image postgres-15 latest docker_atom/Dockerfile --build-arg "BASE_IMG=postgres:15"
build_image postgres-15 latest docker_base/Dockerfile --build-arg "BASE_IMG=postgres-15" --build-arg "PYTHON_VERSION=3.12"
build_image postgres-16 latest docker_atom/Dockerfile --build-arg "BASE_IMG=postgres:16"
build_image postgres-16 latest docker_base/Dockerfile --build-arg "BASE_IMG=postgres-16" --build-arg "PYTHON_VERSION=3.12"
push_image postgres-
## DockerKit - including image-syncer and docker-compsoe
qpod_docker_kit:
name: 'docker-kit'
needs: ["qpod_base"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh && build_image docker-kit latest docker_docker_kit/Dockerfile
printenv | grep -v 'PATH' > /tmp/docker.env
docker run --rm ${IMG_PREFIX}/docker-kit printenv | sort
docker run --rm --env-file /tmp/docker.env -v $(pwd):/tmp -w /tmp \
${IMG_PREFIX}/docker-kit python /opt/utils/image-syncer/run_sync.py ${IMG_NAMESPACE}/base
push_image docker-kit
## Sync all images in this build (listed by "names") to mirror registry.
sync_images:
needs: ["qpod_docker_kit", "qpod_core-cuda", "qpod_py-cv", "qpod_py-nlp"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
source ./tool.sh
printenv | grep -v 'PATH' > /tmp/docker.env
docker run --rm --env-file /tmp/docker.env -v $(pwd):/tmp -w /tmp \
${IMG_NAMESPACE:-qpod}/docker-kit python /opt/utils/image-syncer/run_jobs.py