mbox series

[v2,0/5] kci-gitlab: Introducing GitLab-CI Pipeline for Kernel Testing

Message ID 20250123135342.1468787-1-vignesh.raman@collabora.com
Headers show
Series kci-gitlab: Introducing GitLab-CI Pipeline for Kernel Testing | expand

Message

Vignesh Raman Jan. 23, 2025, 1:53 p.m. UTC
This patch series introduces "kci-gitlab," a GitLab CI pipeline
specifically designed for kernel testing. It provides kernel
developers with an integrated, efficient, and flexible testing
framework using GitLab's CI/CD capabilities. This patch includes
a .gitlab-ci file in the tools/ci/gitlab-ci/ folder, along with
additional YAML and script files, to define a basic test pipeline
triggered by code pushes to a GitLab-CI instance.
The initial version implements:
    
- Static checks: Includes checkpatch and smatch for code validation.
- Build tests: Covers various architectures and configurations.
- Boot tests: Utilizes virtme for basic boot testing.

Additionally, it introduces a flexible "scenarios" mechanism to
support subsystem-specific extensions.

This series also introduces a drm scenario that adds a job to run IGT
tests for vkms. This scenario includes helper scripts to build deqp-runner
and IGT, leveraging approaches from the drm-ci/mesa-ci project.

We are working towards creating a generic, upstream GitLab-CI pipeline
(kci-gitlab) that will replace DRM-CI [1]. The proposed GitLab-CI pipeline
is designed with a distributed infrastructure model, making it possible
to run on any gitLab instance. We plan to leverage KernelCI [2] as the
backend, utilizing its hardware, rootfs, test plans, and KCIDB [3]
integration.

For an example of a fully executed pipeline with drm scenario set,
including documentation generation,
see: https://gitlab.freedesktop.org/vigneshraman/kernel/-/pipelines/1350262

Please refer to the documentation included in the patch, or check the
rendered version, here: 
https://vigneshraman.pages.freedesktop.org/-/kernel/-/jobs/69787927/artifacts/artifacts/Documentation-output/ci/gitlab-ci/gitlab-ci.html

Differences from v1 to v2:
- moved to tools/ci as suggested by Linus on the previous version
- add arm64 containers for native compilation
- added boot tests using virtme: this is the base structure for boot tests,
  next steps would be adding other tests such as kselftests/kunit tests
- added DRM scenario testing on vkms: this should replace current vkms test
  in drm-ci. This work shows how a test scenario can be used by different
  subsystems to add their tests.
- update documentation

For more details on the motivation behind this work, please refer to the
cover letter of v1: https://patchwork.kernel.org/project/linux-kselftest/cover/20240228225527.1052240-1-helen.koike@collabora.com/

[1] https://www.collabora.com/news-and-blog/blog/2024/02/08/drm-ci-a-gitlab-ci-pipeline-for-linux-kernel-testing/
[2] https://kernelci.org/
[3] https://docs.kernelci.org/kcidb/

Helen Koike (3):
  kci-gitlab: Introducing GitLab-CI Pipeline for Kernel Testing
  kci-gitlab: Add documentation
  kci-gitlab: docs: Add images

