forked from percona/percona-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.cirrus.yml
157 lines (153 loc) · 6.43 KB
/
.cirrus.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
env: # Global defaults
CCACHE_SIZE: "500M"
CCACHE_DIR: "${MOUNT_POINT}/ccache_dir"
CCACHE_NOHASHDIR: "1" # Debug info might contain a stale path if the build dir changes, but this is fine
BOOST_DIR: "${MOUNT_POINT}/boost_dir"
BOOST_VERSION: "boost_1_77_0"
PARENT_BRANCH: 8.0
MOUNT_POINT: "/data"
WORKING_DIR: "${MOUNT_POINT}/cirrus-ci-build"
RESULTS_FILE: "MTR_results"
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
filter_template: &FILTER_TEMPLATE
skip: $CIRRUS_REPO_FULL_NAME == "percona/percona-server" && $CIRRUS_PR == "" # for "percona/percona-server" test only PRs. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks
timeout_in: 60m # https://cirrus-ci.org/faq/#instance-timed-out
script_template: &SCRIPT_TEMPLATE
system_info_script: |
uname -r
df -Th
free -m
pwd
ls -l ..
nproc --all
cat /proc/cpuinfo
install_dependencies_script: |
cd $WORKING_DIR
export DEBIAN_FRONTEND=noninteractive
export PACKAGES_TO_INSTALL="unzip ca-certificates git pkg-config dpkg-dev make git cmake cmake-curses-gui ccache bison npm"
export PACKAGES_LIBS="libxml-simple-perl libeatmydata1 libfido2-dev libicu-dev libevent-dev libudev-dev libaio-dev libmecab-dev libnuma-dev liblz4-dev libzstd-dev liblzma-dev libreadline-dev libpam-dev libssl-dev libcurl4-openssl-dev libldap2-dev libkrb5-dev libsasl2-dev libsasl2-modules-gssapi-mit"
export PACKAGES_PROTOBUF="protobuf-compiler libprotobuf-dev libprotoc-dev"
apt update
apt -yq --no-install-suggests --no-install-recommends --allow-unauthenticated install $PACKAGES_TO_INSTALL $PACKAGES_LIBS $PACKAGES_PROTOBUF g++
compiler_info_script: |
echo "SELECTED_CC=$SELECTED_CC (`which $SELECTED_CC`) SELECTED_CXX=$SELECTED_CXX (`which $SELECTED_CXX`) BUILD_TYPE=$BUILD_TYPE"
$SELECTED_CC -v
$SELECTED_CXX -v
ccache --version
ccache -p
ccache --zero-stats
df -Th
clone_script: |
cd $WORKING_DIR
if [ -z "$CIRRUS_PR" ]; then
git clone --recursive --branch=$CIRRUS_BRANCH https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $WORKING_DIR
git reset --hard $CIRRUS_CHANGE_IN_REPO
else
git clone --recursive https://x-access-token:${CIRRUS_REPO_CLONE_TOKEN}@github.com/${CIRRUS_REPO_FULL_NAME}.git $WORKING_DIR
git fetch origin pull/$CIRRUS_PR/head:pull/$CIRRUS_PR
git reset --hard $CIRRUS_CHANGE_IN_REPO
fi
git submodule update --init
git submodule
df -Th
ccache_cache:
folder: "$CCACHE_DIR"
fingerprint_key: "$PARENT_BRANCH-$CIRRUS_OS-$BUILD_TYPE"
reupload_on_changes: true
boost_cache:
folder: "$BOOST_DIR"
fingerprint_key: "$BOOST_VERSION"
reupload_on_changes: true
cmake_script: |
echo "SELECTED_CC=$SELECTED_CC (`which $SELECTED_CC`) SELECTED_CXX=$SELECTED_CXX (`which $SELECTED_CXX`) BUILD_TYPE=$BUILD_TYPE"
cd $WORKING_DIR; mkdir bin; cd bin
export OPTIONS_BUILD="-DMYSQL_MAINTAINER_MODE=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_CONFIG=mysql_release -DDOWNLOAD_BOOST=1 -DWITH_BOOST=$BOOST_DIR"
export OPTIONS_COMPILER="-DCMAKE_C_COMPILER=$SELECTED_CC -DCMAKE_CXX_COMPILER=$SELECTED_CXX -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
export OPTIONS_COMPONENTS="-DWITH_ROCKSDB=ON -DWITH_KEYRING_VAULT=ON -DWITH_KEYRING_VAULT_TEST=ON -DWITH_PAM=ON -DWITH_ROUTER=ON -DWITH_UNIT_TESTS=ON"
export OPTIONS_LIBS="-DWITH_SYSTEM_LIBS=ON -DWITH_ZLIB=bundled"
cmake .. $OPTIONS_BUILD $OPTIONS_COMPILER $OPTIONS_COMPONENTS $OPTIONS_LIBS
cmake -L .
rm -f $BOOST_DIR/$BOOST_VERSION.tar.gz
compile_script: |
echo "SELECTED_CC=$SELECTED_CC (`which $SELECTED_CC`) SELECTED_CXX=$SELECTED_CXX (`which $SELECTED_CXX`) BUILD_TYPE=$BUILD_TYPE"
cd $WORKING_DIR/bin
NPROC=`nproc --all`
NTHREADS=$(( $NPROC > 16 ? 16 : $NPROC ))
echo "Using $NTHREADS/$NPROC"
make -j${NTHREADS}
ccache --show-stats
df -Th
mysql_test_run_script: |
cd $WORKING_DIR/bin
NPROC=`nproc --all`
NTHREADS=$(( $NPROC > 16 ? 16 : $NPROC ))
if [[ "$BUILD_TYPE" == "RelWithDebInfo" ]]; then
MTR_TESTS="--suite=main"
else
MTR_TESTS="main.1st"
fi
echo "Start testing with $NTHREADS/$NPROC threads; MTR_TESTS=$MTR_TESTS"
mysql-test/mysql-test-run.pl $MTR_TESTS --parallel=$NTHREADS --junit-output=$CIRRUS_WORKING_DIR/${RESULTS_FILE}.xml --mysqld-env=LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libeatmydata.so --force --max-test-fail=0 --retry-failure=0 --debug-server || echo Ignore mysql_test_run.pl errorcode
echo "Finished testing with $NTHREADS/$NPROC threads"
df -Th
npm install -g xunit-viewer
xunit-viewer --results $CIRRUS_WORKING_DIR/${RESULTS_FILE}.xml --output $CIRRUS_WORKING_DIR/${RESULTS_FILE}.html
html_artifacts:
path: ${RESULTS_FILE}.html
task:
<< : *FILTER_TEMPLATE
arm_container:
image: ubuntu:jammy
cpu: 8
memory: 32G
greedy: true
matrix:
- name: gcc Debug ubuntu:jammy
env:
SELECTED_CC: gcc
SELECTED_CXX: g++
BUILD_TYPE: Debug
- name: gcc RelWithDebInfo ubuntu:jammy
env:
SELECTED_CC: gcc
SELECTED_CXX: g++
BUILD_TYPE: RelWithDebInfo
mount_disk_script: |
lsblk
lsblk -f
df -Th
mkdir -p $WORKING_DIR
<< : *SCRIPT_TEMPLATE
task:
<< : *FILTER_TEMPLATE
aws_credentials: ENCRYPTED[!92ac22d2430cf40dfcec42f739513a65c8b368c822cb397e95f799d41c0ba4498c3a1c337ab14a25cc47b2d4b53c46c5!]
only_if: $CIRRUS_BRANCH =~ '.*cirrus.*'
ec2_instance:
# aws ec2 describe-images --filters "Name=name,Values=ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-202212*"
image: ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-arm64-server-20221206
# image: ami-0e2b332e63c56bcb5 # Ubuntu Server 22.04 LTS ARM 64-bit
type: c6gd.4xlarge # 16 vCPUs, 32 GB, 950 GB SSD, 0.6144 USD/H
region: us-east-1
architecture: arm64 # defautls to amd64
matrix:
- name: gcc Debug ubuntu:jammy
env:
SELECTED_CC: gcc
SELECTED_CXX: g++
BUILD_TYPE: Debug
- name: gcc RelWithDebInfo ubuntu:jammy
env:
SELECTED_CC: gcc
SELECTED_CXX: g++
BUILD_TYPE: RelWithDebInfo
mount_disk_script: |
lsblk
lsblk -f
df -Th
sudo mkfs -t xfs /dev/nvme1n1
sudo mkdir $MOUNT_POINT
sudo mount /dev/nvme1n1 $MOUNT_POINT
sudo mkdir -p $WORKING_DIR
df -Th
<< : *SCRIPT_TEMPLATE