forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (111 loc) · 5.11 KB
/
cluster_endtoend_upgrade.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
name: Cluster (upgrade)
on: [push, pull_request]
jobs:
build:
if: github.repository == 'vitessio/vitess'
name: Run endtoend tests on Cluster (upgrade)
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.16
- name: Tune the OS
run: |
echo '1024 65535' | sudo tee -a /proc/sys/net/ipv4/ip_local_port_range
# TEMPORARY WHILE GITHUB FIXES THIS https://github.com/actions/virtual-environments/issues/3185
- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
# DON'T FORGET TO REMOVE CODE ABOVE WHEN ISSUE IS ADRESSED!
- name: Check out v9.0.0
uses: actions/checkout@v2
with:
ref: v9.0.0
- name: Get dependencies
run: |
# This prepares general purpose binary dependencies
# as well as v9.0.0 specific go modules
sudo DEBIAN_FRONTEND="noninteractive" apt-get update
# Uninstall any previously installed MySQL first
sudo systemctl stop apparmor
sudo DEBIAN_FRONTEND="noninteractive" apt-get remove -y --purge mysql-server mysql-client mysql-common
sudo apt-get -y autoremove
sudo apt-get -y autoclean
sudo deluser mysql
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql
# Install mysql80
wget -c https://dev.mysql.com/get/mysql-apt-config_0.8.20-1_all.deb
echo mysql-apt-config mysql-apt-config/select-server select mysql-8.0 | sudo debconf-set-selections
sudo DEBIAN_FRONTEND="noninteractive" dpkg -i mysql-apt-config*
sudo apt-get update
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y mysql-server mysql-client
# Install everything else we need, and configure
sudo apt-get install -y make unzip g++ etcd curl git wget eatmydata
sudo service mysql stop
sudo service etcd stop
sudo bash -c "echo '/usr/sbin/mysqld { }' > /etc/apparmor.d/usr.sbin.mysqld" # https://bugs.launchpad.net/ubuntu/+source/mariadb-10.1/+bug/1806263
sudo ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld || echo "could not remove mysqld profile"
go mod download
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get install -y gnupg2
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
sudo apt-get update
sudo apt-get install percona-xtrabackup-24
- name: Building v9.0.0 binaries
timeout-minutes: 10
run: |
# We build v9.0.0 binaries and save them in a temporary location
source build.env
make build
mkdir -p /tmp/vitess-build-v9.0.0/
cp -R bin /tmp/vitess-build-v9.0.0/
- name: Check out HEAD
uses: actions/checkout@v2
- name: Run cluster endtoend test v9.0.0 (create cluster)
timeout-minutes: 5
run: |
# By checking out we deleted bin/ directory. We now restore our pre-built v9.0.0 binaries
cp -R /tmp/vitess-build-v9.0.0/bin .
# create the directory where we store test data; ensure it is empty:
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
source build.env
# We pass -skip-build so that we use the v9.0.0 binaries, not HEAD binaries
eatmydata -- go run test.go -skip-build -keep-data -docker=false -print-log -follow -shard 28
- name: Check out HEAD
uses: actions/checkout@v2
- name: Building HEAD binaries
timeout-minutes: 10
run: |
go mod download
source build.env
make build
mkdir -p /tmp/vitess-build-head/
cp -R bin /tmp/vitess-build-head/
- name: Run cluster endtoend test HEAD based on v9.0.0 data (upgrade path)
timeout-minutes: 5
run: |
# /tmp/vtdataroot exists from previous test
source build.env
# We built HEAD binaries manually in previous step and there's no need for the test to build.
eatmydata -- go run test.go -skip-build -keep-data -docker=false -print-log -follow -shard 28
- name: Run cluster endtoend test HEAD (create cluster)
timeout-minutes: 5
run: |
# create the directory where we store test data; ensure it is empty:
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
source build.env
# We still have the binaries from previous step. No need to build
eatmydata -- go run test.go -skip-build -keep-data -docker=false -print-log -follow -shard 28
- name: Run cluster endtoend test v9.0.0 based on HEAD data (downgrade path)
timeout-minutes: 5
run: |
# /tmp/vtdataroot exists from previous test
cp -R /tmp/vitess-build-v9.0.0/bin .
source build.env
# We again built manually and there's no need for the test to build.
eatmydata -- go run test.go -skip-build -keep-data -docker=false -print-log -follow -shard 28