[igt-dev] [PATCH i-g-t] Add GitLab's CI/CD configuration

Arkadiusz Hiler arkadiusz.hiler at intel.com
Mon Oct 22 14:31:28 UTC 2018


On Mon, Oct 22, 2018 at 04:16:50PM +0200, Daniel Vetter wrote:
> 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.

Depends how people treat backports, but if I stretch my imagination I
can see some point in that.

> > > - 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

I can't wait for 2019 then.
-Arek


More information about the igt-dev mailing list