-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.travis.yml
More file actions
431 lines (371 loc) · 14.8 KB
/
.travis.yml
File metadata and controls
431 lines (371 loc) · 14.8 KB
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
423
424
425
426
427
428
429
430
431
language: minimal
matrix:
include:
- name: Ubuntu 14.04 and sqlite (Sys V Init on host)
os: linux
dist: trusty
env:
- BENCHMARK_7Z=true
- TINY_MEM_BENCH=true
- name: Native ARM64 Ubuntu 18.04 and sqlite (SystemD on host)
os: linux
dist: bionic
arch: arm64
env:
- BENCHMARK_7Z=true
- TINY_MEM_BENCH=true
- FIO_BENCHMARKS=true
- name: Ubuntu 16.04 and sqlite (SystemD on host)
os: linux
dist: xenial
- name: Ubuntu 18.04 and sqlite (SystemD on host)
os: linux
dist: bionic
env:
- BENCHMARK_7Z=true
- TINY_MEM_BENCH=true
- FIO_BENCHMARKS=true
- name: Arm 64 on Debian 9 & 10 via docker
os: linux
dist: trusty
env:
# - MULTIARCH_IMAGES="multiarch/debian-debootstrap:arm64-buster multiarch/debian-debootstrap:arm64-jessie multiarch/debian-debootstrap:arm64-stretch multiarch/debian-debootstrap:armhf-buster multiarch/debian-debootstrap:armhf-jessie multiarch/debian-debootstrap:armhf-stretch"
- MULTIARCH_IMAGES="multiarch/debian-debootstrap:arm64-buster multiarch/debian-debootstrap:arm64-stretch"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: SystemD on Debian 8 (systemd 215), 9 & 10 (systemd 241) via docker
os: linux
dist: xenial
env:
- SYSTEMD_IMAGES="jrei/systemd-debian:8 jrei/systemd-debian:9 jrei/systemd-debian:10"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: SystemD on Ubuntu 16.04, 18.04, 20.04 via docker
os: linux
dist: xenial
env:
- SYSTEMD_IMAGES="devizervlad/systemd-on-ubuntu:16.04 devizervlad/systemd-on-ubuntu:18.04 devizervlad/systemd-on-ubuntu:20.04"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: SystemD on Fedora 26 (systemd 233) ... 31 (systemd 242) via docker
os: linux
dist: xenial
env:
- SYSTEMD_IMAGES="devizervlad/systemd-on-fedora:26 devizervlad/systemd-on-fedora:27 devizervlad/systemd-on-fedora:28 devizervlad/systemd-on-fedora:29 devizervlad/systemd-on-fedora:30 devizervlad/systemd-on-fedora:31"
- TEST_SCRIPT="sudo dnf update --nogpgcheck -y || true; install_w3top"
- name: CentOS 6.10 and MySQL 5.1 (wget)
os: linux
dist: xenial
env:
- TEST_IMAGE="centos:6.10"
- TEST_SCRIPT="mysql_51_on_centos_6 && centos_wget_only && install_w3top"
- name: CentOS 6.10 and PostgreSQL 8.4 (curl)
os: linux
dist: xenial
env:
- TEST_IMAGE="centos:6.10"
- TEST_SCRIPT="pg_84_on_centos_6 && centos_curl_only && install_w3top && sleep 66"
- name: CentOS 6.10 and PostgreSQL 11.4 (curl)
os: linux
dist: xenial
env:
- TEST_IMAGE="centos:6.10"
- TEST_SCRIPT="pg_11_on_centos_6 && centos_curl_only && install_w3top && sleep 1 "
- name: CentOS 7.0 and sqlite (wget)
os: linux
dist: xenial
env:
- TEST_IMAGE="centos:7.0.1406"
- TEST_SCRIPT="centos_wget_only && install_w3top"
- name: CentOS 7.6 and sqlite (curl)
os: linux
dist: xenial
env:
- TEST_IMAGE="centos:7.6.1810"
- TEST_SCRIPT="centos_curl_only && install_w3top"
- name: CentOS 8 and sqlite (curl)
os: linux
dist: xenial
env:
- TEST_IMAGE="centos:8"
- TEST_SCRIPT="centos_curl_only && install_w3top"
- name: Ubuntu 18.04 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="ubuntu:18.04"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Ubuntu 21.04 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="ubuntu:21.04"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Ubuntu 20.04 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="ubuntu:20.04"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Ubuntu 20.10 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="ubuntu:20.10"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Debian 8.9 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="debian:8.9"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Debian 9.9 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="debian:9.9"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Debian 10 Buster and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="debian:buster"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Debian 11 Bullseye and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="debian:bullseye"
- TEST_SCRIPT="debian_prepare && install_w3top"
- name: Fedora 27 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="fedora:27"
- TEST_SCRIPT="fedora_prepare && install_w3top"
- name: Fedora 28 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="fedora:28"
- TEST_SCRIPT="fedora_prepare && install_w3top"
- name: Fedora 31 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="fedora:31"
- TEST_SCRIPT="fedora_prepare && install_w3top"
- name: Fedora 32 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="fedora:32"
- TEST_SCRIPT="fedora_prepare && install_w3top"
# opensuse/tumbleweed, opensuse/leap:15, opensuse/leap:42
- name: OpenSUSE leap 42 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="opensuse/leap:42"
- TEST_SCRIPT="opensuse_prepare && install_w3top"
- name: OpenSUSE leap 15 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="opensuse/leap:15"
- TEST_SCRIPT="opensuse_prepare && install_w3top"
- name: OpenSUSE tumbleweed and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="opensuse/tumbleweed"
- TEST_SCRIPT="opensuse_prepare && install_w3top"
# - name: Alpine 3.7 and sqlite
# os: linux
# dist: xenial
# env:
# - TEST_IMAGE="alpine:3.7"
# - TEST_SCRIPT="alpine_prepare && install_w3top"
# - name: Alpine 3.8 and sqlite
# os: linux
# dist: xenial
# env:
# - TEST_IMAGE="alpine:3.8"
# - TEST_SCRIPT="alpine_prepare && install_w3top"
- name: Amazon Linux v2 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="amazonlinux:2"
- TEST_SCRIPT="yum install tar sudo -y; install_w3top"
- name: Amazon Linux v1 and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="amazonlinux:1"
- TEST_SCRIPT="yum install tar sudo -y; install_w3top"
- name: Manjaro linux and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="manjarolinux/base"
- TEST_SCRIPT="pacman -Syu --noconfirm haveged; pacman -Sy --noconfirm sudo tar; mkdir -p /etc/init.d; install_w3top"
- name: Arch linux and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="archlinux:base"
- TEST_SCRIPT="pacman -Sy --noconfirm sudo tar; mkdir -p /etc/init.d; install_w3top"
- name: Gentoo Hardened (no multilib) and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="gentoo/stage3-amd64-hardened-nomultilib"
- TEST_SCRIPT="gentoo_prepare; HTTP_HOST='+'; export HTTP_HOST; install_w3top"
- name: Gentoo (no multilib) and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="gentoo/stage3-amd64-nomultilib"
- TEST_SCRIPT="gentoo_prepare; HTTP_HOST='+'; export HTTP_HOST; install_w3top"
- name: Gentoo and sqlite
os: linux
dist: xenial
env:
- TEST_IMAGE="gentoo/stage3-amd64"
- TEST_SCRIPT="gentoo_prepare; HTTP_HOST='+'; export HTTP_HOST; install_w3top"
before_install:
- |
echo "Install install-build-tools-bundle.sh"
script=https://raw.githubusercontent.com/devizer/test-and-build/master/install-build-tools-bundle.sh; (wget -q -nv --no-check-certificate -O - $script 2>/dev/null || curl -ksSL $script) | bash
- sudo apt-get install -yqq toilet fio
- cat /proc/cpuinfo
- sudo docker version || true
- |
echo Login in dockerhub
echo $DOCKERHUB_PAT | docker login --username devizervlad --password-stdin
- bash show-platform.sh
- |
if [[ -n "$FIO_BENCHMARKS" ]]; then bash compare-fio-engines.sh; fi
- |
if [[ -n "$BENCHMARK_7Z" ]]; then
sudo apt-get install p7zip-full -yqq
Say "7z MULTI-threaded"
7z b
Say "7z SINGLE-threaded"
7z b -mmt=1 -md=22
fi
- |
if [[ -n "$TINY_MEM_BENCH" ]]; then
bash run-tiny-mem-bench.sh || true
fi
script:
- |
function wait_for_http() {
u="$1"; t=90;
printf "Waiting for [$u] during $t seconds ..."
while [ $t -ge 0 ]; do t=$((t-1)); curl -m 1 -skf "$u" >/dev/null && printf " OK\n"; if [ $? -eq 0 ]; then return; fi; printf "."; sleep 1; done
printf " FAIL\n";
}
function travis_say() { echo ""; toilet -f mono9 -w 120 "$1"; }
- |
wait_for_http "https://raw.githubusercontent.com/devizer/w3top-bin/master/public/version.txt"
wait_for_http "https://raw.githubusercontent.com/devizer/w3top-bin/master/public/w3top-linux-x64.tar.gz.sha256"
# local installation
- |
if [[ "$TEST_IMAGE" == "" && "$SYSTEMD_IMAGES" == "" ]]; then
set -e
Say "TEST w3top ON HOST $ID $VERSION"
source /etc/os-release;
export HTTP_PORT=5050
export RESPONSE_COMPRESSION=True
export INSTALL_DIR=/opt/w3top
script=https://raw.githubusercontent.com/devizer/w3top-bin/master/install-w3top-service.sh
(wget -q -nv --no-check-certificate -O - $script 2>/dev/null || curl -ksSL $script) | bash
wait_for_http "http://localhost:5050/"
# Build fails if corresponding url or systemd unit can't be reached
curl -I http://localhost:5050/ >/tmp/pre-jit
curl -I http://localhost:5050/
curl http://localhost:5050/api/BriefInfo && echo ""
sleep 120 # wait for pre-jitting logs
export codename="$(lsb_release -c -s)" || true
if [[ $codename == xenial ]]; then
(sudo journalctl -u w3top.service | head -242) && sudo systemctl disable w3top.service
else
cat /tmp/w3top.log && cat /etc/init.d/w3top && /etc/init.d/w3top version
fi
set +e
fi
# docker installation
- |
if [[ "$TEST_IMAGE" != "" ]]; then
Say "Test using [$TEST_IMAGE]"
docker run --privileged -d --name w3top -p "5055:5050" "$TEST_IMAGE" sh -c "while true; do sleep 42; done"
# bash on alpine is missed
if [[ "$TEST_IMAGE" == alpine* ]]; then docker exec -t w3top sh -c "apk update; apk add curl tar sudo bzip2 bash; apk add bash icu-libs ca-certificates krb5-libs libgcc libstdc++ libintl libstdc++ tzdata userspace-rcu zlib libssl1.0"; fi
docker exec -t w3top bash -c "cat /etc/*release"
docker exec -t w3top bash -c "mkdir -p /etc/init.d"
cat tests/*.sh > tests/test-sources.sh; chmod +x tests/test-sources.sh
docker cp tests/test-sources.sh w3top:/test-sources.sh
docker exec -t w3top bash -c "echo HOME: \$HOME; source /test-sources.sh; $TEST_SCRIPT && echo 'TEST FINISHED. Checking app health.'"
wait_for_http http://localhost:5055
curl -I http://localhost:5055 || exit 666
# Next test is NOT directly related to w3top
docker exec -t w3top bash -e -c 'echo "Testing INSTALL-DOTNET-DEPENDENCIES-V2.SH"; url=https://raw.githubusercontent.com/devizer/glist/master/install-dotnet-dependencies-v2.sh; (wget -q -nv --no-check-certificate -O - $url 2>/dev/null || curl -ksSL $url) | bash -e' || exit 777
fi
# 666 - w3top cant be started
# 777 - install-dotnet-dependencies-v2.sh fails
# SystemD via docker installaion
- |
error=none;
if [[ "$SYSTEMD_IMAGES" != "" ]]; then
port=5060;
for img in $SYSTEMD_IMAGES; do
Say "Test on SystemD Image [$img]"
port=$((port+1)); name="systemd_${port}";
docker run --privileged -t -d --name "$name" -p "${port}:5050" --cap-add SYS_ADMIN --rm -v "/sys/fs/cgroup:/sys/fs/cgroup:ro" "$img"
# bash on alpine is missed
if [[ "$img" == alpine* ]]; then docker exec -t "$name" sh -c "apk add --no-cache curl tar sudo bzip2 bash"; fi
# make sure SystemD is completely loaded, usually it takes about 1 second
wait_for_systemd="printf 'Wait for systemd on "$img" '; ok=''; for i in {1..9}; do systemctl is-active --quiet systemd-journald 2>/dev/null && ok='true' && echo ' OK' && break || printf '.'; sleep 1; done; [ -z \$ok ] && echo ' Fail';"
# ready for tests
cat tests/*.sh > tests/test-sources.sh; chmod +x tests/test-sources.sh
docker cp tests/test-sources.sh ${name}:/test-sources.sh
docker exec -t "$name" bash -c "$wait_for_systemd";
docker exec "$name" bash -c 'journalctl -b; echo ""; cat /etc/*release; systemctl --version; printf "\n\n\n"';
docker exec -t "$name" bash -c "echo HOME: \$HOME; source /test-sources.sh; $TEST_SCRIPT && echo 'TEST FINISHED. Checking app health.'"
# Next test is NOT directly related to w3top
docker exec -t $name bash -e -c 'echo "Testing INSTALL-DOTNET-DEPENDENCIES-V2.SH"; url=https://raw.githubusercontent.com/devizer/glist/master/install-dotnet-dependencies-v2.sh; (wget -q -nv --no-check-certificate -O - $url 2>/dev/null || curl -ksSL $url) | bash -e' || error=2
wait_for_http http://localhost:${port}
Say "Check error on SystemD image [$img]"
curl -I http://localhost:${port} || error=1
done
fi
echo "ERROR is [$error]"
if [[ $error != "none" ]]; then echo 'FAIL'; exit 333; fi
- |
error=none;
if [[ "$MULTIARCH_IMAGES" != "" ]]; then
cat tests/*.sh > tests/test-sources.sh; chmod +x tests/test-sources.sh
time docker run --rm --privileged multiarch/qemu-user-static:register --reset
port=15060;
for img in $MULTIARCH_IMAGES; do
Say "Test on multi-arch image [$img]"
port=$((port+1)); name="multiarch_${port}";
docker run --privileged -d --name $name -p "$port:5050" "$img" sh -c "while true; do sleep 4242; done"
docker exec -t $name bash -c "cat /etc/*release"
docker exec -t $name bash -c "mkdir -p /etc/init.d"
docker exec -t $name bash -c 'apt-get update -qq; apt-get upgrade -y -qq; apt-get install sudo curl procps -y -qq; url=https://raw.githubusercontent.com/devizer/glist/master/install-dotnet-dependencies.sh; (wget -q -nv --no-check-certificate -O - $url 2>/dev/null || curl -ksSL $url) | bash'
docker cp tests/test-sources.sh $name:/test-sources.sh
docker exec -t $name bash -c "echo HOME: \$HOME; source /test-sources.sh; $TEST_SCRIPT && echo 'TEST FINISHED. Checking app health.'"
# Next test is NOT directly related to w3top
docker exec -t $name bash -e -c 'echo "Testing INSTALL-DOTNET-DEPENDENCIES-V2.SH"; url=https://raw.githubusercontent.com/devizer/glist/master/install-dotnet-dependencies-v2.sh; (wget -q -nv --no-check-certificate -O - $url 2>/dev/null || curl -ksSL $url) | bash -e' || error=2
sleep 18
wait_for_http http://localhost:$port
Say "Check error on multiarch image [$img]"
curl -I http://localhost:$port || error=1
docker exec -t $name bash -c "echo 'LOG@ARM'; echo ''; cat /tmp/w3top.log" || true
docker rm -f $name || true
done
fi
echo "ERROR is [$error]"
if [[ $error != "none" ]]; then echo FAIL; exit 444; fi
- free -m || true
- Show-System-Stat