[Qa-jenkins-scm] [jenkins.debian.net] 01/02: reproducible arch: let build time out after 4h

Holger Levsen holger at moszumanska.debian.org
Sun Oct 18 11:45:18 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 9f71b2f181320fb42b4e5fff590074d716756643
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Oct 18 13:39:13 2015 +0200

    reproducible arch: let build time out after 4h
---
 bin/reproducible_build_arch_pkg.sh | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/bin/reproducible_build_arch_pkg.sh b/bin/reproducible_build_arch_pkg.sh
index 5c2be89..d51b9c6 100755
--- a/bin/reproducible_build_arch_pkg.sh
+++ b/bin/reproducible_build_arch_pkg.sh
@@ -19,7 +19,7 @@ cleanup_all() {
 		rm $TMPDIR -r
 		echo "$(date -u) - $TMPDIR deleted."
 	fi
-	# delete makekpg build dir
+	# delete makepkg build dir
 	if [ ! -z $SRCPACKAGE ] && [ -d /tmp/$SRCPACKAGE-$(basename $TMPDIR) ] ; then
 		rm -r /tmp/$SRCPACKAGE-$(basename $TMPDIR)
 	fi
@@ -54,7 +54,13 @@ first_build() {
 	schroot --run-session -c $SESSION --directory /tmp -- cp -r /var/abs/core/$SRCPACKAGE $BUILDDIR/
 	# just set timezone in the 1st build
 	echo 'export TZ="/usr/share/zoneinfo/Etc/GMT+12"' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
-	schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+	# nicely run makepkg with a timeout of 4h
+	timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
+		schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+	PRESULT=${PIPESTATUS[0]}
+	if [ $PRESULT -eq 124 ] ; then
+		echo "$(date -u) - makepkg was killed by timeout after 4h." | tee -a $LOG
+	fi
 	schroot --end-session -c $SESSION
 	if ! "$DEBUG" ; then set +x ; fi
 }
@@ -79,7 +85,13 @@ second_build() {
 	echo 'export LANG="fr_CH.UTF-8"' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
 	echo 'export LC_ALL="fr_CH.UTF-8' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
 	echo 'umask 0002' | schroot --run-session -c $SESSION --directory /tmp -- tee -a /var/lib/jenkins/.bashrc
-	schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+	# nicely run makepkg with a timeout of 4h
+	timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
+		schroot --run-session -c $SESSION --directory $BUILDDIR/$SRCPACKAGE -- bash -c 'makepkg --syncdeps --noconfirm --skippgpcheck 2>&1' | tee -a $LOG
+	PRESULT=${PIPESTATUS[0]}
+	if [ $PRESULT -eq 124 ] ; then
+		echo "$(date -u) - makepkg was killed by timeout after 4h." | tee -a $LOG
+	fi
 	schroot --end-session -c $SESSION
 	if ! "$DEBUG" ; then set +x ; fi
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list