Legocastle job to report lite build binary size to scuba

Summary:
Add a legocastle job to continuously build the last 10 commits every 4 hours and report lite build binary size to scuba.
Closes https://github.com/facebook/rocksdb/pull/3511

Differential Revision: D7001730

Pulled By: yiwu-arbug

fbshipit-source-id: 7c8ca87c46d663c786a0d32be69ebbe7b19a5eb9
main
Yi Wu 7 years ago committed by Facebook Github Bot
parent 8eb1d445c3
commit 989d12313c
  1. 19
      build_tools/rocksdb-lego-determinator
  2. 41
      tools/report_lite_binary_size.sh

@ -352,6 +352,22 @@ LITE_BUILD_COMMANDS="[
}
]"
#
# Report RocksDB lite binary size to scuba
REPORT_LITE_BINARY_SIZE_COMMANDS="[
{
'name':'Rocksdb Lite Binary Size',
'oncall':'$ONCALL',
'steps': [
$CLEANUP_ENV,
{
'name':'Report RocksDB Lite binary size to scuba',
'shell':'tools/report_lite_binary_size.sh',
'user':'root',
},
],
]"
#
# RocksDB stress/crash test
#
@ -728,6 +744,9 @@ case $1 in
lite)
echo $LITE_BUILD_COMMANDS
;;
report_lite_binary_size)
echo $REPORT_LITE_BINARY_SIZE_COMMANDS
;;
stress_crash)
echo $STRESS_CRASH_TEST_COMMANDS
;;

@ -0,0 +1,41 @@
#!/usr/bin/env bash
# Script to report lite build binary size for latest RocksDB commits.
# Usage:
# ./report_lite_binary_size [num_recent_commits]
num_recent_commits=${1:-10}
echo "Computing RocksDB lite build binary size for the most recent $num_recent_commits commits."
for ((i=0; i < num_recent_commits; i++))
do
git checkout master~$i
commit_hash=$(git show -s --format=%H)
commit_time=$(git show -s --format=%ct)
# It would be nice to check if scuba already have a record for the commit,
# but sandcastle don't seems to have scuba CLI installed.
make clean
make OPT=-DROCKSDB_LITE static_lib
if make OPT=-DROCKSDB_LITE static_lib
then
build_succeeded='true'
strip librocksdb.a
binary_size=$(stat -c %s librocksdb.a)
else
build_succeeded='false'
binary_size=0
fi
current_time="\"time\": $(date +%s)"
commit_hash="\"hash\": \"$commit_hash\""
commit_time="\"commit_time\": $commit_time"
build_succeeded="\"build_succeeded\": \"$build_succeeded\""
binary_size="\"binary_size\": $binary_size"
scribe_log="{\"int\":{$current_time, $commit_time, $binary_size}, \"normal\":{$commit_hash, $build_succeeded}}"
echo "Logging to scribe: $scribe_log"
scribe_cat perfpipe_rocksdb_lite_build "$scribe_log"
done
Loading…
Cancel
Save