Vignesh Raman (2):
  MAINTAINERS: Add an entry for ci automated testing
  kci-gitlab: Add drm scenario

 Documentation/ci/gitlab-ci/gitlab-ci.rst      | 471 ++++++++++
 .../ci/gitlab-ci/images/drm-vkms.png          | Bin 0 -> 73810 bytes
 .../ci/gitlab-ci/images/job-matrix.png        | Bin 0 -> 20000 bytes
 .../gitlab-ci/images/new-project-runner.png   | Bin 0 -> 607737 bytes
 .../ci/gitlab-ci/images/pipelines-on-push.png | Bin 0 -> 532143 bytes
 .../ci/gitlab-ci/images/the-pipeline.png      | Bin 0 -> 62464 bytes
 .../ci/gitlab-ci/images/variables.png         | Bin 0 -> 277518 bytes
 Documentation/index.rst                       |   7 +
 MAINTAINERS                                   |  10 +
 tools/ci/gitlab-ci/arm_cross_compile.yml      |   9 +
 tools/ci/gitlab-ci/arm_native_compile.yml     |  20 +
 tools/ci/gitlab-ci/bootstrap-gitlab-runner.sh |  55 ++
 tools/ci/gitlab-ci/build.yml                  |  43 +
 tools/ci/gitlab-ci/cache.yml                  |  24 +
 tools/ci/gitlab-ci/ci-scripts/build-docs.sh   |  35 +
 tools/ci/gitlab-ci/ci-scripts/build-kernel.sh |  43 +
 .../ci/gitlab-ci/ci-scripts/ici-functions.sh  | 106 +++
 .../ci/gitlab-ci/ci-scripts/install-smatch.sh |  13 +
 .../ci-scripts/parse_commit_message.sh        |  27 +
 .../ci/gitlab-ci/ci-scripts/run-checkpatch.sh |  20 +
 tools/ci/gitlab-ci/ci-scripts/run-smatch.sh   |  45 +
 tools/ci/gitlab-ci/ci-scripts/run-virtme.sh   |  52 ++
 tools/ci/gitlab-ci/ci-scripts/test-boot.sh    |  14 +
 tools/ci/gitlab-ci/container.yml              | 114 +++
 tools/ci/gitlab-ci/docker-compose.yaml        |  18 +
 tools/ci/gitlab-ci/gitlab-ci.yml              |  72 ++
 tools/ci/gitlab-ci/scenarios.yml              |  15 +
 .../scenarios/drm/build-deqp-runner.sh        |  42 +
 tools/ci/gitlab-ci/scenarios/drm/build-igt.sh |  80 ++
 .../ci/gitlab-ci/scenarios/drm/build-rust.sh  |  42 +
 .../scenarios/drm/create-cross-file.sh        |  65 ++
 tools/ci/gitlab-ci/scenarios/drm/drm.yml      |  44 +
 .../scenarios/drm/prepare-container.sh        |  18 +
 tools/ci/gitlab-ci/scenarios/drm/run-igt.sh   |  83 ++
 tools/ci/gitlab-ci/scenarios/drm/test.yml     |  32 +
 .../scenarios/drm/xfails/vkms-none-fails.txt  |  22 +
 .../scenarios/drm/xfails/vkms-none-flakes.txt |  90 ++
 .../scenarios/drm/xfails/vkms-none-skips.txt  | 812 ++++++++++++++++++
 .../scenarios/file-systems/file-systems.yml   |  11 +
 tools/ci/gitlab-ci/scenarios/media/media.yml  |  11 +
 .../gitlab-ci/scenarios/network/network.yml   |  11 +
 tools/ci/gitlab-ci/static-checks.yml          |  21 +
 tools/ci/gitlab-ci/test.yml                   |  16 +
 43 files changed, 2613 insertions(+)
 create mode 100644 Documentation/ci/gitlab-ci/gitlab-ci.rst
 create mode 100644 Documentation/ci/gitlab-ci/images/drm-vkms.png
 create mode 100644 Documentation/ci/gitlab-ci/images/job-matrix.png
 create mode 100644 Documentation/ci/gitlab-ci/images/new-project-runner.png
 create mode 100644 Documentation/ci/gitlab-ci/images/pipelines-on-push.png
 create mode 100644 Documentation/ci/gitlab-ci/images/the-pipeline.png
 create mode 100644 Documentation/ci/gitlab-ci/images/variables.png
 create mode 100644 tools/ci/gitlab-ci/arm_cross_compile.yml
 create mode 100644 tools/ci/gitlab-ci/arm_native_compile.yml
 create mode 100755 tools/ci/gitlab-ci/bootstrap-gitlab-runner.sh
 create mode 100644 tools/ci/gitlab-ci/build.yml
 create mode 100644 tools/ci/gitlab-ci/cache.yml
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/build-docs.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/build-kernel.sh
 create mode 100644 tools/ci/gitlab-ci/ci-scripts/ici-functions.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/install-smatch.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/parse_commit_message.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/run-checkpatch.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/run-smatch.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/run-virtme.sh
 create mode 100755 tools/ci/gitlab-ci/ci-scripts/test-boot.sh
 create mode 100644 tools/ci/gitlab-ci/container.yml
 create mode 100644 tools/ci/gitlab-ci/docker-compose.yaml
 create mode 100644 tools/ci/gitlab-ci/gitlab-ci.yml
 create mode 100644 tools/ci/gitlab-ci/scenarios.yml
 create mode 100755 tools/ci/gitlab-ci/scenarios/drm/build-deqp-runner.sh
 create mode 100755 tools/ci/gitlab-ci/scenarios/drm/build-igt.sh
 create mode 100755 tools/ci/gitlab-ci/scenarios/drm/build-rust.sh
 create mode 100755 tools/ci/gitlab-ci/scenarios/drm/create-cross-file.sh
 create mode 100644 tools/ci/gitlab-ci/scenarios/drm/drm.yml
 create mode 100755 tools/ci/gitlab-ci/scenarios/drm/prepare-container.sh
 create mode 100755 tools/ci/gitlab-ci/scenarios/drm/run-igt.sh
 create mode 100644 tools/ci/gitlab-ci/scenarios/drm/test.yml
 create mode 100644 tools/ci/gitlab-ci/scenarios/drm/xfails/vkms-none-fails.txt
 create mode 100644 tools/ci/gitlab-ci/scenarios/drm/xfails/vkms-none-flakes.txt
 create mode 100644 tools/ci/gitlab-ci/scenarios/drm/xfails/vkms-none-skips.txt
 create mode 100644 tools/ci/gitlab-ci/scenarios/file-systems/file-systems.yml
 create mode 100644 tools/ci/gitlab-ci/scenarios/media/media.yml
 create mode 100644 tools/ci/gitlab-ci/scenarios/network/network.yml
 create mode 100644 tools/ci/gitlab-ci/static-checks.yml
 create mode 100644 tools/ci/gitlab-ci/test.yml

