forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathupgrade_downgrade_test_backups_e2e_next_release.yml
More file actions
207 lines (176 loc) · 7.28 KB
/
upgrade_downgrade_test_backups_e2e_next_release.yml
File metadata and controls
207 lines (176 loc) · 7.28 KB
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
name: Backups - E2E - Next Release - Upgrade Downgrade Testing
on:
push:
branches:
- "main"
- "release-[0-9]+.[0-9]"
tags: '**'
pull_request:
branches: '**'
branches-ignore:
- 'slack-[0-9]+.[0-9]'
concurrency:
group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing - Backups - E2E - Next Release')
cancel-in-progress: true
permissions: read-all
jobs:
upgrade_downgrade_test_e2e:
timeout-minutes: 60
name: Run Upgrade Downgrade Test - Backups - E2E - Next Release
runs-on: vitess-ubuntu24-16cpu-1
steps:
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi
- name: Check out commit's code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: 'false'
- name: Set output with latest release branch
id: output-next-release-ref
run: |
next_release_ref=$(./tools/get_next_release.sh ${{github.base_ref}} ${{github.ref}})
echo $next_release_ref
echo "next_release_ref=${next_release_ref}" >> $GITHUB_OUTPUT
- name: Check for changes in relevant files
uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1
id: changes
with:
token: ''
filters: |
end_to_end:
- 'test/config.json'
- 'go/**'
- 'go/**/*.go'
- 'test.go'
- 'Makefile'
- 'build.env'
- 'go.sum'
- 'go.mod'
- 'proto/*.proto'
- 'tools/**'
- 'config/**'
- 'bootstrap.sh'
- '.github/workflows/upgrade_downgrade_test_backups_e2e_next_release.yml'
- name: Tune the OS
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
uses: ./.github/actions/tune-os
- name: Setup GitHub access token
if: steps.changes.outputs.end_to_end == 'true'
run: git config --global url.https://${{ secrets.GH_ACCESS_TOKEN }}@github.com/.insteadOf https://github.com/
- name: Set up python
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
- name: Setup MySQL
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
uses: ./.github/actions/setup-mysql
with:
flavor: mysql-8.0
- name: Get base dependencies
timeout-minutes: 10
if: steps.changes.outputs.end_to_end == 'true'
run: |
sudo DEBIAN_FRONTEND="noninteractive" apt-get update
# Install everything else we need, and configure
sudo apt-get install -y make unzip g++ etcd-client etcd-server curl git wget grep libdbd-mysql-perl
sudo service etcd stop
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 percona-release enable-only tools
sudo apt-get update
sudo apt-get install -y percona-xtrabackup-80
# Checkout to the next release of Vitess
- name: Check out other version's code (${{ steps.output-next-release-ref.outputs.next_release_ref }})
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }}
persist-credentials: 'false'
- name: Set up Go
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
cache: false
- name: Get dependencies for the next release
if: steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building next release's binaries
if: steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |
source build.env
NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-other/
cp -R bin /tmp/vitess-build-other/
rm -Rf bin/*
# Checkout to this build's commit
- name: Check out commit's code
if: steps.changes.outputs.end_to_end == 'true'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: 'false'
- name: Set up Go
if: steps.output-next-release-ref.outputs.next_release_ref != '' && steps.changes.outputs.end_to_end == 'true'
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
cache: false
- name: Get dependencies for this commit
if: steps.changes.outputs.end_to_end == 'true'
run: |
go mod download
- name: Building the binaries for this commit
if: steps.changes.outputs.end_to_end == 'true'
timeout-minutes: 10
run: |
source build.env
NOVTADMINBUILD=1 make build
mkdir -p /tmp/vitess-build-current/
cp -R bin /tmp/vitess-build-current/
# Swap binaries, use next release's VTTablet
- name: Use next release's VTTablet
if: steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
rm -f $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vttablet $PWD/bin/vttablet
cp /tmp/vitess-build-other/bin/mysqlctl $PWD/bin/mysqlctl
cp /tmp/vitess-build-other/bin/mysqlctld $PWD/bin/mysqlctld
vttablet --version
# Run test with VTTablet at version N+1 and VTBackup at version N
- name: Run backups tests (vttablet=N+1, vtbackup=N)
if: steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
set -x
source build.env
go run test.go -skip-build -docker=false -print-log -follow -tag upgrade_downgrade_backups
# Swap binaries again, use current version's VTTablet, and next release's VTBackup
- name: Use current version VTTablet, and other version VTBackup
if: steps.changes.outputs.end_to_end == 'true'
run: |
source build.env
rm -f $PWD/bin/vtbackup $PWD/bin/vttablet $PWD/bin/mysqlctl $PWD/bin/mysqlctld
cp /tmp/vitess-build-other/bin/vtbackup $PWD/bin/vtbackup
cp /tmp/vitess-build-current/bin/vttablet $PWD/bin/vttablet
cp /tmp/vitess-build-current/bin/mysqlctl $PWD/bin/mysqlctl
cp /tmp/vitess-build-current/bin/mysqlctld $PWD/bin/mysqlctld
vtbackup --version
vttablet --version
# Run test again with VTTablet at version N, and VTBackup at version N+1
- name: Run backups tests (vttablet=N, vtbackup=N+1)
if: steps.changes.outputs.end_to_end == 'true'
run: |
rm -rf /tmp/vtdataroot
mkdir -p /tmp/vtdataroot
set -x
source build.env
go run test.go -skip-build -keep-data -docker=false -print-log -follow -tag upgrade_downgrade_backups