[Git][qa/jenkins.debian.net][master] 2 commits: reproduce.d.n: add graph

Holger Levsen (@holger) gitlab at salsa.debian.org
Sun Dec 15 15:28:19 GMT 2024



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


Commits:
8aab9317 by Holger Levsen at 2024-12-15T16:27:08+01:00
reproduce.d.n: add graph

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

- - - - -
2926ed2d by Holger Levsen at 2024-12-15T16:27:59+01:00
reproduce.d.n: rebuilderd's home moved on i7 as well

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

- - - - -


7 changed files:

- + bin/rebuilderd_graph.sh
- hosts/infom07-i386/etc/cron.d/rebuilderd
- hosts/infom07-i386/var/www/html/index.html
- hosts/osuosl5-amd64/etc/cron.d/rebuilderd
- hosts/osuosl5-amd64/var/www/html/index.html
- hosts/osuosl5-amd64/var/www/html/rebuilderd-setup.html
- update_jdn.sh


Changes:

=====================================
bin/rebuilderd_graph.sh
=====================================
@@ -0,0 +1,62 @@
+#!/bin/bash
+#
+# Copyright 2024 Holger Levsen (holger at layer-acht.org)
+# released under the GPLv2
+
+set -e
+
+#
+# create graph for $ARCH.reproduce.debian.net
+#
+if [ -z "$1" ] ; then
+	echo "need an architecture."
+	exit 1
+fi
+
+ARCH=$1
+DB=/srv/rebuilderd/rebuilderd.db
+CSV=/srv/rebuilderd/stats/rebuilderd.csv
+PNG=/srv/rebuilderd/stats/rb.png
+TODAY=$(date '+%Y-%m-%d' -u)
+DUMMY_FILE=$(mktemp -t rebuilderd-graph-XXXXXXXX)
+touch -d "$(date '+%Y-%m-%d') 02:00 UTC" $DUMMY_FILE
+
+#
+# init .csv file if needed
+#
+if [ ! -f $CSV ] ; then
+	echo "; date, good, unknown, bad" > $CSV
+fi
+
+#
+# update .csv if needed
+#
+if ! grep -q $TODAY $CSV ; then
+	GOOD=$(echo "SELECT count(*) FROM packages WHERE status='GOOD'" | sqlite3 $DB)
+	BAD=$(echo "SELECT count(*) FROM packages WHERE status='BAD'" | sqlite3 $DB)
+	UNKNOWN=$(echo "SELECT count(*) FROM packages WHERE status!='BAD' AND status!='GOOD'" | sqlite3 $DB)
+	echo "$TODAY, $GOOD, $UNKNOWN, $BAD" >> $CSV
+fi
+
+#
+# update png if needed
+#
+if [ ! -f $PNG ] || [ $DUMMY_FILE -nt $PNG ] ; then
+	if [ "$ARCH" = "amd64" ] ; then
+		XLABEL="rebuilderd trixie arch:amd64 and arch:all"
+	else
+		XLABEL="rebuilderd trixie arch:$ARCH"
+	fi
+	GOOD=$(tail -1 $CSV | tr -d , | cut -d ' ' -f2)
+	BAD=$(tail -1 $CSV | tr -d , | cut -d ' ' -f4)
+	PERCENTAGE=$(echo "(100*$GOOD)/($GOOD+$BAD)"|bc)
+	YLABEL="pew pew, $PERCENTAGE%!"
+	WIDTH=800
+	HEIGHT=600
+	/srv/jenkins/bin/make_graph.py $CSV $PNG 3 "$XLABEL" "$YLABEL" $WIDTH $HEIGHT
+fi
+
+#
+# cleanup
+#
+rm $DUMMY_FILE


=====================================
hosts/infom07-i386/etc/cron.d/rebuilderd
=====================================
@@ -1,2 +1,3 @@
 MAILTO=root
-42 * * * * rebuilderd mkdir -p /srv/rebuilderd/stats/ && /srv/jenkins/bin/rebuilder_stats.py i386 /home/rebuilderd/rebuilderd.db > /srv/rebuilderd/stats/index.html.tmp && mv /srv/rebuilderd/stats/index.html.tmp /srv/rebuilderd/stats/index.html
+42 * * * * rebuilderd mkdir -p /srv/rebuilderd/stats/ && /srv/jenkins/bin/rebuilder_stats.py i386 /srv/rebuilderd/rebuilderd.db > /srv/rebuilderd/stats/index.html.tmp && mv /srv/rebuilderd/stats/index.html.tmp /srv/rebuilderd/stats/index.html
+23 * * * * rebuilderd /srv/jenkins/bin/rebuilderd_graph.sh i386


=====================================
hosts/infom07-i386/var/www/html/index.html
=====================================
@@ -167,6 +167,7 @@
         </script>
     </head>
     <body>
+        <img src="/stats/rb.png" align="right">
         <h1>
 		i386.reproduce.debian.net
         </h1>


=====================================
hosts/osuosl5-amd64/etc/cron.d/rebuilderd
=====================================
@@ -1,2 +1,3 @@
 MAILTO=root
 42 * * * * rebuilderd mkdir -p /srv/rebuilderd/stats/ && /srv/jenkins/bin/rebuilder_stats.py amd64 /srv/rebuilderd/rebuilderd.db > /srv/rebuilderd/stats/index.html.tmp && mv /srv/rebuilderd/stats/index.html.tmp /srv/rebuilderd/stats/index.html
+23 * * * * rebuilderd /srv/jenkins/bin/rebuilderd_graph.sh amd64


=====================================
hosts/osuosl5-amd64/var/www/html/index.html
=====================================
@@ -167,6 +167,7 @@
         </script>
     </head>
     <body>
+        <img src="/stats/rb.png" align="right">
         <h1>
 		amd64.reproduce.debian.net
         </h1>


=====================================
hosts/osuosl5-amd64/var/www/html/rebuilderd-setup.html
=====================================
@@ -28,7 +28,7 @@
 (version 0.4, feedback much welcome.)
 
 USER=rebuilderd
-# sudo adduser $USER ; sudo passwd -d $USER # FIXME: set homedir to /srv/rebuilderd on i7
+# sudo adduser $USER ; sudo passwd -d $USER
 REBUILDERD_HOSTNAME=rebuilderd.example.org
 
 # to get a working debrebuild, debootsnap and debsnap (all from src:devscripts)


=====================================
update_jdn.sh
=====================================
@@ -551,7 +551,8 @@ if [ -f /etc/debian_version ] ; then
 							nginx-full
 							dehydrated
 							diffoscope
-						" ;;
+							python3-rpy2
+							" ;;
 					*) ;;
 		esac
 		# packages needed by vagrant for doing manual debugging



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/48b69ea4a43e12da8a6aad6eb24814300b5319c3...2926ed2dc74953d59bf3d1f75fd5c2cc7736ecd6

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/compare/48b69ea4a43e12da8a6aad6eb24814300b5319c3...2926ed2dc74953d59bf3d1f75fd5c2cc7736ecd6
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/20241215/007c4591/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list