[igt-dev] [PATCH i-g-t] Add GitLab's CI/CD configuration
Daniel Vetter
daniel at ffwll.ch
Mon Oct 22 14:16:50 UTC 2018
On Mon, Oct 22, 2018 at 11:58 AM Arkadiusz Hiler
<arkadiusz.hiler at intel.com> wrote:
>
> On Mon, Oct 22, 2018 at 11:22:50AM +0200, Daniel Vetter wrote:
> > On Mon, Oct 22, 2018 at 11:42:03AM +0300, Arkadiusz Hiler wrote:
> > > The CI/CD pieline is configured the following way:
> > > 1. Build docker images and add them to repo's registry (manual step for
> > > now, automation needs GitLab to be updated).
> > > 2. Build igt with meson on Debian and Feodra.
> > > 3. Run `ninja tests` on Fedora.
> > > 4. Build and publish docs as an artifact, for GitLab Pages.
> > >
> > > Cc: Petri Latvala <petri.latvala at intel.com>
> > > Cc: Daniel Vetter <daniel at ffwll.ch>
> > > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> > > ---
> > > .gitlab-ci.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++++
> > > Dockerfile.debian | 28 +++++++++++++++++++
> > > Dockerfile.fedora | 24 +++++++++++++++++
> > > 3 files changed, 121 insertions(+)
> > > create mode 100644 .gitlab-ci.yml
> > > create mode 100644 Dockerfile.debian
> > > create mode 100644 Dockerfile.fedora
> > >
> > > diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
> > > new file mode 100644
> > > index 00000000..0f3422a0
> > > --- /dev/null
> > > +++ b/.gitlab-ci.yml
> > > @@ -0,0 +1,69 @@
> > > +image: registry.freedesktop.org/drm/igt-gpu-tools/igt-fedora:latest
> > > +
> > > +stages:
> > > + - containers
> > > + - build
> > > + - test
> > > + - deploy
> > > +
> > > +build:tests-fedora:
> > > + stage: build
> > > + script:
> > > + - meson build
> > > + - ninja -C build
> > > + artifacts:
> > > + paths:
> > > + - build
> > > +
> > > +build:tests-debian:
> > > + image: registry.freedesktop.org/drm/igt-gpu-tools/igt-debian:latest
> > > + stage: build
> > > + script:
> > > + - meson build
> > > + - ninja -C build
> > > +
> > > +ninja:test:
> > > + stage: test
> > > + script:
> > > + - ninja -C build test
> > > +
> > > +pages:
> > > + stage: deploy
> > > + script:
> > > + - ninja -C build igt-gpu-tools-doc
> > > + - cp -r build/docs/reference/igt-gpu-tools/html public
> > > + artifacts:
> > > + paths:
> > > + - public
> > > + only:
> > > + - master
> > > +
> > > +containers:igt-debian:
> > > + stage: containers
> > > + when: manual
> > > + image: docker:stable
> > > + services:
> > > + - docker:dind
> > > + variables:
> > > + DOCKER_HOST: tcp://docker:2375
> > > + DOCKER_DRIVER: overlay2
> > > + script:
> > > + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.freedesktop.org
> > > + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.freedesktop.org
> > > + - docker build -t registry.freedesktop.org/drm/igt-gpu-tools/igt-debian -f Dockerfile.debian .
> > > + - docker push registry.freedesktop.org/drm/igt-gpu-tools/igt-debian
> > > +
> > > +containers:igt-fedora:
> > > + stage: containers
> > > + when: manual
> >
> > How do you trigger this? Is there some button on the UI?
>
> Yep. Once pipeline get triggered (either manually, through the API or by
> push) those jobs are having pause symbol as their status icon. By
> clicking on them you can make them run. I haven't checked how it looks
> from the API though.
>
> This should not be the case for too long, as GitLab 11.4 is already out,
> we just have to wait for FDO to catch up.
>
> https://gitlab.com/gitlab-org/gitlab-ce/issues/19232
>
> > Anyway, looks good enough to get us started.
> >
> > Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> >
> > Bits we could add:
> > - debian stable build (atm only autotools)
>
> I am not very keen on doing anything around autotools, and providing
> more cues that we are going to support it in any way.
It's more about "being able to build on old stuff" and not "being able
to build using autotools. I think debian stable is a fairly
well-accepted target for "old, but still worth supporting".
Unfortunately our current meson build doesn't work on debian stable,
hence autotools. As soon as the next debian release is out there, we
can switch that over to meson I think.
> > - build with the oldest meson we still claim to support (would need to git
> > clone&install it in the docker image). Somewhat relevant since on oldest
> > supported meson the docs building is different.
>
> This would require us to have probably another docker image dedicated to
> do that, as doing dep managment in the actual build is both annoying
> and costs a lot of time.
Yeah, which is somewhat annoying. But "waiting until the next debian
stable release", which is somewhen in late 2019 most likely, is a bit
long ...
-Daniel
>
> > - Petri's idea to have the equivalent of an allyesconfig build
>
> Yep. I was also thinking about doing some combinatorial build checks on
> IGT, but Petri's suggestion is lower hanging fruit and can be
> incorporated almost immediately.
>
> > Cheers, Daniel
> >
> > > + image: docker:stable
> > > + services:
> > > + - docker:dind
> > > + variables:
> > > + DOCKER_HOST: tcp://docker:2375
> > > + DOCKER_DRIVER: overlay2
> > > + script:
> > > + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.freedesktop.org
> > > + - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.freedesktop.org
> > > + - docker build -t registry.freedesktop.org/drm/igt-gpu-tools/igt-fedora -f Dockerfile.fedora .
> > > + - docker push registry.freedesktop.org/drm/igt-gpu-tools/igt-fedora
> > > diff --git a/Dockerfile.debian b/Dockerfile.debian
> > > new file mode 100644
> > > index 00000000..a9f93957
> > > --- /dev/null
> > > +++ b/Dockerfile.debian
> > > @@ -0,0 +1,28 @@
> > > +FROM debian:stretch-backports
> > > +
> > > +RUN apt-get update
> > > +RUN apt-get install -y \
> > > + gcc \
> > > + flex \
> > > + bison \
> > > + pkg-config \
> > > + libpciaccess-dev \
> > > + libkmod-dev \
> > > + libprocps-dev \
> > > + libunwind-dev \
> > > + libdw-dev \
> > > + zlib1g-dev \
> > > + liblzma-dev \
> > > + libssl-dev \
> > > + libcairo-dev \
> > > + libudev-dev \
> > > + libgsl-dev \
> > > + libasound2-dev \
> > > + libxmlrpc-core-c3-dev \
> > > + libjson-c-dev \
> > > + libcurl4-openssl-dev
> > > +
> > > +RUN apt-get install -t stretch-backports -y \
> > > + meson \
> > > + libdrm-dev \
> > > + libdrm-intel1
> > > diff --git a/Dockerfile.fedora b/Dockerfile.fedora
> > > new file mode 100644
> > > index 00000000..58efa817
> > > --- /dev/null
> > > +++ b/Dockerfile.fedora
> > > @@ -0,0 +1,24 @@
> > > +FROM fedora:28
> > > +
> > > +RUN dnf install -y gcc \
> > > + flex \
> > > + meson \
> > > + bison \
> > > + json-c \
> > > + gtk-doc \
> > > + xdotool \
> > > + gsl-devel \
> > > + kmod-devel \
> > > + glib2-devel \
> > > + cairo-devel \
> > > + procps-devel \
> > > + pixman-devel \
> > > + libdrm-devel \
> > > + openssl-devel \
> > > + libudev-devel \
> > > + xmlrpc-c-devel \
> > > + elfutils-devel \
> > > + libunwind-devel \
> > > + python-docutils \
> > > + libpciaccess-devel \
> > > + alsa-lib-devel
> > > --
> > > 2.17.2
> > >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the igt-dev
mailing list