From: "Alex Bennée" <alex.bennee@linaro.org>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Fam Zheng" <fam@euphon.net>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Thomas Huth" <thuth@redhat.com>,
qemu-devel@nongnu.org,
"Wainer dos Santos Moschetta" <wainersm@redhat.com>,
"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
"Willian Rampazzo" <willianr@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>
Subject: Re: [PATCH v4 16/22] tests/docker: add script for automating container refresh
Date: Mon, 05 Jul 2021 14:44:34 +0100 [thread overview]
Message-ID: <87wnq43m89.fsf@linaro.org> (raw)
In-Reply-To: <20210623142245.307776-17-berrange@redhat.com>
Daniel P. Berrangé <berrange@redhat.com> writes:
> This introduces
>
> https://gitlab.com/libvirt/libvirt-ci
>
> as a git submodule at tests/docker/libvirt-ci
>
> This submodule only needs to be checked out when needing to re-generate
> the files in tests/docker/dockerfiles.
>
> When a new build pre-requisite is needed for QEMU, it should be added to
> the libvirt-ci project 'qemu.yml' file, and the submodule updated to the
> new commit.
It seems a bit weird to have the canonical description of QEMU
dependencies live in another project does it not?
> The 'make docker-refresh' target will then re-create all the
> dockerfiles with updated package lists. This ensures that all the
> containers get exactly the same build pre-requisite packages installed.
>
> It also facilitates the addition of containers targetting new distros
> or updating existing containers to new versions of the same distro,
> where packages might have been renamed.
>
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
> docs/devel/testing.rst | 34 ++++++++++++++++--
> tests/docker/Makefile.include | 12 +++++++
> tests/docker/dockerfiles-refresh.py | 56 +++++++++++++++++++++++++++++
> 3 files changed, 100 insertions(+), 2 deletions(-)
> create mode 100755 tests/docker/dockerfiles-refresh.py
>
> diff --git a/docs/devel/testing.rst b/docs/devel/testing.rst
> index 4e42392810..7882db85d4 100644
> --- a/docs/devel/testing.rst
> +++ b/docs/devel/testing.rst
> @@ -372,8 +372,38 @@ Along with many other images, the ``centos8`` image is defined in a Dockerfile
> in ``tests/docker/dockerfiles/``, called ``centos8.docker``. ``make docker-help``
> command will list all the available images.
>
> -To add a new image, simply create a new ``.docker`` file under the
> -``tests/docker/dockerfiles/`` directory.
> +Most of the existing Dockerfiles were written by hand, simply by creating a
> +a new ``.docker`` file under the ``tests/docker/dockerfiles/`` directory.
> +This has led to an inconsistent set of packages being present across the
> +different containers.
> +
> +Thus going forward, QEMU is aiming to automatically generate the Dockerfiles
> +using the ``lcitool`` program provided by the ``libvirt-ci`` project:
> +
> + https://gitlab.com/libvirt/libvirt-ci
> +
> +In that project, there is a ``qemu.yml`` file defining the list of build
> +pre-requisites needed by QEMU. This is processed together with the
> +``mappings.yml`` file to compute the distro specific list of package names.
> +The package names are then fed into a generator which emits a well structured
> +dockerfile. The set of dockerfiles which are auto-generated is defined in
> +the ``tests/docker/dockerfiles-refresh.py`` script.
> +
> +When preparing a patch series that changes dockerfiles managed by ``libvirt-ci``
> +tools, the following steps should be takenL
> +
> + * Fork the ``libvirt-ci`` project on gitlab
> +
> + * Prepare changes to its ``qemu.yml`` file and optionally ``mappings.yml``
> + to define the packages to be added to QEMU's dockerfiles.
> +
> + * In QEMU run ``make docker-refresh LCITOOL=/path/to/libvirt-ci/lcitool``
> + to re-create the dockerfiles in ``tests/docker/dockerfiles``
If lcitool could be a pre-requisite (even as a developer only one)
should we consider having a submodule and QEMU mirror of it?
> +
> + * Submit your changes to QEMU in the normal manner
> +
> + * Submit ``libvirt-ci`` changes as a merge request, linking to the
> + QEMU patch series that uses them.
This just seems clunky and likely to therefor not get used. I would
prefer keeping the meta-data within the project, maybe with a check that
ensures the dockerfiles have not gone out of sync with their "idealised"
form.
>
> A ``.pre`` script can be added beside the ``.docker`` file, which will be
> executed before building the image under the build context directory. This is
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index ff5d732889..e8e5f497cc 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -27,6 +27,9 @@ DOCKER_TESTS := $(notdir $(shell \
> ENGINE := auto
>
> DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py --engine $(ENGINE)
> +REFRESH_SCRIPT=$(SRC_PATH)/tests/docker/dockerfiles-refresh.py
> +# To be set to /path/to/checkout/of/libvirt-ci.git/lcitool
> +LCITOOL=
Another argument for a sub-module?
--
Alex Bennée
next prev parent reply other threads:[~2021-07-05 13:49 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 14:22 [PATCH v4 00/22] tests/docker: start using libvirt-ci's "lcitool" for dockerfiles Daniel P. Berrangé
2021-06-23 14:22 ` [PATCH v4 01/22] hw/usb/ccid: remove references to NSS Daniel P. Berrangé
2021-06-25 18:11 ` Willian Rampazzo
2021-07-05 10:37 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 02/22] tests/docker: don't use BUILDKIT in GitLab either Daniel P. Berrangé
2021-06-25 20:21 ` Willian Rampazzo
2021-06-23 14:22 ` [PATCH v4 03/22] tests/docker: use project specific container registries Daniel P. Berrangé
2021-06-25 20:24 ` Willian Rampazzo
2021-07-05 12:07 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 04/22] tests/docker: use explicit docker.io registry Daniel P. Berrangé
2021-07-05 13:33 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 05/22] tests/docker: remove FEATURES env var from templates Daniel P. Berrangé
2021-06-25 20:51 ` Willian Rampazzo
2021-07-05 12:20 ` Alex Bennée
2021-07-05 12:36 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 06/22] tests/docker: fix sorting in package lists Daniel P. Berrangé
2021-07-05 13:33 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 07/22] tests/docker: fix mistakes in centos " Daniel P. Berrangé
2021-07-05 13:33 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 08/22] tests/docker: fix mistakes in fedora package list Daniel P. Berrangé
2021-07-05 13:36 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 09/22] tests/docker: fix mistakes in ubuntu package lists Daniel P. Berrangé
2021-07-05 13:40 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 10/22] tests/docker: remove mingw packages from Fedora Daniel P. Berrangé
2021-07-05 13:40 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 11/22] tests/docker: expand centos8 package list Daniel P. Berrangé
2021-07-05 13:40 ` Alex Bennée
2021-07-05 20:27 ` Alex Bennée
2021-07-05 21:41 ` Daniel P. Berrangé
2021-07-05 21:45 ` Daniel P. Berrangé
2021-07-06 8:20 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 12/22] tests/docker: expand fedora " Daniel P. Berrangé
2021-07-05 13:41 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 13/22] tests/docker: expand ubuntu1804 " Daniel P. Berrangé
2021-07-05 13:41 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 14/22] tests/docker: expand ubuntu2004 " Daniel P. Berrangé
2021-07-05 13:42 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 15/22] tests/docker: expand opensuse-leap " Daniel P. Berrangé
2021-07-05 13:42 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 16/22] tests/docker: add script for automating container refresh Daniel P. Berrangé
2021-07-05 13:44 ` Alex Bennée [this message]
2021-07-05 14:56 ` Daniel P. Berrangé
2021-07-05 15:26 ` Alex Bennée
2021-06-23 14:22 ` [PATCH v4 17/22] tests/docker: auto-generate centos8 with lcitool Daniel P. Berrangé
2021-06-23 14:22 ` [PATCH v4 18/22] tests/docker: auto-generate fedora " Daniel P. Berrangé
2021-06-23 14:22 ` [PATCH v4 19/22] tests/docker: auto-generate ubuntu1804 " Daniel P. Berrangé
2021-06-23 14:22 ` [PATCH v4 20/22] tests/docker: auto-generate ubuntu2004 " Daniel P. Berrangé
2021-06-23 14:28 ` [PATCH v4 21/22] tests/docker: auto-generate opensuse-leap " Daniel P. Berrangé
2021-06-23 14:29 ` [PATCH v4 22/22] tests/docker: remove ubuntu container Daniel P. Berrangé
2021-06-23 14:42 ` [PATCH v4 00/22] tests/docker: start using libvirt-ci's "lcitool" for dockerfiles no-reply
2021-07-05 14:51 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wnq43m89.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=thuth@redhat.com \
--cc=wainersm@redhat.com \
--cc=willianr@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).