Merge pull request #819 from github/tar-xz-dbdeployer-upgrade

replication tests CI: switch to .tar.xz binaries, upgrade dbdeployer
This commit is contained in:
Tim Vaillancourt 2021-05-08 01:01:49 +02:00 committed by GitHub
commit d8bd21acdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,19 +4,25 @@ set -e
whoami whoami
# Clone gh-ost-ci-env fetch_ci_env() {
# Only clone if not already running locally at latest commit # Clone gh-ost-ci-env
remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1) # Only clone if not already running locally at latest commit
local_commit="unknown" remote_commit=$(git ls-remote https://github.com/github/gh-ost-ci-env.git HEAD | cut -f1)
[ -d "gh-ost-ci-env" ] && local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1) local_commit="unknown"
[ -d "gh-ost-ci-env" ] && local_commit=$(cd gh-ost-ci-env && git log --format="%H" -n 1)
echo "remote commit is: $remote_commit" echo "remote commit is: $remote_commit"
echo "local commit is: $local_commit" echo "local commit is: $local_commit"
if [ "$remote_commit" != "$local_commit" ] ; then if [ "$remote_commit" != "$local_commit" ] ; then
rm -rf ./gh-ost-ci-env rm -rf ./gh-ost-ci-env
git clone https://github.com/github/gh-ost-ci-env.git git clone https://github.com/github/gh-ost-ci-env.git
fi fi
}
test_dbdeployer() {
gh-ost-ci-env/bin/linux/dbdeployer --version
}
test_mysql_version() { test_mysql_version() {
local mysql_version local mysql_version
@ -30,17 +36,18 @@ test_mysql_version() {
mkdir -p sandbox/binary mkdir -p sandbox/binary
rm -rf sandbox/binary/* rm -rf sandbox/binary/*
gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.gz --unpack-version="$mysql_version" --sandbox-binary ${PWD}/sandbox/binary gh-ost-ci-env/bin/linux/dbdeployer unpack gh-ost-ci-env/mysql-tarballs/"$mysql_version".tar.xz --sandbox-binary ${PWD}/sandbox/binary
mkdir -p sandboxes mkdir -p sandboxes
rm -rf sandboxes/* rm -rf sandboxes/*
if echo "$mysql_version" | egrep "5[.]5[.]" ; then local mysql_version_num=${mysql_version#*-}
if echo "$mysql_version_num" | egrep "5[.]5[.]" ; then
gtid="" gtid=""
else else
gtid="--gtid" gtid="--gtid"
fi fi
gh-ost-ci-env/bin/linux/dbdeployer deploy replication "$mysql_version" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox gh-ost-ci-env/bin/linux/dbdeployer deploy replication "$mysql_version_num" --nodes 2 --sandbox-binary ${PWD}/sandbox/binary --sandbox-home ${PWD}/sandboxes ${gtid} --my-cnf-options log_slave_updates --my-cnf-options log_bin --my-cnf-options binlog_format=ROW --sandbox-directory rsandbox
sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master sed '/sandboxes/d' -i gh-ost-ci-env/bin/gh-ost-test-mysql-master
echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master echo 'sandboxes/rsandbox/m "$@"' >> gh-ost-ci-env/bin/gh-ost-test-mysql-master
@ -59,12 +66,19 @@ test_mysql_version() {
find sandboxes -name "stop_all" | bash find sandboxes -name "stop_all" | bash
} }
echo "Building..." main() {
. script/build fetch_ci_env
# Test all versions: test_dbdeployer
find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort -r | while read mysql_version ; do
echo "found MySQL version: $mysql_version" echo "Building..."
done . script/build
find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.gz" | while read f ; do basename $f ".tar.gz" ; done | sort -r | while read mysql_version ; do # Test all versions:
test_mysql_version "$mysql_version" find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.xz" | while read f ; do basename $f ".tar.xz" ; done | sort -r | while read mysql_version ; do
done echo "found MySQL version: $mysql_version"
done
find gh-ost-ci-env/mysql-tarballs/ -name "*.tar.xz" | while read f ; do basename $f ".tar.xz" ; done | sort -r | while read mysql_version ; do
test_mysql_version "$mysql_version"
done
}
main