[Git][qa/jenkins.debian.net][master] openqa: (en|dis)able workers to hit target (5)

Holger Levsen (@holger) gitlab at salsa.debian.org
Tue Jul 11 22:15:27 BST 2023



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


Commits:
3138d6fa by Philip Hands at 2023-07-11T23:14:45+02:00
openqa: (en|dis)able workers to hit target (5)

This should make sure that the current number of enabled openqa-workers
matches the value of OPENQA_WORKERS_TO_RUN, which this commit sets to 5.

BTW osuosl3 is currently running 4 workers, which were enabled by hand.

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

- - - - -


1 changed file:

- update_jdn.sh


Changes:

=====================================
update_jdn.sh
=====================================
@@ -771,6 +771,20 @@ if ! $UP2DATE ; then
 						# openqa does not use slirpvde: reset its status and disable
 						sudo systemctl reset-failed openqa-slirpvde.service
 						sudo systemctl disable openqa-slirpvde.service
+						OPENQA_WORKERS_TO_RUN=5
+						# disable any excess autostart instances, and all non-autostart workers
+						for id in $(systemctl show openqa-worker\*@\*.service --property=Id | sed 's/^Id=//'); do
+							autostart_instance=$(sed -nE 's/^.*auto-restart[@]([0-9]+).*$/\1/p' <<<$id)
+							if [ -z "$autostart_instance" ] || [ "$autostart_instance" -gt "$OPENQA_WORKERS_TO_RUN" ]; then
+								sudo systemctl disable $id
+							fi
+						done
+						# if some required instances are not yet enabled, enable them
+						for i in $(seq 1 $OPENQA_WORKERS_TO_RUN); do
+							unit=openqa-worker-auto-restart@$i.service
+							systemctl show $unit --property=UnitFileState | grep -q 'enabled' || \
+								sudo systemctl enable --now $unit
+						done
 						;;
 		osuosl4-amd64)			# allow vagrant to use libvirt for debugging
 						sudo adduser vagrant libvirt



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

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/-/commit/3138d6fa96a043ba05bff226bf0a5993f5001d18
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/20230711/cff562ad/attachment-0001.htm>


More information about the Qa-jenkins-scm mailing list