Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: add option to skip building thirdparties; change default compression to lz4 #240

Merged
merged 4 commits into from
Dec 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ cache:

before_install:
- wget https://raw.githubusercontent.com/xiaomi/pegasus-common/master/build-depends.tar.gz
- tar xf build-depends.tar.gz
- tar xfz build-depends.tar.gz
- rm -f build-depends.tar.gz
- cd packages
- ls | xargs sudo dpkg -i --force-depends
- cd ..
Expand All @@ -33,13 +34,16 @@ install:
before_script:
- cd rdsn/thirdparty
- wget https://raw.githubusercontent.com/xiaomi/pegasus-common/master/pegasus-thirdparty-prebuild.tar.gz
- tar xf pegasus-thirdparty-prebuild.tar.gz
- rm -rf pegasus-thirdparty-prebuild.tar.gz
- tar xfz pegasus-thirdparty-prebuild.tar.gz
- rm -f pegasus-thirdparty-prebuild.tar.gz
- cd ../..
- ulimit -c unlimited -S

script:
- ./run.sh build && ./run.sh test
- ./run.sh build --skip_thirdparty && ./run.sh test

after_script:
- ./run.sh stop_zk

notifications:
email: false
10 changes: 9 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function usage_build()
echo " -v|--verbose build in verbose mode, default no"
echo " --disable_gperf build without gperftools, this flag is mainly used"
echo " to enable valgrind memcheck, default no"
echo " --skip_thirdparty whether to skip building thirdparties, default no"
}
function run_build()
{
Expand All @@ -85,6 +86,8 @@ function run_build()
WARNING_ALL=NO
ENABLE_GCOV=NO
RUN_VERBOSE=NO
DISABLE_GPERF=NO
SKIP_THIRDPARTY=NO
TEST_MODULE=""
while [[ $# > 0 ]]; do
key="$1"
Expand Down Expand Up @@ -136,7 +139,9 @@ function run_build()
;;
--disable_gperf)
DISABLE_GPERF=YES
shift
;;
--skip_thirdparty)
SKIP_THIRDPARTY=YES
;;
*)
echo "ERROR: unknown option \"$key\""
Expand Down Expand Up @@ -192,6 +197,9 @@ function run_build()
if [ "$DISABLE_GPERF" == "YES" ]; then
OPT="$OPT --disable_gperf"
fi
if [ "$SKIP_THIRDPARTY" == "YES" ]; then
OPT="$OPT --skip_thirdparty"
fi
./run.sh build $OPT --notest
if [ $? -ne 0 ]; then
echo "ERROR: build rdsn failed"
Expand Down
1 change: 0 additions & 1 deletion scripts/clear_zk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ then
rm -rf $ZOOKEEPER_HOME/data &>/dev/null
echo "Clearing zookeeper ... CLEARED"
fi

5 changes: 2 additions & 3 deletions scripts/start_zk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if [ ! -f zookeeper-3.4.6.tar.gz ]; then
download_url="http://git.n.xiaomi.com/pegasus/packages/raw/master/zookeeper-3.4.6.tar.gz"
wget -T 5 -t 1 $download_url
if [ $? -ne 0 ]; then
download_url="https://github.com/shengofsun/packages/raw/master/zookeeper-3.4.6.tar.gz"
download_url="https://github.com/xiaomi/pegasus-common/raw/master/zookeeper-3.4.6.tar.gz"
wget -T 5 -t 1 $download_url
if [ $? -ne 0 ]; then
echo "ERROR: download zookeeper failed"
Expand All @@ -57,7 +57,7 @@ sed -i "s@clientPort=2181@clientPort=$ZOOKEEPER_PORT@" $ZOOKEEPER_HOME/conf/zoo.

mkdir -p $ZOOKEEPER_HOME/data
$ZOOKEEPER_HOME/bin/zkServer.sh start
sleep 0.1
sleep 1

if echo ruok | nc localhost $ZOOKEEPER_PORT | grep -q imok; then
echo "Zookeeper started at port $ZOOKEEPER_PORT"
Expand All @@ -66,4 +66,3 @@ else
echo "ERROR: start zookeeper failed"
exit 1
fi

1 change: 0 additions & 1 deletion scripts/stop_zk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ if [ -d "$ZOOKEEPER_HOME" ]
then
$ZOOKEEPER_HOME/bin/zkServer.sh stop
fi

2 changes: 1 addition & 1 deletion src/server/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
rocksdb_level0_slowdown_writes_trigger = 30
rocksdb_level0_stop_writes_trigger = 60
rocksdb_disable_table_block_cache = false
rocksdb_compression_type = snappy
rocksdb_compression_type = lz4

checkpoint_reserve_min_count = 3
checkpoint_reserve_time_seconds = 3600
Expand Down