From: Jacob Keller Date: Fri, 7 Mar 2014 01:21:31 +0000 (-0800) Subject: aiaiai-email: move -J bigjobs into configuration file X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=1af4a9fd286a4cb0720135a5a5e3683ee48ebcde;p=users%2Fdedekind%2Faiaiai.git aiaiai-email: move -J bigjobs into configuration file This modifies aiaiai-email-dispatcher to use the configuration file instead of the command line for the bigjobs parameter. Signed-off-by: Jacob Keller --- diff --git a/doc/email/example-aiaiai.cfg b/doc/email/example-aiaiai.cfg index 9e63160..f94b495 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 72e3222..d31e88e 100755 --- a/email/aiaiai-email-dispatcher +++ b/email/aiaiai-email-dispatcher @@ -12,6 +12,7 @@ echo $PATH . shell-args . shell-signal . aiaiai-sh-functions +. aiaiai-email-sh-functions PROG="${0##*/}" message_time="yes" @@ -37,8 +38,6 @@ for general configuration of aiaiai-email-test-patchset. - 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 +96,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 +126,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 +140,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 f21884b..9e17f70 100644 --- a/email/aiaiai-email-sh-functions +++ b/email/aiaiai-email-sh-functions @@ -139,7 +139,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 @@ -156,6 +156,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"