Skip to content

Commit

Permalink
Merge pull request #7 from inikep/PS-8865-zenfs
Browse files Browse the repository at this point in the history
PS-8865: Remove ZenFS from build scripts in PS 8.1.0
  • Loading branch information
inikep authored Aug 23, 2023
2 parents 1627081 + decf11b commit 84d6196
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 105 deletions.
21 changes: 4 additions & 17 deletions build-ps/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ WITH_JEMALLOC=''
WITH_MECAB_OPTION=''
DEBUG_EXTRA=''
WITH_SSL='/usr'
WITH_ZENFS='OFF'
ZENFS_EXTRA=''
OPENSSL_INCLUDE=''
OPENSSL_LIBRARY=''
CRYPTO_LIBRARY=''
Expand All @@ -41,7 +39,7 @@ TAR=${TAR:-tar}
if ! getopt --test
then
go_out="$(getopt --options=iqdvj:m:t: \
--longoptions=i686,quiet,debug,valgrind,with-jemalloc:,with-zenfs,with-mecab:,with-ssl:,tag: \
--longoptions=i686,quiet,debug,valgrind,with-jemalloc:,with-mecab:,with-ssl:,tag: \
--name="$(basename "$0")" -- "$@")"
test $? -eq 0 || exit 1
eval set -- $go_out
Expand Down Expand Up @@ -106,12 +104,6 @@ do
exit 3
fi
;;
--with-zenfs )
shift
TARBALL_SUFFIX="-zenfs"
WITH_ZENFS="ON"
ZENFS_EXTRA="-DROCKSDB_PLUGINS=zenfs -DWITH_ZENFS_UTILITY=ON"
;;
-t | --tag )
shift
TAG="$1"
Expand Down Expand Up @@ -262,7 +254,6 @@ fi
cmake $SOURCEDIR ${CMAKE_OPTS:-} -DBUILD_CONFIG=mysql_release \
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:-RelWithDebInfo} \
$DEBUG_EXTRA \
$ZENFS_EXTRA \
-DFEATURE_SET=community \
-DCMAKE_INSTALL_PREFIX="/usr/local/$PRODUCT_FULL" \
-DMYSQL_DATADIR="/usr/local/$PRODUCT_FULL/data" \
Expand Down Expand Up @@ -433,19 +424,15 @@ fi
fi

# NORMAL TARBALL
if [[ ${WITH_ZENFS} != "ON" ]]; then
cd "$INSTALLDIR/usr/local/$PRODUCT_FULL"
link
fi
cd "$INSTALLDIR/usr/local/$PRODUCT_FULL"
link

# MIN TARBALL
if [[ $CMAKE_BUILD_TYPE != "Debug" ]]; then
cd "$INSTALLDIR/usr/local/minimal/$PRODUCT_FULL-minimal"
rm -rf mysql-test 2> /dev/null
find . -type f -exec file '{}' \; | grep ': ELF ' | cut -d':' -f1 | xargs strip --strip-unneeded
if [[ ${WITH_ZENFS} != "ON" ]]; then
link
fi
link
fi
)

Expand Down
1 change: 0 additions & 1 deletion build-ps/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
TOKUDB_OPTS_DEFAULT ?= -DWITH_VALGRIND=OFF -DUSE_VALGRIND=OFF -DDEBUG_EXTNAME=OFF -DBUILD_TESTING=OFF -DUSE_GTAGS=OFF -DUSE_CTAGS=OFF -DUSE_ETAGS=OFF -DUSE_CSCOPE=OFF -DTOKUDB_BACKUP_PLUGIN_VERSION=$(TOKUDB_BACKUP_VERSION)
TOKUDB_OPTS_RELEASE ?= $(TOKUDB_OPTS_DEFAULT) -DTOKU_DEBUG_PARANOID=OFF
TOKUDB_OPTS_DEBUG ?= $(TOKUDB_OPTS_DEFAULT) -DTOKU_DEBUG_PARANOID=ON
ZENFS_OPTS_DEFAULT ?= -DROCKSDB_PLUGINS=zenfs -DWITH_ZENFS_UTILITY=ON -DWITH_ZBD=bundled

EXPORTED_SOURCE_TARBALL = debian/percona-server-source.tar.gz

