-
Notifications
You must be signed in to change notification settings - Fork 92
/
ceph-perf-pull-requests.yml
252 lines (238 loc) · 8.88 KB
/
ceph-perf-pull-requests.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
# macros
- scm:
name: ceph-main
scm:
- git:
url: https://github.com/ceph/ceph.git
branches:
- origin/main
skip-tag: true
timeout: 20
basedir: "ceph-main"
shallow-clone: true
wipe-workspace: true
- scm:
name: ceph-pr
scm:
- git:
url: https://github.com/ceph/ceph.git
branches:
- origin/pr/${ghprbPullId}/merge
refspec: +refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/*
timeout: 20
basedir: "ceph-pr"
shallow-clone: true
wipe-workspace: true
- scm:
name: cbt
scm:
- git:
url: https://github.com/ceph/cbt.git
refspec: +refs/heads/main:refs/remotes/origin/main
do-not-fetch-tags: true
honor-refspec: true
name: origin
branches:
- refs/heads/main
timeout: 20
wipe-workspace: false
basedir: "cbt"
skip-tag: true
shallow-clone: true
clean:
after: true
- builder:
name: run-cbt
builders:
- shell: |
cd {src-dir}
archive_dir={archive-basedir}/$(git rev-parse --short HEAD)
if test -d $archive_dir ; then
exit 0
fi
export NPROC=$(nproc)
export FOR_MAKE_CHECK=true
cxx_compiler=g++
c_compiler=gcc
for i in $(seq 15 -1 10); do
if type -t clang-$i > /dev/null; then
cxx_compiler="clang++-$i"
c_compiler="clang-$i"
break
fi
done
if test {osd-flavor} = "crimson" ; then
export WITH_SEASTAR=true
# TODO use clang-10 on ubuntu/focal
timeout 7200 src/script/run-make.sh \
--cmake-args "-DCMAKE_CXX_COMPILER=$cxx_compiler -DCMAKE_C_COMPILER=$c_compiler -DCMAKE_BUILD_TYPE=Release -DWITH_SEASTAR=ON -DWITH_TESTS=OFF" \
vstart-base crimson-osd
src/script/run-cbt.sh --build-dir $PWD/build --source-dir $PWD --cbt ${{WORKSPACE}}/cbt -a $archive_dir src/test/crimson/cbt/radosbench_4K_read.yaml
else
timeout 7200 src/script/run-make.sh --cmake-args "-DCMAKE_BUILD_TYPE=Release -DWITH_TESTS=OFF" vstart-base
src/script/run-cbt.sh --build-dir $PWD/build --source-dir $PWD --cbt ${{WORKSPACE}}/cbt -a $archive_dir src/test/crimson/cbt/radosbench_4K_read.yaml --classical
fi
- builder:
name: compare-cbt-results
builders:
- shell: |
cd ${{WORKSPACE}}/{src-dir-main}
archive_dir_main={archive-main}/$(git rev-parse --short HEAD)
cd ${{WORKSPACE}}/{src-dir-pr}
archive_dir_pr={archive-pr}/$(git rev-parse --short HEAD)
. ${{WORKSPACE}}/gh-venv/bin/activate
${{WORKSPACE}}/cbt/compare.py -v \
-a $archive_dir_pr \
-b $archive_dir_main \
--output report.md && result=success || result=failure
github-check \
--owner {check-repo-owner} \
--repo {check-repo-name} \
--pkey-file ${{GITHUB_CHECK_PKEY_PEM}} \
--app-id {check-app-id} \
--install-id {check-install-id} \
--name {check-name} \
--sha ${{ghprbActualCommit}} \
--external-id ${{BUILD_ID}} \
--details-url ${{BUILD_URL}} \
--status completed --conclusion ${{result}} \
--title perf-test \
--summary ${{result}} \
--text report.md
- job-template:
name: 'ceph-perf-{osd-flavor}'
project-type: freestyle
defaults: global
concurrent: true
# use lastest rhel and ubuntu for crimson for clang build
node: performance
display-name: 'ceph: {osd-flavor} perf test'
quiet-period: 5
block-downstream: false
block-upstream: false
retry-count: 3
check-app-id: "62865"
check-install-id: "8465036"
check-name: "perf-test"
check-repo-owner: "ceph"
check-repo-name: "ceph"
properties:
- build-discarder:
days-to-keep: 15
num-to-keep: 300
artifact-days-to-keep: -1
artifact-num-to-keep: -1
- github:
url: https://github.com/ceph/ceph/
- rebuild:
auto-rebuild: true
parameters:
- string:
name: ghprbPullId
description: "the GitHub pull id, like '72' in 'ceph/pull/72'"
triggers:
- github-pull-request:
allow-whitelist-orgs-as-admins: true
org-list:
- ceph
trigger-phrase: 'jenkins test {osd-flavor} perf'
skip-build-phrase: '^jenkins do not test.*'
only-trigger-phrase: false
white-list-labels:
- performance
- crimson
github-hooks: true
permit-all: true
auto-close-on-fail: false
cancel-builds-on-update: true
scm:
- ceph-main
- ceph-pr
- cbt
builders:
- shell: |
cd ${{WORKSPACE}}/cbt
. /etc/os-release || ID=ubuntu
case $ID in
debian|ubuntu)
sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y python3-yaml python3-lxml python3-prettytable clang-12
;;
centos|rhel)
sudo dnf copr remove tchaikov/llvm-toolset-10 || true
sudo dnf module enable -y llvm-toolset
sudo dnf install -y llvm-toolset
sudo yum install -y python3-pyyaml python3-lxml python3-prettytable
sudo yum update -y libarchive
gcc_toolset_ver=9
# so clang is able to find gcc-toolset-${{gcc_toolset_ver}} which is listed as a
# BuildRequires in ceph.spec.in, and it is installed by `run-make.sh`.
# clang searches for GCC in a bunch of well known places:
# see https://github.com/llvm-mirror/clang/blob/main/lib/Driver/ToolChains/Gnu.cpp
sudo ln -sf /opt/rh/gcc-toolset-${{gcc_toolset_ver}}/root/lib/gcc/x86_64-redhat-linux/${{gcc_toolset_ver}} \
/usr/lib/gcc/x86_64-redhat-linux/${{gcc_toolset_ver}}
;;
fedora)
sudo yum install -y python3-pyyaml python3-lxml python3-prettytable clang
;;
*)
echo "unknown distro: $ID"
exit 1
;;
esac
virtualenv -q --python python3 ${{WORKSPACE}}/gh-venv
. ${{WORKSPACE}}/gh-venv/bin/activate
pip install git+https://github.com/ceph/githubcheck.git
echo "please hold tight..." | github-check \
--owner {check-repo-owner} \
--repo {check-repo-name} \
--pkey-file ${{GITHUB_CHECK_PKEY_PEM}} \
--app-id {check-app-id} \
--install-id {check-install-id} \
--name {check-name} \
--sha ${{ghprbActualCommit}} \
--external-id ${{BUILD_ID}} \
--details-url ${{BUILD_URL}} \
--status in_progress \
--title perf-test \
--summary running
- run-cbt:
src-dir: "ceph-main"
osd-flavor: '{osd-flavor}'
# ideally cbt-results should be persited across jobs, so the test result can be reused
archive-basedir: "$WORKSPACE/cbt-results"
- run-cbt:
src-dir: "ceph-pr"
osd-flavor: '{osd-flavor}'
# use the basedir of git checkout, so it can be wiped
archive-basedir: "$WORKSPACE/ceph-pr"
- compare-cbt-results:
src-dir-main: "ceph-main"
archive-main: "$WORKSPACE/cbt-results"
src-dir-pr: "ceph-pr"
archive-pr: "$WORKSPACE/ceph-pr"
check-app-id: '{check-app-id}'
check-install-id: '{check-install-id}'
check-name: '{check-name}'
check-repo-owner: '{check-repo-owner}'
check-repo-name: '{check-repo-name}'
publishers:
- postbuildscript:
builders:
- role: SLAVE
build-on:
- FAILURE
- ABORTED
build-steps:
- shell: "sudo reboot"
wrappers:
- credentials-binding:
- file:
credential-id: cephacheck.2020-04-29.private-key.pem
variable: GITHUB_CHECK_PKEY_PEM
- project:
name: ceph-perf
osd-flavor:
- crimson
- classic
jobs:
- ceph-perf-{osd-flavor}