[Git][qa/jenkins.debian.net][master] reproducible debian: build_service: another refactor: depend entirely on the...

Mattia Rizzolo (@mattia) gitlab at salsa.debian.org
Mon Mar 11 14:57:13 GMT 2024



Mattia Rizzolo pushed to branch master at Debian QA / jenkins.debian.net


Commits:
01760878 by Mattia Rizzolo at 2024-03-11T15:56:37+01:00
reproducible debian: build_service: another refactor: depend entirely on the list of workers to know what to do

Signed-off-by: Mattia Rizzolo <mattia at debian.org>

- - - - -


1 changed file:

- bin/reproducible_build_service.sh


Changes:

=====================================
bin/reproducible_build_service.sh
=====================================
@@ -14,44 +14,19 @@
 set -e
 
 startup_workers() {
-	local ARCH MAX
+	local SERVICE_NAME
 	local WORKER_BIN WORKER_NAME
 	local BUILD_BASE
-	#
-	# loop through all archs
-	#
-	for ARCH in amd64 i386 arm64 armhf ; do
-		case $ARCH in
-			amd64)	MAX=32 ;;
-			i386)	MAX=16 ;;
-			arm64)	MAX=24 ;;
-			armhf)	MAX=59 ;;
-			*)	;;
-		esac
-		#
-		# startup as many workers as defined above
-		#
-		for i in $(seq 1 "$MAX") ; do
-			#
+
+	WORKER_BIN=/srv/jenkins/bin/reproducible_worker.sh
+
+	grep -v '^#' /srv/jenkins/bin/reproducible_build_workers | \
+		while read -r WORKER_NAME ; do
 			# sleep up to 2.3 seconds (additionally to the random sleep reproducible_build.sh does anyway)
 			#
 			/bin/sleep "$(echo "scale=1 ; $(shuf -i 1-23 -n 1)/10" | bc )"
 
-			#
-			# continue loop if the worker to be started is already running
-			#
-			WORKER_NAME=${ARCH}_$i
-
-
-			# shellcheck disable=SC2143
-			if [ -z "$(grep "$WORKER_NAME " /srv/jenkins/bin/reproducible_build_workers|grep -v '^#')" ]; then
-				echo "$(date --utc) - $WORKER_NAME not configured, not starting at this time"
-				continue
-			fi
-
-
-			#SERVICE_NAME="reproducible_build@${WORKER_NAME}.service"
-			WORKER_BIN=/srv/jenkins/bin/reproducible_worker.sh
+			SERVICE_NAME="reproducible_build@${WORKER_NAME}.service"
 
 			# first check the status of the services
 			# TODO: commented for now, let's first see how it goes without this,
@@ -83,8 +58,7 @@ startup_workers() {
 			BUILD_BASE=/var/lib/jenkins/userContent/reproducible/debian/build_service/$WORKER_NAME
 			mkdir -p "$BUILD_BASE"
 			echo "$(date --utc) - Starting $WORKER_NAME"
-			systemctl --user start "reproducible_build@${WORKER_NAME}.service"
-		done
+			systemctl --user start "$SERVICE_NAME"
 	done
 }
 



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/01760878136483a46b9c73a7d6f1e0e7658f22b2

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/01760878136483a46b9c73a7d6f1e0e7658f22b2
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/20240311/8a69d36d/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list