[libvirt] [dockerfiles PATCH] Add 'trigger' and 'monitor' scripts

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 <abologna@redhat.com> --- 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="../libvirt-jenkins-ci/guests/quayadmin" + +usage() { + echo "Usage: monitor INFILE INTERVAL" >&2 + exit 1 +} + +infile="$1" +interval="$2" + +test "$infile" || usage +test "$interval" || usage + +while true; do + reset + output=no + + while read _ build _ _ _ repository; do + repository="${repository#*/}" + + out=$("$QUAYADMIN" show-build libvirt "$repository" "$build") + phase=$(echo "$out" | grep phase: | sed -E 's/.*: //g') + + if test "$phase" = "complete"; then + continue + fi + + echo "libvirt/$repository: $phase" + output=yes + + done <"$infile" + + if test "$output" == "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="../libvirt-jenkins-ci/guests/quayadmin" + +usage() { + echo "Usage: trigger INFILE OUTFILE" >&2 + exit 1 +} + +infile="$1" +outfile="$2" + +test "$infile" || usage +test "$outfile" || usage + +while read zip +do + repository="${zip%.zip}" + url="https://github.com/libvirt/libvirt-dockerfiles/raw/master/$zip" + + "$QUAYADMIN" create-build libvirt "$repository" "$url" + +done <"$infile" | tee "$outfile" -- 2.21.0

On Wed, Sep 11, 2019 at 3:12 PM Andrea Bolognani <abologna@redhat.com> wrote:
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 <abologna@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>

On Wed, 2019-09-11 at 18:38 +0200, Fabiano Fidêncio wrote:
On Wed, Sep 11, 2019 at 3:12 PM Andrea Bolognani <abologna@redhat.com> wrote:
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 <abologna@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com>
Thanks, pushed now. I actually got thinking whether these scripts, as well as the existing 'refresh' script, really belong to this repo rather than to the libvirt-jenkins-ci repo... But figuring that out, and if necessary acting on it, is a task for another day :) -- Andrea Bolognani / Red Hat / Virtualization
participants (2)
-
Andrea Bolognani
-
Fabiano Fidêncio