-
Notifications
You must be signed in to change notification settings - Fork 972
117 lines (104 loc) · 4.03 KB
/
mysqltest_bigtable.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
name: "mysqltest"
on:
# push:
# branches:
# - 'release-**'
# paths-ignore:
# - 'docs/**'
# pull_request:
# #The branches below must be a subset of the branches above
# branches:
# - 'release-**'
# paths-ignore:
# - 'docs/**'
schedule:
- cron: '30 20 * * *'
workflow_dispatch:
jobs:
mysqltest:
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
size: [ 'big', 'small' ]
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Build
timeout-minutes: 10
uses: ./.github/actions/build
- name: Run Redis
run: |
sudo docker run -d --name redis -v redis-data:/data \
-p 6379:6379 redis redis-server --appendonly yes
- name: Juicefs Format
run: |
sudo ./juicefs format --trash-days 0 redis://127.0.0.1:6379/1 pics
- name: Juicefs Mount
run: |
sudo ./juicefs mount -d redis://127.0.0.1:6379/1 /tmp/jfs --no-usage-report
- name: Change Data Dir
run: |
sudo service mysql stop
sudo sed -i "s?.*datadir.*?datadir=/tmp/jfs/mysql?" /etc/mysql/mysql.conf.d/mysqld.cnf
sudo cat /etc/mysql/mysql.conf.d/mysqld.cnf
sudo mkdir /tmp/jfs/mysql
sudo chmod 777 /var/lib/mysql/
sudo cp -a -r /var/lib/mysql/* /tmp/jfs/mysql/
sudo chmod 777 /tmp/jfs/mysql/
sudo chown -R mysql:mysql /tmp/jfs/mysql/
sudo chmod 777 /etc/apparmor.d/tunables/alias
sudo echo "alias /var/lib/mysql/ -> /tmp/jfs/mysql/," >>/etc/apparmor.d/tunables/alias
sudo service apparmor restart
sudo service mysql start
sudo service mysql status
sudo mysql -uroot -proot -e "select @@datadir;"
- name: Change Parameters
run: |
mysql -uroot -proot -e "show variables like 'log_error';"
mysql -uroot -proot -e "set global log_error_verbosity=3;"
mysql -uroot -proot -e "show variables like 'log_error_verbosity';"
mysql -uroot -proot -e "set global max_prepared_stmt_count=500000;"
- name: Install Sysbench
run: |
curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | sudo bash
sudo .github/scripts/apt_install.sh sysbench
sudo mysql -uroot -proot -e "create database test;"
echo "mysql-host=127.0.0.1" >>/tmp/config.cfg
echo "mysql-port=3306" >>/tmp/config.cfg
echo "mysql-user=root" >>/tmp/config.cfg
echo "mysql-password=root" >>/tmp/config.cfg
echo "mysql-db=test" >>/tmp/config.cfg
echo "report-interval=10" >>/tmp/config.cfg
echo "db-driver=mysql" >>/tmp/config.cfg
- name: Big Size Table Test
run: |
if [ "${{matrix.size}}" == "big"]; then
echo "threads=8" >>/tmp/config.cfg
TABLE_SIZE=20000
tables=4
else
echo "threads=16" >>/tmp/config.cfg
TABLE_SIZE=10000
tables=8
fi
for item in oltp_point_select oltp_read_only oltp_write_only oltp_read_write oltp_point_select; do
sudo sysbench --config-file=/tmp/config.cfg $item --tables=$tables --time=300 --table-size=$TABLE_SIZE prepare
sudo sysbench --config-file=/tmp/config.cfg $item --tables=$tables --time=300 --table-size=$TABLE_SIZE run
sudo sysbench --config-file=/tmp/config.cfg $item --tables=$tables --time=300 --table-size=$TABLE_SIZE cleanup
done
- name: Log
if: always()
run: |
echo "juicefs log"
sudo tail -n 1000 /var/log/juicefs.log
grep "<FATAL>:" /var/log/juicefs.log && exit 1 || true
- name: Send Slack Notification
if: failure()
uses: juicedata/slack-notify-action@main
with:
channel-id: "${{ secrets.SLACK_CHANNEL_ID_FOR_PR_CHECK_NOTIFY }}"
slack_bot_token: "${{ secrets.SLACK_BOT_TOKEN }}"