[libvirt PATCH 0/4] RFE: ci: A couple of minor improvements

Erik Skultety eskultet at redhat.com
Wed Feb 10 17:24:32 UTC 2021


First of all, this builds on top of [1].

As I was testing some builds in local containers I noticed that when one does:
    $ make -C ci ci-list-images

it will return images that we no longer support in lcitool nor in libvirt, but
one can still pull them and run a build in those. So I created a Python script
that compares the current registry with what we support in lcitool and if the=
re
images of distro we no longer support, it will flag those (see below).
Now, I wonder where the proper place to run this would be, originally I creat=
ed
for our GitLab containers and ran it during the sanity-check phase [2]. But
having it marked as a "soft" failure didn't seem correct. So I'm proposing to
run this within the context of the "refresh" script.

I also pondered whether I should go ahead and rewrite the refresh script to
Python as well (like this series does for list-images.sh), but I actually like
how straight forward the refresh script is, unlike list-images, it would not
look better in Python for sure. The 3 resulting script hierarchy isn't perfec=
t,
but I'd like to hear some comments first.

[1] https://listman.redhat.com/archives/libvir-list/2021-February/msg00636.ht=
ml
[2] https://gitlab.com/eskultety/libvirt/-/pipelines/253570058

EXAMPLE OUTPUT OF THE REGISTRY CHECKER:

The following images can be purged from the registry:

	libvirt/libvirt/ci-debian-9
	libvirt/libvirt/ci-debian-9-cross-aarch64
	libvirt/libvirt/ci-debian-9-cross-mipsel
	libvirt/libvirt/ci-debian-9-cross-armv7l
	libvirt/libvirt/ci-debian-9-cross-armv6l
	libvirt/libvirt/ci-debian-9-cross-mips
	libvirt/libvirt/ci-debian-9-cross-ppc64le
	libvirt/libvirt/ci-debian-9-cross-s390x
	libvirt/libvirt/ci-debian-9-cross-mips64el
	libvirt/libvirt/ci-fedora-31
	libvirt/libvirt/ci-opensuse-151

You can remove the above images over the API with the following code snippet:

	$ for image_id in 1154661 1154667 1154669 1154671 1154676 1154678 1154682 11=
54683 1154686 1154687 1154724 \
	;do \
		curl --request DELETE --header "PRIVATE-TOKEN: <access_token>" \
		https://gitlab.com/api/v4/projects/192693/registry/repositories/$image_id \
	;done

Erik Skultety (4):
  ci: Makefile: Specify a help target to replace ci-help
  ci: Rewrite list-images from Bash to Python
  ci: list-images: Split some generic logic to a util module
  ci: Introduce a new checker script 'check-registry.py'

 ci/Makefile                     | 12 ++---
 ci/containers/check-registry.py | 96 +++++++++++++++++++++++++++++++++
 ci/containers/refresh           |  5 ++
 ci/containers/util.py           | 25 +++++++++
 ci/list-images.py               | 32 +++++++++++
 5 files changed, 161 insertions(+), 9 deletions(-)
 create mode 100644 ci/containers/check-registry.py
 create mode 100644 ci/containers/util.py
 create mode 100644 ci/list-images.py

--=20
2.29.2





More information about the libvir-list mailing list