script/autobuild: delay start of small projects by 60 to 600 seconds
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Jun 2012 09:03:48 +0000 (11:03 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 20 Jun 2012 12:56:51 +0000 (14:56 +0200)
This should reduce the startup load.

metze

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Jun 20 14:56:51 CEST 2012 on sn-devel-104

script/autobuild.py
script/random-sleep.sh [new file with mode: 0755]

index c1edc92061b3c9eee274b9e4a8c788b5dd9cb118..8bdb281bbd2cb412e48067e3f58cfb41cd6b81de 100755 (executable)
@@ -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 (executable)
index 0000000..70b0c03
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+
+if [ $# -lt 2 ]; then
+       echo "$0: <low> <high>"
+       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"