forked from artipie/artipie
-
Notifications
You must be signed in to change notification settings - Fork 0
208 lines (193 loc) · 8.14 KB
/
perftest-server.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
name: Prepare Artipie for perftests
concurrency: perftest_env
on:
push:
tags:
- "t*"
- "v*"
jobs:
perf-test1:
runs-on: [wsl-server]
steps:
- uses: actions/checkout@v3
- run: cat /etc/issue; mount; ls -lah; env; pwd; git status
- name: Check variables
run: test ! -f $HOME/.benchvars && exit 1;exit 0
- name: Prepare docker env
run: |
docker info
docker stop artipie || :
docker rm -fv artipie || :
docker image rm -f artipie/artipie:1.0-SNAPSHOT || :
docker ps
- name: Maven adapters build
run: mvn install -DskipTests
- name: Artipie docker image build
run: timeout 600 mvn clean install -Pdocker-build -DskipTests
working-directory: artpie-main
- name: Check docker image
run: docker image inspect artipie/artipie:1.0-SNAPSHOT|head -n50
- name: Checkout results repo/branch
run: git clone --depth=1 https://github.com/artipie/benchmarks.git
- name: Branch + Artipie server
run: |
pwd; ls -lah; git branch -a
git fetch
git checkout master
git pull --ff-only
cd loadtests
./artipie-snapshot.sh 8081
sleep 10
docker ps
tree ./root
ls -lah root/var/repo/artipie
working-directory: benchmarks
- name: Check connection
run: . "/opt/.benchvars" && timeout 30 curl -v "http://$SERVER_HOST:$REPO_PORT/bintest"
- name: Prepare JMeter
run: |
[ ! -s $HOME/apache-jmeter-5.5.tgz ] && wget https://dlcdn.apache.org/jmeter/binaries/apache-jmeter-5.5.tgz -O $HOME/apache-jmeter-5.5.tgz
tar xf $HOME/apache-jmeter-5.5.tgz
working-directory: benchmarks/loadtests
- name: Prepare artifacts repo
run: time ./prep-maven-dyn.py --total-artifacts 100 && du -ms ./test-data/maven-dyn
working-directory: benchmarks/loadtests
- name: Run upload test
run: |
. "/opt/.benchvars"
perfRes="./_perf_results"
rm -rf "$perfRes" ./root/var/.storage/data
mkdir -p "$perfRes"
tests="jmx-files-maven-ul jmx-files-maven-dl jmx-files-ul jmx-files-dl jmx-maven-ul jmx-maven-dl"
set -x
for testName in $tests ; do
echo "Running test $testName for $SERVER_HOST with $REPO_PORT port ..."
timeout 300 "./$testName.sh" "$SERVER_HOST" "$REPO_PORT" 180 maven-dyn
docker exec artipie jcmd 1 GC.run
sleep 10
testRes=`readlink -f last_test_result`
mv -fv "$testRes" "$perfRes/$testName"
ls -lah "$perfRes/$testName"
rm -fv last_test_result
done
working-directory: benchmarks/loadtests
- name: Extract JFR log
run: |
. "/opt/.benchvars"
DOCKER_HOST="$SERVER_HOST:$DOCKER_PORT" docker exec artipie jcmd 1 JFR.dump filename=/var/artipie/.storage/data/bintest/artipie.jfr
sleep 30
rm -fv artipie.jfr artipie.jfr.tar.xz
timeout 30 wget "http://$SERVER_HOST:$REPO_PORT/bintest/artipie.jfr"
tar cJf artipie.jfr.tar.xz artipie.jfr
working-directory: benchmarks/loadtests
- name: Uploading results
run: |
ls -lah && pwd
tag="$GITHUB_REF_NAME" # GITHUB_TAG
if [ -z "$tag" ] ; then
hash=`git rev-parse HEAD`
tag="$hash"
echo "Error: tag is empty with commit $hash"
exit 1
fi
. /opt/.benchvars
cd "benchmarks/loadtests"
perftestsRepo='./perftests_repo'
rm -rfv "$perftestsRepo"
dstDir="$perftestsRepo/perftests/$tag"
mkdir -p "$dstDir"
perfRes="./_perf_results"
for t in "$perfRes"/* ; do
dst="./$dstDir/$(basename $t)"
mkdir -p "$dst"
ls -lah "$t"
cp -fv "$t/statistics.json" "$dst"
done
tree "$perftestsRepo"
ls -lah "$dstDir"
time ./sync_perftests.sh https://central.artipie.com/artipie/benchmarks/localhost "${UPLOAD_LOGIN}" "${UPLOAD_PASSWORD}"
git config --global user.name "Perftest Action"
git config --global user.email "[email protected]"
url="https://central.artipie.com/artipie/benchmarks/localhost/perftests_repo/jfr/artipie.last.jfr.tar.xz"
echo SKIPPING curl -vT "./artipie.jfr.tar.xz" -u"${UPLOAD_LOGIN}:${UPLOAD_PASSWORD}" "$url"
env
rm -rf "$perfRes"
echo "Uploaded all test results for tag: $tag; commit: $hash"
- name: Generating graphs
working-directory: benchmarks/loadtests
run: |
pip3 install packaging==21.3 matplotlib==3.6.3 mdutils==1.6.0
. "/opt/.benchvars"
rm -rfv ./graphs
time ./perfplot.py perftests_repo/perftests ./graphs
for f in ./graphs/* ; do
echo "$f"
url="https://central.artipie.com/artipie/benchmarks/localhost/perftests_repo/graphs/$(basename $f)"
echo curl -vT "$f" -u"UPLOAD_LOGIN:UPLOAD_PASSWORD" "$url"
curl -vT "$f" -u"${UPLOAD_LOGIN}:${UPLOAD_PASSWORD}" "$url"
done
tmpDir="perftests_repo/tmp"
# For v* tags:
rm -rfv "$tmpDir"
mkdir -p "$tmpDir"
if [ -n "`find perftests_repo/perftests -maxdepth 1 -name 'v*'`" ] ; then
cp -rfv "perftests_repo/perftests"/v* "$tmpDir"
rm -rfv ./graphs_v
time ./perfplot.py "$tmpDir" ./graphs_v
for f in ./graphs_v/* ; do
echo "$f"
url="https://central.artipie.com/artipie/benchmarks/localhost/perftests_repo/graphs_v/$(basename $f)"
echo curl -vT "$f" -u"UPLOAD_LOGIN:UPLOAD_PASSWORD" "$url"
curl -vT "$f" -u"${UPLOAD_LOGIN}:${UPLOAD_PASSWORD}" "$url"
done
else
echo "No v* tag results in perftests_repo/perftests"
fi
# For t* tags:
rm -rfv "$tmpDir"
mkdir -p "$tmpDir"
if [ -n "`find perftests_repo/perftests -maxdepth 1 -name 't*'`" ] ; then
cp -rfv "perftests_repo/perftests"/t* "$tmpDir"
rm -rfv ./graphs_t
time ./perfplot.py "$tmpDir" ./graphs_t
for f in ./graphs_t/* ; do
echo "$f"
url="https://central.artipie.com/artipie/benchmarks/localhost/perftests_repo/graphs_t/$(basename $f)"
echo curl -vT "$f" -u"UPLOAD_LOGIN:UPLOAD_PASSWORD" "$url"
curl -vT "$f" -u"${UPLOAD_LOGIN}:${UPLOAD_PASSWORD}" "$url"
done
else
echo "No t* tag results in perftests_repo/perftests"
fi
rm -rfv "$tmpDir"
- name: Check performance difference stability
working-directory: benchmarks/loadtests
run: |
tag="$GITHUB_REF_NAME" # GITHUB_TAG
hash=`git rev-parse HEAD`
if [ -z "$tag" ] ; then
tag="$hash"
echo "Error: tag is empty with commit $hash"
exit 1
fi
tmpDir="perftests_repo/tmp" # compare with previous tag of the same type
rm -rfv "$tmpDir"
mkdir -p "$tmpDir"
if [[ "$tag" =~ ^v.*$ ]] ; then
cp -rfv "perftests_repo/perftests"/v* "$tmpDir"
elif [[ "$tag" =~ ^t.*$ ]] ; then
cp -rfv "perftests_repo/perftests"/t* "$tmpDir"
else
cp -rfv "perftests_repo/perftests"/* "$tmpDir"
fi
diffLimit="7.0"
ls -lah perftests_repo/perftests
if ./checkstats.py perftests_repo/perftests "$diffLimit" ; then
echo "Performance difference withit limit range"
else
echo "WARNING: Performance difference out of range. Sending emails..."
email="Subject: Artipie perftests\n\nArtipie perfrormance testing warning:\n\nPerformance difference is out of range in perftest-server.yml with threshold ${diffLimit}%.
Please check GitHub Actions logs for Artipie git tag: $tag; commit hash: $hash\n"
echo -e "$email" | ssmtp [email protected] [email protected]
fi
rm -rf "$tmpDir"