All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] gitlab: build containers to use in build jobs
@ 2020-06-22 15:33 Daniel P. Berrangé
  2020-06-22 15:33 ` [PATCH RFC 1/3] gitlab: introduce explicit "container" and "build" stages Daniel P. Berrangé
                   ` (4 more replies)
  0 siblings, 5 replies; 29+ messages in thread
From: Daniel P. Berrangé @ 2020-06-22 15:33 UTC (permalink / raw)
  To: qemu-devel
  Cc: Thomas Huth, Daniel P. Berrangé,
	Laszlo Ersek, Wainer dos Santos Moschetta,
	Philippe Mathieu-Daudé,
	Alex Bennée

The current gitlab CI jobs are quite inefficient because they
use the generic distro images and then apt-get/dnf install
extra packages every time.

The other downside is that the container environment used is
only defined in thte .gitlab-ci.yml file, so it tedious to
reproduce locally.

We already have containers defined in tests/docker for use by
developers building locally. We can use these for CI systems
too if we just had a way to build them....

...GitLab CI offers such a way. We can use docker-in-docker
to build the images at the start of the CI cycle, and use
the built images in later jobs.

These later jobs are now faster because they're not having
to install any software.

There is a performance hit to build the images, however, they
are cached in the GitLab docker registry. A user forking the
repo will use the cache from qemu-project/qemu and their own
local fork. So overall the time penalty to build images will
only be seen if the user modifiers tests/docker/dockerfiles
in their patch series, or if the base image changes.

The GitLab container registry is public, so we're not limited
to using the built images in GitLab CI. Any other CI system
that uses docker can consume these images. Similarly we could
change the tests/docker/Makefile  rules so that developers
pull from https://gitlab.com/qemu-project/qemu, instead of
building images locally. This is why we're building all the
images, instead of just the handful the current jobs want.

The interesting stuff is mostly in patch 2.

Patch 3 is a quick hack I did to convert existing jobs to use
the newly built images. I know there's other work being done
on the GitLab jobs right now that probably conflicts with this
though, so I've not invested much time in patch 3. Consider it
more an illustration of what's possible, than a finished proposal
for merge. The patch 3 diff is fairly unintelligble, so it is
easier to look at the final result:

  https://gitlab.com/berrange/qemu/-/blob/ci-cont/.gitlab-ci.yml

An example pipeline can be viewed here:

  https://gitlab.com/berrange/qemu/-/pipelines/158824359

The cached images are here:

  https://gitlab.com/berrange/qemu/container_registry

Daniel P. Berrangé (3):
  gitlab: introduce explicit "container" and "build" stages
  gitlab: build all container images during CI
  gitlab: convert jobs to use custom built containers

 .gitlab-ci.d/containers.yml | 248 ++++++++++++++++++++++++++++++++++++
 .gitlab-ci.d/edk2.yml       |   3 +-
 .gitlab-ci.d/opensbi.yml    |   3 +-
 .gitlab-ci.yml              | 187 +++++++++++++--------------
 4 files changed, 340 insertions(+), 101 deletions(-)
 create mode 100644 .gitlab-ci.d/containers.yml

-- 
2.24.1



^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2020-06-25 16:04 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-22 15:33 [PATCH RFC 0/3] gitlab: build containers to use in build jobs Daniel P. Berrangé
2020-06-22 15:33 ` [PATCH RFC 1/3] gitlab: introduce explicit "container" and "build" stages Daniel P. Berrangé
2020-06-22 15:59   ` Laszlo Ersek
2020-06-25  8:54   ` Thomas Huth
2020-06-25  8:58     ` Philippe Mathieu-Daudé
2020-06-22 15:33 ` [PATCH RFC 2/3] gitlab: build all container images during CI Daniel P. Berrangé
2020-06-22 15:38   ` Philippe Mathieu-Daudé
2020-06-22 15:46     ` Daniel P. Berrangé
2020-06-22 16:13       ` Philippe Mathieu-Daudé
2020-06-22 18:26   ` Alex Bennée
2020-06-23  8:47     ` Daniel P. Berrangé
2020-06-23  9:35       ` Alex Bennée
2020-06-25  9:35   ` Thomas Huth
2020-06-25  9:50     ` Daniel P. Berrangé
2020-06-25 15:57       ` Laszlo Ersek
2020-06-25 10:07   ` Daniel P. Berrangé
2020-06-25 11:14     ` Alex Bennée
2020-06-25 10:14   ` Thomas Huth
2020-06-25 10:24     ` Daniel P. Berrangé
2020-06-25 13:25       ` Thomas Huth
2020-06-25 14:29         ` Daniel P. Berrangé
2020-06-22 15:33 ` [PATCH RFC 3/3] gitlab: convert jobs to use custom built containers Daniel P. Berrangé
2020-06-25  9:59   ` Thomas Huth
2020-06-25 10:31 ` [PATCH RFC 0/3] gitlab: build containers to use in build jobs Alex Bennée
2020-06-25 11:15 ` Thomas Huth
2020-06-25 11:26   ` Daniel P. Berrangé
2020-06-25 11:29     ` Daniel P. Berrangé
2020-06-25 11:33       ` Thomas Huth
2020-06-25 11:39         ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.