-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
.drone.yml
383 lines (366 loc) · 11.9 KB
/
.drone.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
---
kind: pipeline
type: kubernetes
name: build
x-global-variables:
environment_win: &default_environment_win
GPU_TYPE: NVIDIA
SRCDIR: /drone/src
DIST_DIR: ./dist/windows
OS: windows
environment_linux: &default_environment_linux
GPU_TYPE: NVIDIA
SRCDIR: /drone/src
DIST_DIR: ./dist/linux
OS: linux
x-build_builder_image: &build_builder_image
name: build-publish-builder-image
image: plugins/docker
settings:
mtu: 1450
repo: ${DRONE_REPO_LINK##https://}
dockerfile: ./builder/Dockerfile-windows
context: ./builder/
username:
from_secret: docker_username
password:
from_secret: docker_password
registry:
from_secret: docker_base_url
tags: win64
# try to keep image small
squash: true
compress: true
when:
status:
- success
x-upload-build-s3: &upload-build-s3
image: minio/mc
commands:
- WT_VERSION="$${DRONE_TAG#v}"
- mc alias set s3_alias $${MINIO_HOST} $${MINIO_ACCESS_KEY} $${MINIO_SECRET_KEY}
# NVIDIA
- GPU_TYPE=NVIDIA
- DIST_DIR="./dist/$${OS}/nvidia"
- mc cp $${SRCDIR}$${DIST_DIR##.}/whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip s3_alias/projects/whispering/
# AMD
#- GPU_TYPE=AMD
#- DIST_DIR="./dist/$${OS}/amd"
#- mc cp $${SRCDIR}$${DIST_DIR##.}/whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip s3_alias/projects/whispering/
when:
ref:
- refs/tags/*
depends_on:
#- build-distribution-windows-package_nvidia
#- build-distribution-windows-package_amd
x-distribution-windows-prepare: &distribution-windows-prepare
#name: build-distribution-windows-prepare
image: ${DRONE_REPO_LINK##https://}:win64
pull: always # make sure to update the image
environment:
<<: *default_environment_win
commands:
- echo "environments:"
- echo "$${SRCDIR}"
- echo "$${DIST_DIR}"
- cd $${SRCDIR}
- mkdir -p ./.cache
- mkdir -p ./.cache/nltk/tokenizers
- wget -P "./.cache/nltk/tokenizers" https://s3.libs.space:9000/ai-models/nltk/tokenizers/punkt.zip
- unzip -o ./.cache/nltk/tokenizers/punkt.zip -d ./.cache/nltk/tokenizers
- mkdir -p $${DIST_DIR}/
- wget -P "$${DIST_DIR}" https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z
- 7za x $${DIST_DIR}/ffmpeg-release-full.7z -o$${DIST_DIR}
- rm $${DIST_DIR}/ffmpeg-release-full.7z
- ls $${DIST_DIR}/ffmpeg-* # Debugging: list files to be moved
- mv $${DIST_DIR}/ffmpeg-* $${DIST_DIR}/ffmpeg
when:
ref:
- refs/tags/*
x-distribution-linux-prepare: &distribution-linux-prepare
image: ${DRONE_REPO_LINK##https://}:linux
pull: always
environment:
<<: *default_environment_win
commands:
- echo "environments:"
- echo "$${SRCDIR}"
- echo "$${DIST_DIR}"
- cd $${SRCDIR}
- mkdir -p ./.cache
- mkdir -p ./.cache/nltk/tokenizers
- wget -P "./.cache/nltk/tokenizers" https://s3.libs.space:9000/ai-models/nltk/tokenizers/punkt.zip
- unzip -o ./.cache/nltk/tokenizers/punkt.zip -d ./.cache/nltk/tokenizers
- mkdir -p $${DIST_DIR}
#- cd $${DIST_DIR}
#- wget -P "$${DIST_DIR}" https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
#- ls -lah $${DIST_DIR}
#- tar --directory=$${DIST_DIR} -xf $${DIST_DIR}/ffmpeg-git-amd64-static.tar.xz
#- rm $${DIST_DIR}/ffmpeg-git-amd64-static.tar.xz
#- mv $${DIST_DIR}/ffmpeg-git-amd64-static $${DIST_DIR}/ffmpeg
when:
ref:
- refs/tags/*
x-build-distribution-windows-package: &build-distribution-windows-package
# name: build-distribution-windows-package
image: ${DRONE_REPO_LINK##https://}:win64
pull: always
environment:
<<: *default_environment_win
commands:
- cd $${SRCDIR}
- cd $${DIST_DIR}
- cp $${SRCDIR}/ignorelist.txt ./
- cp $${SRCDIR}/LICENSE ./
- cp -Rf $${SRCDIR}/websocket_clients ./
- cp -Rf $${SRCDIR}/markers ./
- cp -Rf $${SRCDIR}/dist_files/Plugins ./
- cp -Rf $${SRCDIR}/dist_files/get-device-list.bat ./
- cp -Rf $${SRCDIR}/dist_files/help.bat ./
- cp -Rf $${SRCDIR}/dist_files/.current_platform.yaml.template ./.current_platform.yaml
- WT_VERSION="$${DRONE_TAG#v}"
- sed -i "s/###VERSION###/$${WT_VERSION}/g" "./.current_platform.yaml"
#- zip -r -9 whispering-tiger$${WT_VERSION}_$${OS}.zip .
- 7z a -tzip -mx=9 -mfb=128 whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip .
when:
ref:
- refs/tags/*
#depends_on:
# - build-distribution-windows
x-build-distribution-linux-package: &build-distribution-linux-package
image: ${DRONE_REPO_LINK##https://}:linux
pull: always
environment:
<<: *default_environment_win
commands:
- cd $${SRCDIR}
- cd $${DIST_DIR}
- cp $${SRCDIR}/ignorelist.txt ./
- cp $${SRCDIR}/LICENSE ./
- cp -Rf $${SRCDIR}/websocket_clients ./
- cp -Rf $${SRCDIR}/markers ./
- cp -Rf $${SRCDIR}/dist_files/Plugins ./
- cp -Rf $${SRCDIR}/dist_files/get-device-list.bat ./
- cp -Rf $${SRCDIR}/dist_files/help.bat ./
- cp -Rf $${SRCDIR}/dist_files/.current_platform.yaml.template ./.current_platform.yaml
- WT_VERSION="$${DRONE_TAG#v}"
- sed -i "s/###VERSION###/$${WT_VERSION}/g" "./.current_platform.yaml"
#- zip -r -9 whispering-tiger$${WT_VERSION}_$${OS}.zip .
- 7z a -tzip -mx=9 -mfb=128 whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip .
when:
ref:
- refs/tags/*
steps:
# - <<: *build_builder_image
# name: build-publish-main-image_win
# settings:
# dockerfile: ./builder/Dockerfile-windows
# tags: win64
# when:
# branch:
# - master
# - main
#
# # prepare build files and dependencies (NVIDIA)
# - <<: *distribution-windows-prepare
# name: build-distribution-windows-prepare_nvidia
# environment:
# GPU_TYPE: NVIDIA
# DIST_DIR: ./dist/windows/nvidia
# # actual build process (NVIDIA)
# - name: build-distribution-windows_nvidia
# image: ${DRONE_REPO_LINK##https://}:win64
# pull: always
# environment:
# <<: *default_environment_win
# GPU_TYPE: NVIDIA
# DIST_DIR: ./dist/windows/nvidia
# when:
# ref:
# - refs/tags/*
# depends_on:
# - build-distribution-windows-prepare_nvidia
# # package release (NVIDIA)
# - <<: *build-distribution-windows-package
# name: build-distribution-windows-package_nvidia
# environment:
# GPU_TYPE: NVIDIA
# DIST_DIR: ./dist/windows/nvidia
# depends_on:
# - build-distribution-windows_nvidia
#
#
# # prepare build files and dependencies (AMD)
# #- <<: *distribution-windows-prepare
# # name: build-distribution-windows-prepare_amd
# # environment:
# # GPU_TYPE: AMD
# # DIST_DIR: ./dist/windows/amd
# # actual build process (AMD)
# #- name: build-distribution-windows_amd
# # image: ${DRONE_REPO_LINK##https://}:win64
# # pull: always
# # environment:
# # <<: *default_environment_win
# # GPU_TYPE: AMD
# # DIST_DIR: ./dist/windows/amd
# # when:
# # ref:
# # - refs/tags/*
# # depends_on:
# # - build-distribution-windows-prepare_amd
# # package release (AMD)
# #- <<: *build-distribution-windows-package
# # name: build-distribution-windows-package_amd
# # environment:
# # GPU_TYPE: AMD
# # DIST_DIR: ./dist/windows/amd
# # depends_on:
# # - build-distribution-windows_amd
#
#
#
# - name: build-distribution-windows-package-hash
# image: ${DRONE_REPO_LINK##https://}:win64
# pull: always
# environment:
# <<: *default_environment_win
# commands:
# - cd $${SRCDIR}
# - WT_VERSION="$${DRONE_TAG#v}"
# # --- nvidia
# - GPU_TYPE=NVIDIA
# - cd $${DIST_DIR}/nvidia
# - hash=$$(sha256sum whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip | awk '{ print $$1 }')
# - echo "SHA256 (WIN/$$GPU_TYPE) = $$hash"
# # --- amd
# #- GPU_TYPE=AMD
# #- cd $${DIST_DIR}/amd
# #- hash=$$(sha256sum whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip | awk '{ print $$1 }')
# #- echo "SHA256 (WIN$$GPU_TYPE) = $$hash"
# when:
# ref:
# - refs/tags/*
# depends_on:
# - build-distribution-windows-package_nvidia
# #- build-distribution-windows-package_amd
# - <<: *upload-build-s3
# name: upload-s3-windows
# environment:
# <<: *default_environment_win
# MINIO_HOST:
# from_secret: s3-endpoint-s3
# MINIO_ACCESS_KEY:
# from_secret: s3-access-key-s3
# MINIO_SECRET_KEY:
# from_secret: s3-secret-key-s3
# depends_on:
# - build-distribution-windows-package_nvidia
# #- build-distribution-windows-package_amd
# - <<: *upload-build-s3
# name: upload-eu-windows
# environment:
# <<: *default_environment_win
# MINIO_HOST:
# from_secret: s3-endpoint-eu
# MINIO_ACCESS_KEY:
# from_secret: s3-access-key-eu
# MINIO_SECRET_KEY:
# from_secret: s3-secret-key-eu
# depends_on:
# - build-distribution-windows-package_nvidia
# #- build-distribution-windows-package_amd
# - <<: *upload-build-s3
# name: upload-us-windows
# environment:
# <<: *default_environment_win
# MINIO_HOST:
# from_secret: s3-endpoint-us
# MINIO_ACCESS_KEY:
# from_secret: s3-access-key-us
# MINIO_SECRET_KEY:
# from_secret: s3-secret-key-us
# depends_on:
# - build-distribution-windows-package_nvidia
# #- build-distribution-windows-package_amd
# ###########
# LINUX
# ###########
- <<: *build_builder_image
name: build-publish-main-image_linux
settings:
dockerfile: ./builder/Dockerfile-linux64
tags: linux
when:
branch:
- master
- main
# prepare build files and dependencies (NVIDIA)
- <<: *distribution-linux-prepare
name: build-distribution-linux-prepare_nvidia
environment:
GPU_TYPE: NVIDIA
DIST_DIR: ./dist/linux/nvidia
# actual build process (NVIDIA)
- name: build-distribution-linux_nvidia
image: ${DRONE_REPO_LINK##https://}:linux
pull: always
environment:
<<: *default_environment_linux
GPU_TYPE: NVIDIA
DIST_DIR: ./dist/linux/nvidia
when:
ref:
- refs/tags/*
depends_on:
- build-distribution-linux-prepare_nvidia
# package release (NVIDIA)
- <<: *build-distribution-linux-package
name: build-distribution-linux-package_nvidia
environment:
GPU_TYPE: NVIDIA
DIST_DIR: ./dist/linux/nvidia
depends_on:
- build-distribution-linux_nvidia
- name: build-distribution-linux-package-hash
image: ${DRONE_REPO_LINK##https://}:linux
pull: always
environment:
<<: *default_environment_linux
commands:
- cd $${SRCDIR}
- WT_VERSION="$${DRONE_TAG#v}"
# --- nvidia
- GPU_TYPE=NVIDIA
- cd $${DIST_DIR}/nvidia
- hash=$$(sha256sum whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip | awk '{ print $$1 }')
- echo "SHA256 (LINUX/$$GPU_TYPE) = $$hash"
# --- amd
- GPU_TYPE=AMD
- cd $${DIST_DIR}/amd
- hash=$$(sha256sum whispering-tiger$${WT_VERSION}_CPU-$${GPU_TYPE}_$${OS}.zip | awk '{ print $$1 }')
- echo "SHA256 (LINUX/$$GPU_TYPE) = $$hash"
when:
ref:
- refs/tags/*
depends_on:
- build-distribution-linux-package_nvidia
#- build-distribution-linux-package_amd
- <<: *upload-build-s3
name: upload-s3-linux
environment:
<<: *default_environment_linux
MINIO_HOST:
from_secret: s3-endpoint-s3
MINIO_ACCESS_KEY:
from_secret: s3-access-key-s3
MINIO_SECRET_KEY:
from_secret: s3-secret-key-s3
depends_on:
- build-distribution-linux-package_nvidia
trigger:
#event:
# - tag
ref:
exclude:
- refs/pipelines/*