Expand Down
77 changes: 2 additions & 75 deletions build-ps/percona-server-8.0_builder.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Usage: $0 [OPTIONS]
--build_deb If it is 1 deb will be built
--build_tarball If it is 1 tarball will be built
--with_ssl If it is 1 tarball will also include ssl libs
--with_zenfs If it is 1 tarball and packages will also include zenfs
--install_deps Install build dependencies(root previlages are required)
--branch Branch for build
--repo Repo for build
Expand All @@ -25,8 +24,6 @@ Usage: $0 [OPTIONS]
--perconaft_branch Branch for PerconaFT
--tokubackup_repo TokuBackup repo (The TokuDB storage has no longer supported since 8.0.28)
--tokubackup_branch Branch for TokuBackup
--zenfs_repo ZenFS repo
--zenfs_branch Branch for ZenFS
--rpm_release RPM version( default = 1)
--deb_release DEB version( default = 1)
--debug Build debug tarball
Expand Down Expand Up @@ -60,17 +57,14 @@ parse_arguments() {
--get_sources=*) SOURCE="$val" ;;
--build_tarball=*) TARBALL="$val" ;;
--with_ssl=*) WITH_SSL="$val" ;;
--with_zenfs=*) WITH_ZENFS="$val" ;;
--branch=*) BRANCH="$val" ;;
--repo=*) REPO="$val" ;;
--install_deps=*) INSTALL="$val" ;;
--build_tokudb_tokubackup=*) BUILD_TOKUDB_TOKUBACKUP="$val" ;;
--perconaft_branch=*) PERCONAFT_BRANCH="$val" ;;
--tokubackup_branch=*) TOKUBACKUP_BRANCH="$val" ;;
--zenfs_branch=*) ZENFS_BRANCH="$val" ;;
--perconaft_repo=*) PERCONAFT_REPO="$val" ;;
--tokubackup_repo=*) TOKUBACKUP_REPO="$val" ;;
--zenfs_repo=*) ZENFS_REPO="$val" ;;
--rpm_release=*) RPM_RELEASE="$val" ;;
--deb_release=*) DEB_RELEASE="$val" ;;
--debug=*) DEBUG="$val" ;;
Expand Down Expand Up @@ -207,8 +201,6 @@ get_sources(){
echo "PERCONAFT_BRANCH=${PERCONAFT_BRANCH}" >> ../percona-server-8.0.properties
echo "TOKUBACKUP_REPO=${TOKUBACKUP_REPO}" >> ../percona-server-8.0.properties
echo "TOKUBACKUP_BRANCH=${TOKUBACKUP_BRANCH}" >> ../percona-server-8.0.properties
echo "ZENFS_REPO=${ZENFS_REPO}" >> ../percona-server-8.0.properties
echo "ZENFS_BRANCH=${ZENFS_BRANCH}" >> ../percona-server-8.0.properties
export TOKUDB_VERSION=${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}
echo "TOKUDB_VERSION=${MYSQL_VERSION_MAJOR}.${MYSQL_VERSION_MINOR}.${MYSQL_VERSION_PATCH}${MYSQL_VERSION_EXTRA}" >> ../percona-server-8.0.properties
BOOST_PACKAGE_NAME=$(cat cmake/boost.cmake|grep "SET(BOOST_PACKAGE_NAME"|awk -F '"' '{print $2}')
Expand Down Expand Up @@ -273,23 +265,7 @@ get_sources(){
fi
fi
#

if [ ! ${ZENFS_REPO} = 0 ]; then
rm -rf ${WORKDIR}/percona-server/storage/rocksdb/rocksdb_plugins/zenfs
git clone ${ZENFS_REPO} ${WORKDIR}/percona-server/storage/rocksdb/rocksdb_plugins/zenfs
fi
if [ ! ${ZENFS_BRANCH} = 0 ]; then
cd ${WORKDIR}/percona-server/storage/rocksdb/rocksdb_plugins/zenfs
git checkout ${ZENFS_BRANCH}
cd -
fi

git submodule update
cd storage/rocksdb/rocksdb_plugins/zenfs
ZEN_VER=$(git describe --abbrev=7 --dirty)
sed -i "s/^VERSION=.*/VERSION=$ZEN_VER/" generate-version.sh
./generate-version.sh
cd -
cmake . -DWITH_SSL=system -DFORCE_INSOURCE_BUILD=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=${WORKDIR}/build-ps/boost -DWITH_ZLIB=bundled
make dist
#
Expand Down Expand Up @@ -319,8 +295,6 @@ get_sources(){
rsync -av storage/rocksdb/third_party/lz4/ ${PSDIR}/storage/rocksdb/third_party/lz4 --exclude .git
rsync -av storage/rocksdb/third_party/zstd/ ${PSDIR}/storage/rocksdb/third_party/zstd --exclude .git
rsync -av extra/coredumper/ ${PSDIR}/extra/coredumper --exclude .git
rsync -av extra/libzbd/ ${PSDIR}/extra/libzbd --exclude .git
rsync -av storage/rocksdb/rocksdb_plugins/ ${PSDIR}/storage/rocksdb/rocksdb_plugins --exclude .git
rsync -av extra/libkmip/ ${PSDIR}/extra/libkmip/ --exclude .git
#
cd ${PSDIR}
Expand Down Expand Up @@ -354,32 +328,11 @@ get_sources(){
mkdir $CURDIR/source_tarball
cp ${PSDIR}.tar.gz $WORKDIR/source_tarball
cp ${PSDIR}.tar.gz $CURDIR/source_tarball
cp percona-server-8.0.properties $WORKDIR/source_tarball
cp percona-server-8.0.properties $CURDIR/source_tarball
cd $CURDIR
rm -rf percona-server
return
}

enable_zenfs() {
local mode=$1

cp $CURDIR/source_tarball/percona-server-8.0.properties $WORKDIR
source $WORKDIR/percona-server-8.0.properties

if [[ $mode == "tarball" ]]; then
echo "mode tarball selected"
elif [[ $mode == "debian" ]]; then
sed -i 's: \.\.: $(ZENFS_OPTS_DEFAULT) \.\.:g' debian/rules
sed -i '51s:percona-server:libgflags2.2, percona-server:' debian/control
echo "usr/bin/zenfs" >> debian/percona-server-rocksdb.install
dch -D unstable --force-distribution -v "${VERSION}-${RELEASE}-${DEB_RELEASE}" "Update to new upstream release Percona Server ${VERSION}-${RELEASE}-1"
elif [[ $mode == "rhel" ]]; then
echo "mode rhel selected"
fi
return
}

get_system(){
if [ -f /etc/redhat-release ]; then
GLIBC_VER_TMP="$(rpm glibc -qa --qf %{VERSION})"
Expand Down Expand Up @@ -510,7 +463,6 @@ install_deps() {
fi
if [ "x$RHEL" = "x9" ]; then
yum -y install libtirpc-devel
yum -y install gflags-devel
yum -y install gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils gcc-toolset-12-annobin-annocheck gcc-toolset-12-annobin-plugin-gcc
if [ x"$ARCH" = "xx86_64" ]; then
pushd /opt/rh/gcc-toolset-12/root/usr/lib/gcc/x86_64-redhat-linux/12/plugin/
Expand Down Expand Up @@ -575,12 +527,6 @@ install_deps() {
else
apt-get -y install libzstd1-dev
fi
if [ x${DIST} = xhirsute ]; then
apt-get -y install libzbd-dev clang-12 pkg-config make libgflags-dev nvme-cli util-linux fio zbd-utils
fi
if [[ ${DIST} == 'focal' ]] || [[ ${DIST} == 'hirsute' ]] || [[ ${DIST} == 'bullseye' ]] || [[ ${DIST} == 'jammy' ]] || [[ ${DIST} == 'bookworm' ]]; then
apt-get -y install libgflags-dev
fi
apt-get install -y libsasl2-dev libsasl2-modules-gssapi-mit libkrb5-dev
fi
if [ ! -d /usr/local/percona-subunit2junitxml ]; then
Expand Down Expand Up @@ -806,17 +752,9 @@ build_rpm(){
source /opt/rh/devtoolset-11/enable
fi
if [ ${ARCH} = x86_64 ]; then
if [[ ${WITH_ZENFS} == "1" ]]; then
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --define "with_zenfs 1" --rebuild rpmbuild/SRPMS/${SRCRPM}
else
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM}
fi
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM}
else
if [[ ${WITH_ZENFS} == "1" ]]; then
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --define "with_zenfs 1" --rebuild rpmbuild/SRPMS/${SRCRPM}
else
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM}
fi
rpmbuild --define "_topdir ${WORKDIR}/rpmbuild" --define "dist .el${RHEL}" --define "with_tokudb 0" --define "with_mecab ${MECAB_INSTALL_DIR}/usr" --rebuild rpmbuild/SRPMS/${SRCRPM}
fi

if [ $RHEL = 6 ]; then
Expand Down Expand Up @@ -919,11 +857,6 @@ build_deb(){
dpkg-source -x ${DSC}

cd ${DIRNAME}


if [[ ${WITH_ZENFS} == "1" ]]; then
enable_zenfs debian
fi
dch -b -m -D "$DEBIAN_VERSION" --force-distribution -v "${VERSION}-${RELEASE}-${DEB_RELEASE}.${DEBIAN_VERSION}" 'Update distribution'

if [ ${DEBIAN_VERSION} != trusty -a ${DEBIAN_VERSION} != xenial -a ${DEBIAN_VERSION} != jessie -a ${DEBIAN_VERSION} != stretch -a ${DEBIAN_VERSION} != artful -a ${DEBIAN_VERSION} != bionic -a ${DEBIAN_VERSION} != focal -a "${DEBIAN_VERSION}" != disco -a "${DEBIAN_VERSION}" != buster -a "${DEBIAN_VERSION}" != hirsute -a "${DEBIAN_VERSION}" != bullseye -a "${DEBIAN_VERSION}" != jammy -a "${DEBIAN_VERSION}" != bookworm ]; then
Expand Down Expand Up @@ -967,7 +900,6 @@ build_tarball(){
echo "Binary tarball will not be created"
return;
fi

get_tar "source_tarball"
cd $WORKDIR
TARFILE=$(basename $(find . -name 'percona-server-*.tar.gz' | sort | tail -n1))
Expand Down Expand Up @@ -1032,10 +964,6 @@ build_tarball(){
if [[ "${DEBUG}" == 1 ]]; then
CMAKE_OPTS="-DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --debug --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET
DIRNAME="tarball"
elif [[ ${WITH_ZENFS} == 1 ]]; then
enable_zenfs tarball
CMAKE_OPTS="-DMINIMAL_RELWITHDEBINFO=OFF -DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --with-zenfs --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET
DIRNAME="tarball"
else
CMAKE_OPTS="-DMINIMAL_RELWITHDEBINFO=OFF -DWITH_ROCKSDB=1" bash -xe ./build-ps/build-binary.sh --with-mecab="${MECAB_INSTALL_DIR}/usr" --with-jemalloc=../jemalloc/ ../TARGET
DIRNAME="tarball"
Expand All @@ -1060,7 +988,6 @@ DEB=0
SOURCE=0
TARBALL=0
WITH_SSL=0
WITH_ZENFS=0
OS_NAME=
ARCH=
OS=
Expand Down
12 changes: 0 additions & 12 deletions build-ps/percona-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
# By default a build will be done including the RocksDB
%{!?with_rocksdb: %global rocksdb 1}

# By default a build will be done excluding zenfs utility
%{?with_zenfs: %global zenfs 1}

# Pass path to mecab lib
%{?with_mecab: %global mecab_option -DWITH_MECAB=%{with_mecab}}
%{?with_mecab: %global mecab 1}
Expand Down Expand Up @@ -521,9 +518,6 @@ mkdir debug
%if 0%{?systemd}
-DWITH_SYSTEMD=1 \
%endif
%if 0%{?zenfs}
-DROCKSDB_PLUGINS=zenfs -DWITH_ZENFS_UTILITY=ON -DWITH_ZBD=bundled \
%endif$
-DWITH_INNODB_MEMCACHED=1 \
-DINSTALL_LIBDIR="%{_lib}/mysql" \
-DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
Expand Down Expand Up @@ -575,9 +569,6 @@ mkdir release
-DWITH_CURL=system \
%if 0%{?systemd}
-DWITH_SYSTEMD=1 \
%endif
%if 0%{?zenfs}
-DROCKSDB_PLUGINS=zenfs -DWITH_ZENFS_UTILITY=ON -DWITH_ZBD=bundled \
%endif
-DWITH_INNODB_MEMCACHED=1 \
-DINSTALL_LIBDIR="%{_lib}/mysql" \
Expand Down Expand Up @@ -1434,9 +1425,6 @@ fi
%attr(755, root, root) %{_libdir}/mysql/plugin/debug/ha_rocksdb.so
%attr(755, root, root) %{_bindir}/ldb
%attr(755, root, root) %{_bindir}/sst_dump
%if 0%{?zenfs}
%attr(755, root, root) %{_bindir}/zenfs
%endif
%endif

%files -n percona-mysql-router
Expand Down

0 comments on commit 84d6196

Please sign in to comment.