[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Archlinux scheduler: add temp. code to populate results table with known data

Holger Levsen gitlab at salsa.debian.org
Mon Sep 24 13:20:49 BST 2018


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
0fdd3ed2 by Holger Levsen at 2018-09-24T12:20:38Z
reproducible Archlinux scheduler: add temp. code to populate results table with known data

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


2 changed files:

- TODO
- bin/reproducible_archlinux_scheduler.sh


Changes:

=====================================
TODO
=====================================
@@ -317,7 +317,7 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
 * maintenance job:
 ** check for archlinux schroot sessions which should not be there and delete them. complain if that fails.
 
-* use db
+* use db - see https://tests.reproducible-builds.org/reproducibledb.html
 ** extend scheduler.sh:
 *** comparing versions is probably needed: if its not empty it must be higher (due to repo constraints), but it can be even higher than in the repo, because we build trunk
 **** at first reschedule packages which never have been build (according to the db)
@@ -326,7 +326,6 @@ See link:https://jenkins.debian.net/userContent/about.html["about jenkins.debian
 *** fix irc notification
 ** make build.sh
 *** write db
-**** write temp script to populate results table with known data: pkg.state, pkg.build_date. stop builders and html job when running this
 *** we share /var/log/jenkins/reproducible-race-conditions.log with debian, is that ok? (else fix maintenance job and handle_race_condition())
 *** make build respect pacman exit code, see FIXME in _html_.sh
 ** html


=====================================
bin/reproducible_archlinux_scheduler.sh
=====================================
@@ -53,7 +53,7 @@ update_archlinux_repositories() {
 	#
 	#if [ $(date +'%H') -gt 21 ] ; then
 	#FIXME: the next lines actually disables this code block...
-	if [ $(date +'%H') -gt 25 ] ; then
+	#if [ $(date +'%H') -gt 25 ] ; then
 		REMOVED=0
 		REMOVE_LIST=""
 		for REPO in $ARCHLINUX_REPOS ; do
@@ -69,6 +69,28 @@ update_archlinux_repositories() {
 					# from results
 					# from scheduled
 					# from sources
+				else
+					#
+					# temporary code to move archlinux results from fs to db
+					#
+					cd $BASE/archlinux/$REPO/$PKG
+					if [ -f pkg.build_duration ] && [ -f pkg.state ] && [ -f pkg.version ] ; then
+						BUILD_DURATION="$(cat pkg.build_duration)"
+						BUILD_DATE="$(find . -name pkg.build_duration -printf '%TY-%Tm-%Td %TH:%TM\n')"
+						BUILD_STATE=$(cat pkg.state)
+						BUILD_VERSION="$(cat pkg.version)"
+						PKGID=$(query_db "SELECT id FROM sources WHERE name='$PKG' AND suite='$SUITE' AND architecture='$ARCH';")
+						QUERY="INSERT into results (package_id, version, status, build_date, build_duration, node1, node2, job
+						('$PKG_ID', '$BUILD_VERSION', '$BUILD_STATE', '$BUILD_DATE', '$BUILD_DURATION', 'pb3 or pb4', 'pb3 or pb4', 'unknown');"
+							echo "$QUERY"
+						query_db "$QUERY"
+						rm pkg.build_duration pkg.state pkg.version
+					elif [ -f pkg.build_duration ] || [ -f pkg.state ] || [ -f pkg.version ] ; then
+						echo "$REPO/$PKG: one or more of pkg.build_duration, pkg.state and pkg.version does not exist, ignoring."
+					else
+						echo "$REPO/$PKG has been added to the db (or never been build), ignoring."
+					fi
+					cd -
 				fi
 			done
 		done
@@ -77,7 +99,7 @@ update_archlinux_repositories() {
 		if [ $REMOVED -ne 0 ] ; then
 			irc_message archlinux-reproducible "$MESSAGE"
 		fi
-	fi
+	#fi
 	
 	#
 	# schedule packages



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/0fdd3ed2db27e401779db564f17357de64512384

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/0fdd3ed2db27e401779db564f17357de64512384
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20180924/5c7ec606/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list