From nobody Wed May 8 15:44:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1568207510; cv=none; d=zoho.com; s=zohoarc; b=EN1VJxrm6Ilpu1Q+xr0zSnmhpsynAgN+KsSjDD3yoBJQ3A6VfqttQcxr928ti+rFpw6jeJ57rTw1v/9DhBtoMO516BKMZq3TpECy+zmIkK9icHZaHekIgEkvsab3qjSZRL8gMNEwVqNrTwwA79T3khhSkai0VtnSUCDM6k+s+qI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568207510; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=BTtbisZtbhH51huQAcMHvADospZBtzGUGU1KJMmfDy8=; b=k0Hn203l9fTQPQuNSNdcxFjq+aWVKXVDFwJkCCixKHp7fprEkzxxkSRzrEU5+5vcGB8tQaViltso4N9PDdm9WxShHG3TJGVRv6M6BhZqZLEeyTc4gSBuGXq1Ym260mRwAElTr0rLG6GJOp6E7AgBW9rdXmfWFIyXnsS9aanrRt4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1568207510979797.7461102630415; Wed, 11 Sep 2019 06:11:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 87B8C308624A; Wed, 11 Sep 2019 13:11:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5133A19C6A; Wed, 11 Sep 2019 13:11:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6B10A18089C8; Wed, 11 Sep 2019 13:11:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x8BDBflr002613 for ; Wed, 11 Sep 2019 09:11:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 21266601B3; Wed, 11 Sep 2019 13:11:41 +0000 (UTC) Received: from kinshicho.brq.redhat.com (unknown [10.43.2.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9E5186012E for ; Wed, 11 Sep 2019 13:11:36 +0000 (UTC) From: Andrea Bolognani To: libvir-list@redhat.com Date: Wed, 11 Sep 2019 15:11:35 +0200 Message-Id: <20190911131135.13414-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [dockerfiles PATCH] Add 'trigger' and 'monitor' scripts X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Wed, 11 Sep 2019 13:11:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" These are extremely crude scripts that are nonetheless useful when it's time to rebuild all images. Usage is along these lines: $ ls libvirt-debian-10* >in $ ./trigger in out $ ./monitor out 3 Error handling is almost non-existent, but realistically speaking at most three people will ever run these scripts anyway :) Quay has limits on both the number of jobs that can be running at the same time and the rate of job submission: rebuilding containers in batches, eg. all Debian 10 containers, followed by all Debian 9 containers, and so on, allows us to remain within those limits. Signed-off-by: Andrea Bolognani Reviewed-by: Fabiano Fid=C3=AAncio --- monitor | 40 ++++++++++++++++++++++++++++++++++++++++ trigger | 23 +++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100755 monitor create mode 100755 trigger diff --git a/monitor b/monitor new file mode 100755 index 0000000..fd27140 --- /dev/null +++ b/monitor @@ -0,0 +1,40 @@ +#!/bin/sh + +QUAYADMIN=3D"../libvirt-jenkins-ci/guests/quayadmin" + +usage() { + echo "Usage: monitor INFILE INTERVAL" >&2 + exit 1 +} + +infile=3D"$1" +interval=3D"$2" + +test "$infile" || usage +test "$interval" || usage + +while true; do + reset + output=3Dno + + while read _ build _ _ _ repository; do + repository=3D"${repository#*/}" + + out=3D$("$QUAYADMIN" show-build libvirt "$repository" "$build") + phase=3D$(echo "$out" | grep phase: | sed -E 's/.*: //g') + + if test "$phase" =3D "complete"; then + continue + fi + + echo "libvirt/$repository: $phase" + output=3Dyes + + done <"$infile" + + if test "$output" =3D=3D "no"; then + break + fi + + sleep "$interval" +done diff --git a/trigger b/trigger new file mode 100755 index 0000000..d2e853d --- /dev/null +++ b/trigger @@ -0,0 +1,23 @@ +#!/bin/sh + +QUAYADMIN=3D"../libvirt-jenkins-ci/guests/quayadmin" + +usage() { + echo "Usage: trigger INFILE OUTFILE" >&2 + exit 1 +} + +infile=3D"$1" +outfile=3D"$2" + +test "$infile" || usage +test "$outfile" || usage + +while read zip +do + repository=3D"${zip%.zip}" + url=3D"https://github.com/libvirt/libvirt-dockerfiles/raw/master/$zip" + + "$QUAYADMIN" create-build libvirt "$repository" "$url" + +done <"$infile" | tee "$outfile" --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list