[Piuparts-commits] [SCM] piuparts git repository branch, bikeshed, updated. 0.50-207-geca84e9

Andreas Beckmann anbe at debian.org
Tue May 14 14:22:38 UTC 2013


The following commit has been merged in the bikeshed branch:
commit 08c7658aca6e0a75a2828d6a667398cf015dccf1
Author: Andreas Beckmann <anbe at debian.org>
Date:   Tue May 14 15:42:02 2013 +0200

    slave_run: start slave-count slaves
    
    configurable via [global] slave-count in piuparts.conf
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/README.txt b/README.txt
index 7ce97b9..943e7b4 100644
--- a/README.txt
+++ b/README.txt
@@ -497,6 +497,9 @@ used for all further sections.
 * "slave-directory" is the directory where the slave keeps its
  files. Can be relative to the slave's home directory.
 
+* "slave-count" is the number of concurrent slaves to start.
+ Default: "1".
+
 * "output-directory" is the directory where piuparts-report places
  the logfiles, generated html files, charts, ... that can be
  served by a webserver.
diff --git a/debian/changelog b/debian/changelog
index 185f4f1..b0501de 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ piuparts (0.51) UNRELEASED; urgency=low
     - Add --arch <arch> option to run the test for the requested instead of
       the default architecture.
   * piuparts.conf:
+    - New global settings:
+      + slave-count
   * distros.conf:
     - Update backports setup after integration into the regular archive.
     - Enable stable security updates when installing stable backports.
@@ -62,6 +64,7 @@ piuparts (0.51) UNRELEASED; urgency=low
   * piuparts-slave.deb:
     - Restrict the ssh key added to master's authorized_keys to only run
       piuparts-master.
+  * slave_run: Support starting multiple concurrent slaves.
   * Update and add new exceptions for buggy packages.
   * scripts-wheezy/post_setup_wheezy-fake-essential: New custom script to
     suppress some purge failures in wheezy.
diff --git a/slave-bin/slave_run.in b/slave-bin/slave_run.in
index 0fd78d0..5e53586 100755
--- a/slave-bin/slave_run.in
+++ b/slave-bin/slave_run.in
@@ -19,7 +19,8 @@ set -e
 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
 #
-# Run piuparts-slave in screen to allow interactive control later on.
+# Run (several) piuparts-slave instance(s) in screen to allow interactive
+# control later on.
 #
 
 
@@ -28,6 +29,7 @@ set -e
 get_config_value PYTHONPATH global PYTHONPATH ''
 get_config_value SLAVEROOT global slave-directory
 get_config_value PIUPARTS_TMPDIR global tmpdir
+get_config_value SLAVECOUNT global slave-count 1
 
 
 export PYTHONPATH
@@ -52,7 +54,23 @@ mkdir -p $PIUPARTS_TMPDIR
 mkdir -p $SLAVEROOT
 cd $SLAVEROOT
 
-# finally, run piuparts-slave in screen
-screen -L -d -m -S $SESSIONNAME @sharedir@/piuparts/piuparts-slave
+# Ensure the screen session exists, run normal shell in screen 0
+screen -S $SESSIONNAME -d -m
+echo "Started screen session '$SESSIONNAME'."
 
-echo "piuparts-slave has been started."
+for SLAVENUM in $(seq $SLAVECOUNT)
+do
+	mkdir -p $SLAVENUM
+	SLAVEDIR=$(readlink -f $SLAVENUM)
+
+	# Ensure there is a window for this slave.
+	screen -S $SESSIONNAME -X screen -t slave$SLAVENUM -L $SLAVENUM
+
+	# Launch the slave.
+	screen -S $SESSIONNAME -p $SLAVENUM -X stuff "
+cd $SLAVEDIR
+ at sharedir@/piuparts/piuparts-slave
+"
+
+	echo "piuparts-slave $SLAVENUM has been started."
+done

-- 
piuparts git repository



More information about the Piuparts-commits mailing list