Skip to content

tests/docker: start using libvirt-ci's "lcitool" for dockerfiles

Daniel P. Berrangé qemu-devel 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest18 patches 1 replyIn review
  2. v4 posting 2/218 patches 25 repliesSuperseded
  3. v4 posting 1/222 patches 27 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v322 patches5 repliesSuperseded
v225 patches28 repliesSuperseded
v123 patches12 repliesSuperseded

Changes in v5 from the cover letter

- Rebased to latest git master
- Typos in commit messages
- CI pipeline is now validated to pass

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18ui: avoid compiler warnings from unused clipboard info variableui/clipboard.c+1 -20 replies
2/18spice: Update QXLInterface for spice >= 0.15.0hw/display/qxl.c include/ui/qemu-spice.h ui/spice-display.c+30 -10 replies
3/18meson: require liburing >= 0.3meson.build+2 -10 replies
4/18ui: avoid warnings about directdb on Alpine / musl libcinclude/ui/sdl2.h+11 -00 replies
5/18ci: explicitly skip I/O tests on alpine.gitlab-ci.d/buildtest.yml+1 -10 replies
6/18tests/docker: switch fedora image to release 35tests/docker/dockerfiles/fedora.docker+1 -10 replies
7/18tests: integrate lcitool for generating build env manifests.gitmodules Makefile docs/devel/testing.rst +4 more+306 -30 replies
8/18tests/docker: auto-generate centos8.docker with lcitooltests/docker/dockerfiles/centos8.docker tests/lcitool/refresh+135 -1100 replies
9/18tests/docker: auto-generate fedora.docker with lcitooltests/docker/dockerfiles/fedora.docker tests/lcitool/refresh+146 -1150 replies
10/18tests/docker: auto-generate ubuntu1804.docker with lcitooltests/docker/dockerfiles/ubuntu1804.docker tests/lcitool/refresh+149 -1130 replies
11/18tests/docker: auto-generate ubuntu2004.docker with lcitooltests/docker/dockerfiles/ubuntu2004.docker tests/lcitool/refresh+151 -1150 replies
12/18tests/docker: auto-generate opensuse-leap.docker with lcitooltests/docker/dockerfiles/opensuse-leap.docker tests/lcitool/refresh+135 -1110 replies
13/18tests/docker: remove ubuntu.docker container.gitlab-ci.d/containers.yml tests/docker/dockerfiles/ubuntu.docker+0 -760 replies
14/18.gitlab-ci.d/cirrus: auto-generate variables with lcitool.gitlab-ci.d/cirrus/freebsd-12.vars .gitlab-ci.d/cirrus/freebsd-13.vars .gitlab-ci.d/cirrus/macos-11.vars +1 more+30 -130 replies
15/18tests/docker: updates to alpine package listtests/docker/dockerfiles/alpine.docker+1 -70 replies
16/18tests/docker: fix sorting of alpine image package liststests/docker/dockerfiles/alpine.docker+1 -10 replies
17/18tests/docker: fully expand the alpine package listtests/docker/dockerfiles/alpine.docker+57 -10 replies
18/18tests/docker: auto-generate alpine.docker with lcitooltests/docker/dockerfiles/alpine.docker tests/lcitool/refresh+120 -1060 replies

Reviews trailers per patch

All 18 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-DaudéRichard Henderson
1/18R-b T-b R-b
2/18R-b T-b
3/18R-b
4/18R-b
5/18R-b
6/18R-b T-b
7/18R-b
8/18R-b
9/18R-b
10/18R-b
11/18R-b
12/18R-b
13/18R-b
14/18R-b
15/18R-b
16/18R-b
17/18R-b
18/18R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 00/18] tests/docker: start using libvirt-ci's "lcitool" for dockerfiles

