Use pre-installed MariaDB instead of downloading it.

This commit is contained in:
Anthony Yeh 2014-08-28 13:14:26 -07:00
Родитель a81303e283
Коммит daa74c9446
3 изменённых файлов: 27 добавлений и 37 удалений

Просмотреть файл

@ -50,35 +50,21 @@ ln -snf $VTTOP/test/vthook-copy_snapshot_to_storage.sh $VTROOT/vthook/copy_snaps
ln -snf $VTTOP/test/vthook-test.sh $VTROOT/vthook/test.sh
# install mysql
if [ -d $VTROOT/dist/mysql ];
then
echo "skipping MySQL build"
else
export VT_MYSQL_ROOT=$VTROOT/dist/mysql
case "$MYSQL_FLAVOR" in
"MariaDB")
myversion=`$VT_MYSQL_ROOT/bin/mysql --version | grep MariaDB`
if [ "$myversion" == "" ]; then
echo "Couldn't find MariaDB in $VT_MYSQL_ROOT. Set VT_MYSQL_ROOT to override search location."
exit 1
fi
echo "Found MariaDB installation in $VT_MYSQL_ROOT."
;;
case "$MYSQL_FLAVOR" in
"MariaDB")
echo "Getting and compiling MariaDB"
# MariaDB may require cmake and libaio-dev to compile, I ran:
# sudo apt-get install cmake
# sudo apt-get install libaio-dev
echo "Downloading and compiling MariaDB"
pushd third_party
version="10.0.10"
wget https://downloads.mariadb.org/interstitial/mariadb-${version}/kvm-tarbake-jaunty-x86/mariadb-${version}.tar.gz
tar xzf mariadb-${version}.tar.gz
popd
pushd third_party/mariadb-${version}
cmake . -DBUILD_CONFIG=mysql_release -DCMAKE_INSTALL_PREFIX=$VTROOT/dist/mysql
make -j 8 install
rm -rf $VTROOT/dist/mysql/mysql-test
rm -rf $VTROOT/dist/mysql/sql-bench
popd
rm -rf third_party/mariadb-${version}.tar.gz third_party/mariadb-${version}
;;
*)
*)
export VT_MYSQL_ROOT=$VTROOT/dist/mysql
if [ -d $VT_MYSQL_ROOT ]; then
echo "Skipping Google MySQL build. Delete $VT_MYSQL_ROOT to force rebuild."
else
echo "Getting and compiling Google MySQL"
git clone https://code.google.com/r/sougou-vitess-mysql/ third_party/mysql
pushd third_party/mysql
@ -93,17 +79,17 @@ else
rm -rf $VTROOT/dist/mysql/sql-bench
popd
rm -rf third_party/mysql
;;
esac
fi
fi
;;
esac
# save the flavor that was used in bootstrap, so it can be restored
# every time dev.env is sourced.
echo "$MYSQL_FLAVOR" > $VT_MYSQL_ROOT/VTFLAVOR
echo "$MYSQL_FLAVOR" > $VTROOT/dist/MYSQL_FLAVOR
# generate pkg-config, so go can use mysql C client
if [ ! -x $VT_MYSQL_ROOT/bin/mysql_config ]; then
echo "cannot execute $VT_MYSQL_ROOT/bin/mysql_config, exiting" 1>&2
echo "Cannot execute $VT_MYSQL_ROOT/bin/mysql_config. Did you install a client dev package?" 1>&2
exit 1
fi

Просмотреть файл

@ -47,6 +47,7 @@ fi
export GOBIN=$VTROOT/bin
export PATH=$(prepend_path $PATH $GOBIN)
# If we have a custom built mysql, prefer it over the default installation.
export PATH=$(prepend_path $PATH $VTROOT/dist/mysql/bin)
# GOROOT sanity
@ -64,15 +65,15 @@ fi
if [ "$VT_MYSQL_ROOT" == "" ]; then
if [ "$(which mysql_config)" == "" ]; then
echo "WARNING: VT_MYSQL_ROOT unset because mysql_config not found"
echo "WARNING: VT_MYSQL_ROOT unset because mysql_config not found. Did you install a client dev package?"
else
export VT_MYSQL_ROOT=$(dirname $(dirname $(which mysql_config)))
fi
fi
# restore MYSQL_FLAVOR, saved by bootstrap.sh
if [ -r $VT_MYSQL_ROOT/VTFLAVOR ]; then
export MYSQL_FLAVOR=`cat $VT_MYSQL_ROOT/VTFLAVOR`
if [ -r $VTROOT/dist/MYSQL_FLAVOR ]; then
export MYSQL_FLAVOR=`cat $VTROOT/dist/MYSQL_FLAVOR`
fi
# mysql cgo library config

Просмотреть файл

@ -15,6 +15,9 @@ vtroot = os.environ['VTROOT']
# vtdataroot is where to put all the data files
vtdataroot = os.environ.get('VTDATAROOT', '/vt')
# vt_mysql_root is where MySQL is installed
vt_mysql_root = os.environ.get('VT_MYSQL_ROOT', os.path.join(vtroot, 'dist', 'mysql'))
# tmproot is the temporary place to put all test files
tmproot = os.path.join(vtdataroot, 'tmp')
@ -110,7 +113,7 @@ def binary_argstr(name):
# binary management for the MySQL distribution.
def mysql_binary_path(name):
return os.path.join(vtroot, 'dist', 'mysql', 'bin', name)
return os.path.join(vt_mysql_root, 'bin', name)
# topology server management: we use zookeeper in all the tests
topo_server_implementation = 'zookeeper'