From ab96359bfefa08eddfb688137ca07c1efcbb494f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 20 Jun 2012 11:03:48 +0200 Subject: [PATCH] script/autobuild: delay start of small projects by 60 to 600 seconds This should reduce the startup load. metze Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Wed Jun 20 14:56:51 CEST 2012 on sn-devel-104 --- script/autobuild.py | 32 ++++++++++++++++++++++++-------- script/random-sleep.sh | 21 +++++++++++++++++++++ 2 files changed, 45 insertions(+), 8 deletions(-) create mode 100755 script/random-sleep.sh diff --git a/script/autobuild.py b/script/autobuild.py index c1edc92061b..8bdb281bbd2 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -55,7 +55,9 @@ tasks = { ("check-clean-tree", "script/clean-source-tree.sh", "text/plain"), ("clean", "make clean", "text/plain") ], - "samba4-libs" : [ ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"), + "samba4-libs" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("talloc-configure", "cd lib/talloc && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"), ("talloc-make", "cd lib/talloc && make", "text/plain"), ("talloc-install", "cd lib/talloc && make install", "text/plain"), @@ -75,7 +77,9 @@ tasks = { ("make", "make", "text/plain"), ("install", "make install", "text/plain")], - "ldb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), + "ldb" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), ("make", "make", "text/plain"), ("install", "make install", "text/plain"), ("test", "TDB_NO_FSYNC=1 make test", "text/plain"), @@ -84,7 +88,9 @@ tasks = { ("clean", "make clean", "text/plain") ], # We don't use TDB_NO_FSYNC=1 here, because we want to test the transaction code - "tdb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), + "tdb" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), ("make", "make", "text/plain"), ("install", "make install", "text/plain"), ("test", "make test", "text/plain"), @@ -92,7 +98,9 @@ tasks = { ("distcheck", "make distcheck", "text/plain"), ("clean", "make clean", "text/plain") ], - "ntdb" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), + "ntdb" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), ("make", "make", "text/plain"), ("install", "make install", "text/plain"), ("test", "make test", "text/plain"), @@ -100,7 +108,9 @@ tasks = { ("distcheck", "make distcheck", "text/plain"), ("clean", "make clean", "text/plain") ], - "talloc" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), + "talloc" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), ("make", "make", "text/plain"), ("install", "make install", "text/plain"), ("test", "make test", "text/plain"), @@ -108,7 +118,9 @@ tasks = { ("distcheck", "make distcheck", "text/plain"), ("clean", "make clean", "text/plain") ], - "replace" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), + "replace" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), ("make", "make", "text/plain"), ("install", "make install", "text/plain"), ("test", "make test", "text/plain"), @@ -116,7 +128,9 @@ tasks = { ("distcheck", "make distcheck", "text/plain"), ("clean", "make clean", "text/plain") ], - "tevent" : [ ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), + "tevent" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "./configure --enable-developer -C ${PREFIX}", "text/plain"), ("make", "make", "text/plain"), ("install", "make install", "text/plain"), ("test", "make test", "text/plain"), @@ -124,7 +138,9 @@ tasks = { ("distcheck", "make distcheck", "text/plain"), ("clean", "make clean", "text/plain") ], - "pidl" : [ ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"), + "pidl" : [ + ("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), + ("configure", "perl Makefile.PL PREFIX=${PREFIX_DIR}", "text/plain"), ("touch", "touch *.yp", "text/plain"), ("make", "make", "text/plain"), ("test", "make test", "text/plain"), diff --git a/script/random-sleep.sh b/script/random-sleep.sh new file mode 100755 index 00000000000..70b0c03ec9e --- /dev/null +++ b/script/random-sleep.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# + +if [ $# -lt 2 ]; then + echo "$0: " + exit 1; +fi + +l=$1 +h=$2 + +s=$(expr $h - $l) + +r=$(head --bytes=2 /dev/urandom | od -l | head -n 1 | sed -e 's/^[^ ]* *//') + +v=$(expr $r % $s) +d=$(expr $l + $v) + +echo "$0: sleep $d ... start" +#sleep $d +echo "$0: sleep $d ... end" -- 2.34.1