Currently the tests/docker/dockerfiles/*Dockerfile recipes are all hand written by contributors. There is a common design pattern, but the set of packages listed for installation leaves alot to be desired

- There is no consistency at all across distros
- Many potential build deps are not listed in the containers
- Some packages are not used by QEMU at all
- Adding new distros is an error prone task

The same applies to package lists for VMs, Cirrus CI / Travis CI, and probably more.

This problem is not unique to QEMU, libvirt faced the exact same issues and developed a program called "lcitool" which is part of the libvirt-ci git repository to reduce the burden in this area.

Despite its name, this repository is not tied to libvirt, and so as well as the 40+ libvirt git repos, it is also used by the libosinfo and virt-viewer projects for their CI needs.

lcitool is capable of automating the installation and updating of VM images, creation of dockerfiles and creation of standalone package lists.

In this series I'm taking the easy step which is the generation of dockerfiles and Cirrus CI variables, since that is where the most immediate value lies for QEMU.

The key concept in lcitool that brings a huge win in maintainability is that there is a single file which defines a mapping between a build pre-requisite and the native package on each targetted distro.

https://gitlab.com/libvirt/libvirt-ci/-/blob/master/guests/lcitool/lcitool/ansible/vars/mappings.yml

A project merely then to have its list of pre-requisites enumerated For example:

https://gitlab.com/libvirt/libvirt-ci/-/blob/master/guests/lcitool/lcitool/ansible/vars/projects/qemu.yml

The combination of these two files is enough to generate accurate package lists for any supported distro. Currently supported distro targets are

 $ lcitool targets
  alpine-314
  alpine-edge
  centos-8
  centos-stream-8
  centos-stream-9
  debian-10
  debian-11
  debian-sid
  fedora-34
  fedora-35
  fedora-rawhide
  freebsd-12
  freebsd-13
  freebsd-current
  macos-11
  opensuse-leap-152
  opensuse-tumbleweed
  ubuntu-1804
  ubuntu-2004

At the end of this series, I have dockerfiles auto-generated for QEMU covering Ubuntu 18.04 & 20.04, CentOS 8, Fedora 35 and OpenSUSE 15.2 and Alpine Edge

lcitool is also capable of generating dockerfiles for cross-compiled non-x86 architectures for Debian, and for mingw32/64 for Fedora. This is driven from the very same mapping.yml file listed above, which has attributes to indicate whether a given dependancy should be pulled from the native or cross build target. Again this means that we have strong guarantee of consistent deps being used between cross containers.

I have not converted cross containers in this series though, because the way lcitool generated cross dockerfiles is different from how QEMU does it. lcitool will always generate fully self-contained dockerfiles, but QEMU currently uses layered dockerfiles for cross-builds, so all cross builds share a common intermediate container.

I've got a pending enhancement to lcitool to support split layers for the cross-buld dockerfiles. An alternative is to just use fully self-contained dockerfiles for cross builds too though.

There is also scope for auto-generating the package lists for tests/vm, but I've not attempted that yet. The same general idea appies - we just call lcitool to spit out a yml file containing a list of native packages for each VM target.

If converting tests/vm, we would need to add more distros to lcitool mappings.yml to convert openbsd, netbsd, haiku since libvirt does not target those distros itself.

I have provided a 'make lcitool-refresh' target that needs to be invoked whenever the local files need re-generating with updated package lists. This can be either when adding a new distro target or when some build pre-requisite is added. This make target will checkout the libvirt-ci.git submodule to do its work.

Changed in v5:

- Rebased to latest git master
- Typos in commit messages
- CI pipeline is now validated to pass

Changed in v4:

- Re-introduce use of git submodule
- Pull qemu.yml package list into qemu.git not libvirt-ci.git
- Improved make trget integration for refreshing files
- Also convert Alpine dockerfile
- Also generate cirrus CI variables files
- Rebase fedora dockerfile to F35, since F33 is no longer supported by libvirt-ci as it is end of life by Fedora.

Changed in v4:

- Refresh to cope with new libbpf, libffi & rtd theme packages
- Drop use of git submodule
- Improve documentation

Changed in v3:

- Drop changes for CentOS 7
- Catch up with newly added build deps
- Add git submodule and make target for refresh

Changed in v2:

- Remove more travis stuff from tests/docker/Makefile.include
- Convert opensuse image to be auto-generated
- Add SDL2_image package
- QEMU package manifest is now officially merged in libvirt-ci.git

Daniel P. Berrangé (17):
ui: avoid compiler warnings from unused clipboard info variable
meson: require liburing >= 0.3
ui: avoid warnings about directdb on Alpine / musl libc
ci: explicitly skip I/O tests on alpine
tests/docker: switch fedora image to release 35
tests: integrate lcitool for generating build env manifests tests/docker: auto-generate centos8.docker with lcitool tests/docker: auto-generate fedora.docker with lcitool tests/docker: auto-generate ubuntu1804.docker with lcitool tests/docker: auto-generate ubuntu2004.docker with lcitool tests/docker: auto-generate opensuse-leap.docker with lcitool tests/docker: remove ubuntu.docker container .gitlab-ci.d/cirrus: auto-generate variables with lcitool tests/docker: updates to alpine package list tests/docker: fix sorting of alpine image package lists tests/docker: fully expand the alpine package list tests/docker: auto-generate alpine.docker with lcitool

John Snow (1):
spice: Update QXLInterface for spice >= 0.15.0

 .gitlab-ci.d/buildtest.yml                    |   2 +-
 .gitlab-ci.d/cirrus/freebsd-12.vars           |  11 +-
 .gitlab-ci.d/cirrus/freebsd-13.vars           |  11 +-
 .gitlab-ci.d/cirrus/macos-11.vars             |  11 +-
 .gitlab-ci.d/containers.yml                   |   5 -
 .gitmodules                                   |   3 +
 Makefile                                      |   2 +
 docs/devel/testing.rst                        | 104 ++++++-
 hw/display/qxl.c                              |  14 +-
 include/ui/qemu-spice.h                       |   6 +
 include/ui/sdl2.h                             |  11 +
 meson.build                                   |   3 +-
 tests/docker/dockerfiles/alpine.docker        | 175 ++++++++----
 tests/docker/dockerfiles/centos8.docker       | 243 ++++++++--------
 tests/docker/dockerfiles/fedora.docker        | 262 ++++++++++--------
 tests/docker/dockerfiles/opensuse-leap.docker | 245 ++++++++--------
 tests/docker/dockerfiles/ubuntu.docker        |  71 -----
 tests/docker/dockerfiles/ubuntu1804.docker    | 255 +++++++++--------
 tests/docker/dockerfiles/ubuntu2004.docker    | 257 +++++++++--------
 tests/lcitool/Makefile.include                |  17 ++
 tests/lcitool/libvirt-ci                      |   1 +
 tests/lcitool/projects/qemu.yml               | 115 ++++++++
 tests/lcitool/refresh                         |  96 +++++++
 ui/clipboard.c                                |   3 +-
 ui/spice-display.c                            |  11 +
 25 files changed, 1217 insertions(+), 717 deletions(-)
 delete mode 100644 tests/docker/dockerfiles/ubuntu.docker
 create mode 100644 tests/lcitool/Makefile.include
 create mode 160000 tests/lcitool/libvirt-ci
 create mode 100644 tests/lcitool/projects/qemu.yml
 create mode 100755 tests/lcitool/refresh
Signature · 1 line
2.33.1