Comments

Leonardo Brás Jan. 24, 2025, 9:12 p.m. UTC | #1
On Fri, 2025-01-24 at 10:45 -0500, Nicolas Dufresne wrote:
> Le vendredi 24 janvier 2025 à 15:00 +0200, Laurent Pinchart a écrit :
> > On Fri, Jan 24, 2025 at 01:52:03PM +0100, Mauro Carvalho Chehab wrote:
> > > Em Fri, 24 Jan 2025 10:12:50 +0200 Laurent Pinchart escreveu:
> > > 
> > > > > It's been a few years since I first thought on finding a good way of helping
> > > > > kernel developers testing their patches, while making use of the free runner
> > > > > minutes Gitlab offers. It can greatly simplify the testing for people who are
> > > > > new to kernel development, or students trying to understand it better.
> > > > > 
> > > > > And this patchset allows that to happen :)
> > > > > 
> > > > > Actually, I spoke to Helen last year, and to enable it to run on the free
> > > > > Gitlab-CI runners, there is a small extra patch which is needed:
> > > > > 
> > > > > https://lore.kernel.org/all/20240327013055.139494-2-leobras@redhat.com/  
> > > 
> > > Sounds interesting!
> > > 
> > > > Gitlab as an open-source software project (the community edition) is one
> > > > thing, but can we please avoid advertising specific proprietary services
> > > > in the kernel documentation ?
> > > 
> > > Every time Gitlab is mentioned, the brand of the company that
> > > developed it and has been providing proprietary services is also
> > > advertised. If you're not happy with that, you should move to use
> > > a git forge developed by some open source community.
> > 
> > I'm fine mentioning the gitlab community edition, I'm not fine
> > advertising gitlab.com SaaS in the kernel source tree.

Hello Laurent,

I see your point, and I see no issue on removing the two last lines of CI_TAGS
documentation.

I just added this information on documentation because the default runner used
for the Free Tier of Gitlab does not work for this CI, as it needs more
resources to run. This information can be added on some other place, but at the
time I thought it would be ok to let it be there. 
This other runner I mentioned in the patch is also available on the Free Tier
(free as in beer).

I would like to make it clear that I have no connection/affiliation to Gitlab,
other than a free account in their system, which I use for some CI. I have no
interest on advertising anything from them.

My only objective is to make it easier to hobbyists/beginners to use those
available free minutes to test some change before sending the patch, if they
think that's valuable.

> 
> I've just looked attentively, the intention is just to explain you may need to
> set gitlab variable in your project fork in order to select correctly sized
> sized runners in your own instance.

That's correct

>  Its is not strictly about commercial gitlab.com instance. 

Exactly, the change is about being able to choose the runner you want.

> The default only works with the original project used
> instance (which is not gitlab.com as far as I know), but the comment refer to
> companies that will choose gitlab.com internally to reduce their IT cost.

Correct.
Companies can benefit on that, but my focus was on hobbyist (or begginers) who
may want to test their patches on free CI before sending them to the ML.

> 
> Its quite a stretch to call this "advertisement", that makes it looks very
> dramatic. I personally believe its quite ahead of most other gitlab CI to take
> into consideration running these pipelines on foreign (to the project)
> instances.
> 
> Nicolas

Thank you!
Leo

> 
> > 
> > > The way I see, the best would be if the CI integration could work
> > > with more than one type of forge and being able to use any
> > > free Git??b-CI runners that would be available for developers to
> > > use, as this would allow testing more subsystems with CI, thus
> > > increasing code quality.
> > 
>