summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Levsen <holger@layer-acht.org>2015-12-14 15:35:35 +0100
committerHolger Levsen <holger@layer-acht.org>2015-12-14 15:35:35 +0100
commita0a46ce6cf3a69cfc1bc5921df7c37601bb401c2 (patch)
tree213fb4a337d36f4c5b59639d6a89dd552fab6f3f
parent66817d5fc0d9433abe44cfee1ad99159f1a9463d (diff)
downloadjenkins.debian.net-a0a46ce6cf3a69cfc1bc5921df7c37601bb401c2.tar.xz
reproducible rpms: refactor and increase timeout for a single build to 8h (was 4h)
-rwxr-xr-xbin/reproducible_build_rpm.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/bin/reproducible_build_rpm.sh b/bin/reproducible_build_rpm.sh
index b61efdf1..6b12d298 100755
--- a/bin/reproducible_build_rpm.sh
+++ b/bin/reproducible_build_rpm.sh
@@ -96,12 +96,12 @@ first_build() {
download_package
local RESULTDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)"
local LOG=$TMPDIR/b1/$SRCPACKAGE/build1.log
- # nicely run mock with a timeout of 4h
- timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
+ # nicely run mock with a timeout of $TIMEOUT hours
+ timeout -k $TIMEOUT.1h ${TIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \
mock -r $RELEASE-$ARCH --resultdir=$RESULTDIR --cleanup-after -v --rebuild $SRC_RPM 2>&1 | tee -a $LOG
PRESULT=${PIPESTATUS[0]}
if [ $PRESULT -eq 124 ] ; then
- echo "$(date -u) - mock was killed by timeout after 4h." | tee -a $LOG
+ echo "$(date -u) - mock was killed by timeout after ${TIMEOUT}h." | tee -a $LOG
fi
if ! "$DEBUG" ; then set +x ; fi
}
@@ -118,12 +118,12 @@ second_build() {
local RESULTDIR="/tmp/$SRCPACKAGE-$(basename $TMPDIR)"
local LOG=$TMPDIR/b2/$SRCPACKAGE/build2.log
# NEW_NUM_CPU=$(echo $NUM_CPU-1|bc)
- # nicely run mock with a timeout of 4h
- timeout -k 4.1h 4h /usr/bin/ionice -c 3 /usr/bin/nice \
+ # nicely run mock with a timeout of $TIMEOUT hours
+ timeout -k $TIMEOUT.1h ${TIMEOUT}h /usr/bin/ionice -c 3 /usr/bin/nice \
mock -r $RELEASE-$ARCH --resultdir=$RESULTDIR --cleanup-after -v --rebuild $SRC_RPM 2>&1 | tee -a $LOG
PRESULT=${PIPESTATUS[0]}
if [ $PRESULT -eq 124 ] ; then
- echo "$(date -u) - mock was killed by timeout after 4h." | tee -a $LOG
+ echo "$(date -u) - mock was killed by timeout after ${TIMEOUT}h." | tee -a $LOG
fi
if ! "$DEBUG" ; then set +x ; fi
}
@@ -173,6 +173,7 @@ TMPDIR=$(mktemp --tmpdir=/srv/reproducible-results -d) # where everything actua
trap cleanup_all INT TERM EXIT
cd $TMPDIR
+TIMEOUT=8 # maximum time in hours for a single build
DATE=$(date -u +'%Y-%m-%d %H:%M')
START=$(date +'%s')
DUMMY=$(mktemp -t rpm-dummy-XXXXXXXX)