[PATCH RFC 8/8] aiaiai-email: move -J bigjobs into configuration file
Keller, Jacob E
jacob.e.keller at intel.com
Thu Mar 6 17:28:48 PST 2014
This modifies aiaiai-email-dispatcher to use the configuration file
instead of the command line for the bigjobs parameter.
Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
---
doc/email/example-aiaiai.cfg | 6 ++++++
email/aiaiai-email-dispatcher | 14 ++++----------
email/aiaiai-email-sh-functions | 3 ++-
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/doc/email/example-aiaiai.cfg b/doc/email/example-aiaiai.cfg
index 03c9392dac40..32cbb692867a 100644
--- a/doc/email/example-aiaiai.cfg
+++ b/doc/email/example-aiaiai.cfg
@@ -20,6 +20,12 @@
# compiling the kernel, storing temporary files, etc.
workdir = /home/aiaiai/work/aiaiai/workdir
+ # The maximum number of validators to run in parallel. This is
+ # different than the jobs variable, which controls how many threads to
+ # run for the make program. This can be used to allow concurrent
+ # validation of different patch series.
+ max_validators = 1
+
# How many parallel processes should be used for validating a patch
# or patch-set. This parameter simply translates to the "-j" option
# of the "make" program. Note, this parameter is not about how many
diff --git a/email/aiaiai-email-dispatcher b/email/aiaiai-email-dispatcher
index 72e3222d259a..53cd484b2903 100755
--- a/email/aiaiai-email-dispatcher
+++ b/email/aiaiai-email-dispatcher
@@ -37,8 +37,6 @@ for general configuration of aiaiai-email-test-patchset.
<cfgfile.ini> - aiaiai-email-test-patchset's configuration file
Options:
- -J, --bigjobs=N how many patches (or patch series) can be checked
- at the same time (default 1);
-v, --verbose be verbose;
-h, --help show this text and exit.
EOF
@@ -97,18 +95,12 @@ cleanup_handler()
}
set_cleanup_handler cleanup_handler
-TEMP=`getopt -n $PROG -o J:,v,h --long bigjobs:,verbose,help -- "$@"` ||
+TEMP=`getopt -n $PROG -o J:,v,h --long verbose,help -- "$@"` ||
fail_usage ""
eval set -- "$TEMP"
-bigjobs=1
-
while true; do
case "$1" in
- -J|--bigjobs)
- bigjobs="$(opt_check_number "$1" "$2")"
- shift
- ;;
-v|--verbose) verbose="--verbose"
;;
-h|--help)
@@ -133,6 +125,8 @@ mkdir $verbose -p -- "$1" 1>&2
queuedir="$(readlink -fv -- "$1")"; shift
cfgfile="$1"; shift
+parse_config "$cfgfile"
+
in_fifo="$(mktemp -dt "$PROG.in_fifo.XXXX")"
tmpdir="$(mktemp -dt "$PROG.tmpdir.XXXX")"
@@ -145,7 +139,7 @@ mkfifo -- "$fifo"
#
# We execute the below command as a separate process - it will run the
# aiaiai-email-test-patchset for every file name read from the fifo.
-tail -f -- "$fifo" | xargs -I{} -P"$bigjobs" -- \
+tail -f -- "$fifo" | xargs -I{} -P"$cfg_max_validators" -- \
aiaiai-email-dispatcher-helper $verbose -- "$in_fifo/{}" "$tmpdir/STOP" \
"$queuedir" "$cfgfile" >&2 &
diff --git a/email/aiaiai-email-sh-functions b/email/aiaiai-email-sh-functions
index dcbc4f175be1..17f30e28ed3b 100644
--- a/email/aiaiai-email-sh-functions
+++ b/email/aiaiai-email-sh-functions
@@ -175,7 +175,7 @@ ini_config_get_or_die()
# file:
#
# cfg_ownname, cfg_ownmail, cfg_adminname, cfg_adminmail, cfg_workdir,
-# cfg_jobs, cfg_preamble, cfg_signature, cfg_built_preamble
+# cfg_max_validators, cfg_jobs, cfg_preamble, cfg_signature, cfg_built_preamble
#
# Additionally, the following variables are set:
# o cfg_ownmail_local - the local portion of the ownmail address
@@ -192,6 +192,7 @@ parse_config()
ini_config_get_or_die cfg_adminmail "$cfgfile" "global" "adminmail"
ini_config_get_or_die cfg_adminname "$cfgfile" "global" "adminname"
ini_config_get_or_die cfg_workdir "$cfgfile" "global" "workdir"
+ ini_config_get_or_die cfg_max_validators "$cfgfile" "global" "max_validators"
ini_config_get_or_die cfg_jobs "$cfgfile" "global" "jobs"
ini_config_get_or_die cfg_preamble "$cfgfile" "global" "preamble"
ini_config_get_or_die cfg_signature "$cfgfile" "global" "signature"
--
1.8.3.1
More information about the aiaiai
mailing list