Commit e4572559 authored by Rich Prohaska's avatar Rich Prohaska

add vars for amazon buckets and simplify jemalloc build

parent 7847ce98
...@@ -3,9 +3,8 @@ ...@@ -3,9 +3,8 @@
# build mysql with the tokudb storage engine and the fractal tree # build mysql with the tokudb storage engine and the fractal tree
# #
# parse arguments # parse arguments
# checkout jemalloc
# build jemalloc
# checkout the fractal tree # checkout the fractal tree
# checkout jemalloc
# build the fractal tree # build the fractal tree
# checkout the mysql source # checkout the mysql source
# checkout the tokudb storage engine # checkout the tokudb storage engine
...@@ -13,6 +12,7 @@ ...@@ -13,6 +12,7 @@
# generate a mysql build script # generate a mysql build script
# generate a mysql source tarball # generate a mysql source tarball
# execute the build script # execute the build script
# copy build files to an amazon s3 bucket
shopt -s compat31 2> /dev/null shopt -s compat31 2> /dev/null
...@@ -27,8 +27,8 @@ function usage() { ...@@ -27,8 +27,8 @@ function usage() {
echo "--build_tgz=$build_tgz" echo "--build_tgz=$build_tgz"
echo "--build_rpm=$build_rpm" echo "--build_rpm=$build_rpm"
echo "--cc=$cc --cxx=$cxx" echo "--cc=$cc --cxx=$cxx"
echo "--do_s3=$do_s3"
echo "--do_make_check=$do_make_check" echo "--do_make_check=$do_make_check"
echo "--do_s3=$do_s3 --s3_build_bucket=$s3_build_bucket --s3_release_bucket=$s3_release_bucket"
echo echo
echo "community release builds using the tokudb-7.0.1 git tag" echo "community release builds using the tokudb-7.0.1 git tag"
echo " make.mysql.bash --mysqlbuild=mysql-5.5.30-tokudb-7.0.1-linux-x86_64" echo " make.mysql.bash --mysqlbuild=mysql-5.5.30-tokudb-7.0.1-linux-x86_64"
...@@ -151,21 +151,6 @@ function get_ncpus() { ...@@ -151,21 +151,6 @@ function get_ncpus() {
fi fi
} }
function build_jemalloc() {
if [ ! -d jemalloc ] ; then
# get the jemalloc repo jemalloc
github_download Tokutek/jemalloc $(git_tree $git_tag $jemalloc_tree) jemalloc
if [ $? != 0 ] ; then exit 1; fi
pushd jemalloc
if [ $? != 0 ] ; then exit 1; fi
CC=$cc ./configure --with-private-namespace=jemalloc_
if [ $? != 0 ] ; then exit 1; fi
make
if [ $? != 0 ] ; then exit 1; fi
popd
fi
}
# check out the fractal tree source from subversion, build it, and make the fractal tree tarballs # check out the fractal tree source from subversion, build it, and make the fractal tree tarballs
function build_fractal_tree() { function build_fractal_tree() {
if [ ! -d ft-index ] ; then if [ ! -d ft-index ] ; then
...@@ -174,6 +159,10 @@ function build_fractal_tree() { ...@@ -174,6 +159,10 @@ function build_fractal_tree() {
github_download Tokutek/ft-index $(git_tree $git_tag $ftindex_tree) ft-index github_download Tokutek/ft-index $(git_tree $git_tag $ftindex_tree) ft-index
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
# get jemalloc
github_download Tokutek/jemalloc $(git_tree $git_tag $jemalloc_tree) ft-index/third_party/jemalloc
if [ $? != 0 ] ; then exit 1; fi
# get the commit id of the ft-index repo # get the commit id of the ft-index repo
local ft_revision=0 local ft_revision=0
if [ ! -z $github_token ] ; then if [ ! -z $github_token ] ; then
...@@ -205,12 +194,12 @@ function build_fractal_tree() { ...@@ -205,12 +194,12 @@ function build_fractal_tree() {
pushd build pushd build
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
#-D JEMALLOC_SOURCE_DIR=../../jemalloc \
CC=$cc CXX=$cxx cmake \ CC=$cc CXX=$cxx cmake \
-D LIBTOKUDB=$tokufractaltree \ -D LIBTOKUDB=$tokufractaltree \
-D LIBTOKUPORTABILITY=$tokuportability \ -D LIBTOKUPORTABILITY=$tokuportability \
-D CMAKE_TOKUDB_REVISION=$ft_revision \ -D CMAKE_TOKUDB_REVISION=$ft_revision \
-D CMAKE_BUILD_TYPE=$ft_build_type \ -D CMAKE_BUILD_TYPE=$ft_build_type \
-D JEMALLOC_SOURCE_DIR=../../jemalloc \
-D CMAKE_INSTALL_PREFIX=../../$tokufractaltreedir \ -D CMAKE_INSTALL_PREFIX=../../$tokufractaltreedir \
-D BUILD_TESTING=OFF \ -D BUILD_TESTING=OFF \
-D USE_GTAGS=OFF \ -D USE_GTAGS=OFF \
...@@ -641,6 +630,35 @@ function parse_mysqlbuild() { ...@@ -641,6 +630,35 @@ function parse_mysqlbuild() {
test $exitcode = 0 test $exitcode = 0
} }
# copy build files to amazon s3
function copy_to_s3() {
local $s3_build_bucket=$1; local $s3_release_bucket=$2
files=$(ls $tokufractaltreedir.tar.gz* $mysqldir.tar.gz* $mysqlsrc.tar.gz* *.rpm*)
for f in $files; do
echo `date` s3put $s3_build_bucket $f
s3put $s3_build_bucket $f $f
exitcode=$?
# index the file by date
echo `date` s3put $s3_build_bucket $f $exitcode
d=$(date +%Y%m%d)
s3put $s3_build_bucket-date $d/$f /dev/null
exitcode=$?
echo `date` s3put $s3_build_bucket-date $d/$f $exitcode
done
if [[ $git_tag =~ tokudb-.* ]] ; then
s3mkbucket $s3_release_bucket-$git_tag
if [ $? = 0 ] ; then
files=$(ls $tokufractaltreedir.tar.gz* $mysqldir.tar.gz* $mysqlsrc.tar.gz* *.rpm*)
for f in $files; do
echo `date` s3copykey $s3_release_bucket-$git_tag $f
s3copykey $s3_release_bucket-$git_tag $f tokutek-mysql-build $f
exitcode=$?
echo `date` s3copykey $s3_release_bucket-$git_tag $f $exitcode
done
fi
fi
}
PATH=$HOME/bin:$PATH PATH=$HOME/bin:$PATH
system=$(uname -s | tr '[:upper:]' '[:lower:]') system=$(uname -s | tr '[:upper:]' '[:lower:]')
...@@ -652,6 +670,8 @@ git_tag=HEAD ...@@ -652,6 +670,8 @@ git_tag=HEAD
mysqlbuild= mysqlbuild=
mysql=mysql-5.5.30 mysql=mysql-5.5.30
do_s3=0 do_s3=0
s3_build_bucket=tokutek-mysql-build
s3_release_bucket=tokutek-mysql
do_make_check=0 do_make_check=0
cc=gcc47 cc=gcc47
cxx=g++47 cxx=g++47
...@@ -674,15 +694,13 @@ while [ $# -gt 0 ] ; do ...@@ -674,15 +694,13 @@ while [ $# -gt 0 ] ; do
if [[ $arg =~ --(.*)=(.*) ]] ; then if [[ $arg =~ --(.*)=(.*) ]] ; then
k=${BASH_REMATCH[1]}; v=${BASH_REMATCH[2]} k=${BASH_REMATCH[1]}; v=${BASH_REMATCH[2]}
eval $k=$v eval $k=$v
case $k in if [ $k = mysqlbuild ] ; then
mysqlbuild)
parse_mysqlbuild $mysqlbuild parse_mysqlbuild $mysqlbuild
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
;; elif [ $k = mysql ] ; then
mysql)
parse_mysql $mysql parse_mysql $mysql
if [ $? != 0 ] ; then exit 1; fi if [ $? != 0 ] ; then exit 1; fi
esac fi
else else
usage; exit 1; usage; exit 1;
fi fi
...@@ -715,9 +733,6 @@ pushd $builddir ...@@ -715,9 +733,6 @@ pushd $builddir
basedir=$PWD basedir=$PWD
# build the jemalloc library
build_jemalloc
# build the fractal tree tarball # build the fractal tree tarball
tokufractaltree=tokufractaltreeindex-$tokudb_version tokufractaltree=tokufractaltreeindex-$tokudb_version
tokuportability=tokuportability-$tokudb_version tokuportability=tokuportability-$tokudb_version
...@@ -735,31 +750,7 @@ build_mysql_release ...@@ -735,31 +750,7 @@ build_mysql_release
# copy to s3 # copy to s3
if [ $do_s3 != 0 ] ; then if [ $do_s3 != 0 ] ; then
files=$(ls $tokufractaltreedir.tar.gz* $mysqldir.tar.gz* $mysqlsrc.tar.gz* *.rpm*) copy_to_s3 $s3_build_bucket $s3_release_bucket
for f in $files; do
# add the file to the tokutek-mysql-build bucket
echo `date` s3put $f
s3put tokutek-mysql-build $f $f
exitcode=$?
# index the file by date
echo `date` s3put tokutek-mysql-build $f $exitcode
d=$(date +%Y%m%d)
s3put tokutek-mysql-build-date $d/$f /dev/null
exitcode=$?
echo `date` s3put tokutek-mysql-build-date $d/$f $exitcode
done
if [[ $git_tag =~ tokudb-.* ]] ; then
s3mkbucket tokutek-mysql-$git_tag
if [ $? = 0 ] ; then
files=$(ls $tokufractaltreedir.tar.gz* $mysqldir.tar.gz* $mysqlsrc.tar.gz* *.rpm*)
for f in $files; do
echo `date` s3copykey $git_tag $f
s3copykey tokutek-mysql-$git_tag $f tokutek-mysql-build $f
exitcode=$?
echo `date` s3copykey $git_tag $f $exitcode
done
fi
fi
fi fi
popd popd
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment