|
|
Log in / Subscribe / Register

GitLab CI for the kernel

Ready to give LWN a try?

With a subscription to LWN, you can stay current with what is happening in the Linux and free-software community and take advantage of subscriber-only site features. We are pleased to offer you a free trial subscription, no credit card required, so that you can see for yourself. Please, join us!

By Daroc Alden
May 17, 2024

Working on the Linux kernel has always been unlike working on many other software projects. One particularly noticeable difference is the decentralized nature of the kernel's testing infrastructure. Projects such as syzkaller, KernelCI, or the kernel self tests test the kernel in different ways. On February 28, Helen Koike posted a patch set that would add continuous integration (CI) scripts for the whole kernel. The response was generally positive, but several people suggested changes.

Koike's patch set adds a new top-level ci directory that contains YAML configuration files for GitLab's continuous-integration feature, as well as shell scripts to tie those to the existing kernel tests. It reuses some of her existing work from the kernel's graphics subsystem tests, which also use GitLab as a Continuous Integration platform. The patch set currently includes code to run checkpatch and Smatch against proposed patches, and attempt to build the kernel on a few different architectures, but Koike plans to expand the coverage if this initial work is accepted. The patch set also includes a top-level .gitlab-ci file that instructs GitLab to run the tests by default.

The patch set

Several people responded positively to the proposal. Tim Bird thought that the change was useful, saying: "I don't currently use gitlab, but I might install it just to test this out." Maxime Ripard also thought the work could be useful, but questioned how well it could support different use cases. Ripard pointed out that different subsystems and maintainers probably have different uses for continuous integration. "I don't see how the current architecture could [accommodate] for that."

GitLab can be configured to look elsewhere inside the repository for the configuration file, Nikolai Kondrashov pointed out. He suggested that having a top-level configuration might not be best. "This way all the different subtrees can have completely different setup, but some could still use Helen's work and employ the 'scenarios' she implemented."

Linus Torvalds agreed that it would be better not to include the top-level configuration: "I'm not at all interested in having something that people will then either fight about, or - more likely - ignore, at the top level because there isn't some global agreement about what the rules are." Torvalds suggested that it might be better to have the CI project be separate from the kernel.

However, there are benefits to keeping the CI scripts in the same repository as the code itself, according to Kondrashov. This allows developers to ensure that the tests and the code remain in sync. He suggested that "we reframe this contribution as a sort of template, or a reference for people to start their setup with". He also raised the possibility of having the new code live somewhere other than the ci directory.

The suggestion that the code could be a library of pre-made pieces for maintainers to pick and choose from was "a lot more palatable" to Torvalds. He suggested that the tools/ci folder would be the logical place since it is "kind of alongside our tools/testing subdirectory." Koike was fine with that approach, saying that it would make her work as the maintainer of the kernel's graphics subsystem (DRM) tests easier and still support extending test coverage to other subsystems. Her colleague Nicolas Dufresne later recapped the discussion, stating that the top-level configuration file would be removed.

Guenter Roeck thought that there were at least some basic requirements which all kernel developers could agree upon.

Sure, argue against checkpatch as much as you like, but the code should at least _build_, and it should not be necessary for random people to report build failures to the submitters.

Randy Dunlap and Geert Uytterhoeven agreed. Ripard pointed out that running CI like this takes funding, and that the supporters of existing testing efforts like the DRM-CI infrastructure might not want to pay for tests of unrelated parts of the kernel.

I don't really expect, say, the clock framework, to validate that all DRM kunit tests pass for each commit they merge, even though one of them could totally break some of the DRM tests.

A follow-up message clarified that Ripard is in favor of automated tests, but doesn't think it's reasonable to expect people "to pay for builders running things they fundamentally don't care about."

KernelCI

Guillaume Tucker had a different question: "Where does this fit on the KernelCI roadmap?" KernelCI is a project that works to provide a distributed test-automation system for kernel development. It was started in 2012 by Arnd Bergmann, Olof Johansson, and Kevin Hilman to detect build failures for Arm builds of the kernel. In 2019, it was adopted by the Linux Foundation with plans to expand the coverage and infrastructure to cover the entire kernel community's needs.

Kondrashov replied that the work was "an important part of KernelCI the project," although not currently part of the KernelCI service. The project does have existing build infrastructure, which Kondrashov would like to be able to reuse by sending GitLab jobs to the same pipeline.

The existing KernelCI work and the new GitLab-based tooling were meant to serve different purposes, Dufresne suggested. The KernelCI testing is largely "integration" testing that incorporates multiple changes from across the kernel at once. Koike's proposed GitLab testing would run on every push to a repository, effectively testing changes in isolation. That will "help catch submission issues earlier, and reduce [the] kernelCI regression rate", according to Dufresne.

Tucker was not satisfied with that response, saying that the new code was not restricted to that use case, and that it provides "a platform able to cope with the diversity of workflows across the kernel subsystems". Tucker's message also pointed out that the code contained a lot of mentions of KernelCI in variable names and documentation, which serves to confuse whether this work is meant to be part of the project or not. If it is part of the project, Tucker questioned why it was diverging from the project's previous plans to provide a comprehensive platform with new features.

Gustavo Padovan replied that what Tucker was missing was that the community is not really working with the KernelCI project. "If one asks people around, the lack of community engagement with KernelCI is evident." The new work is the result of a renewed effort to provide high quality tests following a change in the project's leadership, according to Padovan. He hopes that the increased involvement will translate not only into better tests, but also the feedback and funding required to bring KernelCI to the level that previous plans had envisioned.

Tucker emphasized that he was in favor of the new CI work, and that he had just wanted clarity on how it was related to the KernelCI project. Despite the overall positive reaction, Koike has not yet sent a new version of the patch set. It seems clear that many kernel developers would like to see more automatic test coverage, however. The BPF developers, for example, have a talk about continuous integration scheduled for the upcoming Linux Filesystem Memory Management and BPF conference. So chances are good that an updated version of this work will make its way in sooner or later.



to post comments

GitLab CI for the kernel

Posted May 20, 2024 14:21 UTC (Mon) by Paf (subscriber, #91811) [Link]

The answers and comments about the broader kernelCI project do not inspire a lot of confidence - the relationship seems to be something like “well we’re them but also not them and we’re them but they’ve failed and we’re trying again”. It seems entirely muddled and likely to result in the same sort of damp squib. Sorry for the negativity, but that’s the impression I got from the article. Perhaps this time will be different - that would be good

GitLab CI for the kernel

Posted May 21, 2024 0:32 UTC (Tue) by jhoblitt (subscriber, #77733) [Link] (5 responses)

It is rather shocking that in 2024 the arguably most significant open source project still doesn't have basic CI. It seems to me that this is yet another hurdle that will keep new developers from contributing.

GitLab CI for the kernel

Posted May 21, 2024 12:58 UTC (Tue) by corbet (editor, #1) [Link] (1 responses)

The kernel has quite a bit of CI testing, at both the subsystem level and on trees like linux-next and -stable. There is room for a lot of improvement, but "doesn't have basic CI" is not really correct IMO.

GitLab CI for the kernel

Posted May 24, 2024 13:02 UTC (Fri) by smitty_one_each (subscriber, #28989) [Link]

Nor does friction mean blockage.

GitLab CI for the kernel

Posted May 21, 2024 13:08 UTC (Tue) by smoogen (subscriber, #97) [Link] (1 responses)

It doesn't shock me at all and follows what I have seen with large projects which have a lot of different moving parts. The problem comes from the following:
1. You have a lot of developers who have different opinions on what needs to be tested and what doesn't.
2. You have a lot of different code which needs special hardware to be properly tested to be working.
3. You have a lot of different CI frameworks and tooling which then have proponents and opponents to.
4. You have a lot of different timelines on when things are getting done and not.
5. You have a giant corpus of existing code which when you test A, you think its broken but then you realize you needed to test B with A which needed C and possibly D to test properly.
6. You have the natural human disposition to get the CI over and done with so that you can get back to what you really like doing which is working out why vendor A's memory management unit acts different when its over a critical threshold of transfers.
7. CI/CD tests and resource needs seem to grow exponentially with the codebase and combinations. This starts looking like an infinite amount of time again taking each developer from their part of the kernel.

The only solution I have found is to have multiple attempts bite at the giant pie in parts to get some level of coverage over time. Each one decides to concentrate on certain parts and try to get things working. Trying to come up with the ONE TRUE CI tends to end up with years of meetings and fights over how many angels dance on the QA server and then still end up with multiple tools.

GitLab CI for the kernel

Posted May 21, 2024 15:56 UTC (Tue) by Wol (subscriber, #4433) [Link]

> 7. CI/CD tests and resource needs seem to grow exponentially with the codebase and combinations. This starts looking like an infinite amount of time again taking each developer from their part of the kernel.

Not to flog a dead horse but design, Design, DESIGN!!!

If everything (inasmuch as it's possible, I know it's not always) is designed and built as an integrated, self-contained unit, you can test it and drop it in as a "black box" with "this is tested and works. There *should not* be any nasty surprises lurking anywhere".

Note I said "should not", not "undiscovered".

Cheers.
Wol

GitLab CI for the kernel

Posted May 23, 2024 18:10 UTC (Thu) by broonie (subscriber, #7078) [Link]

Like Corbet says that's simply not true, as the article mentions in the first paragraph there's a lot of CI going on with various people and companies testing things they care about. This is more about helping people using forge type systems like gitlab set up something for themselves and collaborate on common tooling.

GitLab CI for the kernel

Posted May 21, 2024 9:35 UTC (Tue) by jsakkine (guest, #80603) [Link]

I responded to the thread. Not to shoot it down but to understand the context better :-)


Copyright © 2024, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds