|
1 | | -# Motivations for kdevops's kernel-ci |
2 | | - |
3 | | -There are different kernel-ci efforts out there. They serve a few purposes. |
4 | | -Our goal is to allow Linux developers and different Linux distributions to be |
5 | | -able to build different test baselines for different test suites for a kernel |
6 | | -release, and allow them to detect regressions when new changes are merged. |
7 | | -The kdevops kernel-ci effort can then be used to test kernel merge commits |
8 | | -prior to integration, so to ensure no regressions occur proactively on a |
9 | | -kernel release. |
10 | | - |
11 | | -# kdevops kernel-ci requirements |
12 | | - |
13 | | -The kdevops project has taken on its own kernel-ci effort given the requirements |
14 | | -we set out to meet and that upon review no existing project suited our needs. |
15 | | -Our requirements are: |
16 | | - |
17 | | - * We wan to be able to build tests on the fly on bare metal, virtualized |
18 | | - guests, or cloud solutions. This gives us the flexibility to let developers |
19 | | - and our test infrastructure pick any solution to run tests on, it also gives |
20 | | - us the possibility to allow kernel-ci efforts to grow test capacity using |
21 | | - different technologies. |
22 | | - * We want to run tests and produce test results in a way that developers can |
23 | | - easily relate to. No fancy dashboards are required, however they can be |
24 | | - developed. If a regresssion occurs we want to be notified about it. |
25 | | - * Initial target test requirements were to support testing fstests and |
26 | | - blktests. More tests have been added with time. More tests for different |
27 | | - subsystems are expected to be added and are welcomed. |
| 1 | +# kdevops's kernel-ci |
| 2 | + |
| 3 | +The kdevops kernel-ci supports testing both simple and extremely complex Linux |
| 4 | +kernel subsystems, allowing developers to proactively test patches posted on |
| 5 | +the mailing list, test custom branches, or to continuously test Linux so to |
| 6 | +avoid regressions and discover new bugs. |
| 7 | + |
| 8 | +To avoid regressions baselines can be developed and used and are an optional |
| 9 | +part of the kdevops kernel-ci process. In order to support testing patches from |
| 10 | +mailing lists |
| 11 | +[kernel-patches-daemon](https://github.com/facebookincubator/kernel-patches-daemon) |
| 12 | +(kpd) can optionally be used and is supported. |
| 13 | + |
| 14 | +Both github and gitlab actions are optionally supported so to leverage |
| 15 | +triggering tests on custom repositories with custom branches. Either kpd |
| 16 | +can push custom branches to test or developers can manually push custom |
| 17 | +branches to test. Once confidence on a CI pipeline is high, tests against |
| 18 | +new Linux releases can also be automated. |
| 19 | + |
| 20 | +Both self-hosted runners and cloud solutions can be used. Manually running |
| 21 | +kdevops tests is also possible. Below we provide an ASCII art image |
| 22 | +representation of what this looks like. |
| 23 | + |
| 24 | +``` |
| 25 | ++---------------------------------------------+ +--------------------------- |
| 26 | +| Mailing List Patches | | Direct dev branch pushes | |
| 27 | +|---------------------------------------------| |---------------------------|- |
| 28 | +| - Patches submitted to mailing lists | | - Developers push | |
| 29 | +| - Example: linux-modules vger list | | branches directly | |
| 30 | ++----------------------+----------------------+ +-------------------+------- |
| 31 | + | | |
| 32 | + | | |
| 33 | + v v |
| 34 | + +----------------+ +--------------------------+ |
| 35 | + | Patchwork | | Topic KPD Tree | |
| 36 | + |----------------| |--------------------------| |
| 37 | + | - Tracks patch | | - Receives branches from | |
| 38 | + | submissions | | dev-tree from KPD App | |
| 39 | + | - Sends series | | and direct developer | |
| 40 | + | to GitHub | | pushes | |
| 41 | + +----------------+ | - Adds `kdevops-ci` as | |
| 42 | + | | the first commit for | |
| 43 | + | | patches from Patchwork | |
| 44 | + v | - Developers merge | |
| 45 | + +--------------------------+ | `kdevops-ci` as the | |
| 46 | + | GitHub KPD Topic |---> |last step in their dev | |
| 47 | + | App | +----------+--------------+ |
| 48 | + |--------------------------+ | |
| 49 | + | - Adds `kdevops-ci` as | | |
| 50 | + | the first commit and | | |
| 51 | + | applies patch series | | |
| 52 | + | - Pushes branch to KPD | | |
| 53 | + | topic tree | | |
| 54 | + +--------------------------+ | |
| 55 | + | |
| 56 | + v |
| 57 | + +--------------------------+ |
| 58 | + | github CI / gitlab CI | |
| 59 | + |--------------------------| |
| 60 | + | - Executes CI workflows | |
| 61 | + | on topic branches | |
| 62 | + | - Uses kdevops for | |
| 63 | + | testing workflows | |
| 64 | + | - Uploads zip artifacts | |
| 65 | + +--------------------------+ |
| 66 | + | |
| 67 | + v |
| 68 | + +--------------------------+ |
| 69 | + | kdevops | |
| 70 | + |--------------------------| |
| 71 | + | - Orchestrates testing | |
| 72 | + | configurations | |
| 73 | + | - Manages ansible tasks | |
| 74 | + | - pushes the results to |
| 75 | + | kdevops-results-archive| |
| 76 | + +--------------------------+ |
| 77 | + | |
| 78 | + v |
| 79 | + +--------------------------+ |
| 80 | + | kdevops-results-archive | |
| 81 | + |--------------------------| |
| 82 | + | - Archives results in | |
| 83 | + | using (git LFS) | |
| 84 | + +--------------------------+ |
| 85 | +``` |
| 86 | + |
| 87 | +# What's possible at a glance |
| 88 | + |
| 89 | +Here's what's possible. The variability that kdevops supports through |
| 90 | +the adoption of Linux kconfig, it let's you expose that variability directly |
| 91 | +from the github action. You can git push a tree, and then customize specifics |
| 92 | +of your workflow test. |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | +Here is the drop down menu you get: |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | +You can pick the branch which you want the test to run. Each branch in turn can |
| 101 | +have custom input options of its own. |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | +For filesystem testing you can customize the soak duration used. |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +You can pick the specific group you want to test: |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | +You can pick one of the existing tests: |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +You can also just specify the group of tests you want manually, ie a custom |
| 118 | +test: |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | +You then just sit and wait but you can also access the console of the runner |
| 123 | +and watch live with a status of each machine being tested, a different target |
| 124 | +node will run each test filesystem profile. |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | +# kernel-patches-daemon support |
| 129 | + |
| 130 | +Manual tests are just one way to run tests on kdevops. You can also proactively |
| 131 | +test from patches posted on the development mailing list. |
| 132 | + |
| 133 | +The use of |
| 134 | +[kernel-patches-daemon](https://github.com/facebookincubator/kernel-patches-daemon) |
| 135 | +(kpd) is only important if you want to proactively test all patches |
| 136 | +posted to a subsystem mailing list. Using kpd requires a patchwork project |
| 137 | +created for you under kernel.org, these are typically configured to aggregate |
| 138 | +all patches from a mailing list. However, smaller subsystems can leverage new |
| 139 | +patchwork support from kernel.org which leverages lei support, allowing |
| 140 | +custom filters for which patches should be queued up. For more details |
| 141 | +on kpd support see [kdevops kpd integration](kernel-ci-kpd.md) |
| 142 | + |
| 143 | +# Leveraging existing git CI solutions for Linux kernel development |
| 144 | + |
| 145 | +GitHub CI/CD and GitLab Pipelines provide support for Continuous |
| 146 | +Integration (CI) and (Continuous Integration). They both provide automation |
| 147 | +features that let you run workflows, tests, builds, and deployments based on |
| 148 | +triggers like commits, pull requests, or specific schedules. |
| 149 | + |
| 150 | +From a Linux kernel development perspective we're more interested in the CI |
| 151 | +(Continuous Integration) part: running tests, building code, running tests |
| 152 | +whenever code is posted or committed or pushed. |
| 153 | + |
| 154 | +In Linux the CD (Continuous Delivery/Deployment) part, which deals with |
| 155 | +automating deployment, pushing changes to staging production is already dealt |
| 156 | +with through the Linux development workflow. The linux-next tree is used |
| 157 | +for continuous delivery of the latest subsystem trees. There are also |
| 158 | +specialized trees such as fs-next which aggregate only the filesystem specific |
| 159 | +parts of this so to avoid having to deal testing for example graphics. By |
| 160 | +the time we get to the merge window, most code should have been tested and |
| 161 | +vetted for. |
| 162 | + |
| 163 | +The CI part of github and gitlab are called Github actions and GitLab Pipelines |
| 164 | +respectively. To keep things simple we refer to both as ``git CI solutions``. |
| 165 | + |
| 166 | +# The case for self-hosted runners |
| 167 | + |
| 168 | +Today's CI git solutions allow for free runners which leverage containers |
| 169 | +or with self-hosted runners. Although you can technically pull off using |
| 170 | +virtualization inside a container a |
| 171 | +[review of CI runners](https://lore.kernel.org/r/CAB=NE6VKWSkv1JZ_Z2LKq4o7+JBkKc6u8Wa1zxxBnGHOG4BgjA@mail.gmail.com) |
| 172 | +concluded a containerized solution doesn't help much. |
| 173 | + |
| 174 | +If you're going to leverage a git CI solution with kdevops you want to use |
| 175 | +self-hosted runners. |
| 176 | + |
| 177 | +## Locking down your organization for CI |
| 178 | + |
| 179 | +Since self-hosted runners are the only sensible solution for a kdevops CI, |
| 180 | +you want to make the default base permissions to not allow anyone other than |
| 181 | +trusted developers to be able to create pull requests, in case any git CI |
| 182 | +workflows leverage self-hosted runners. |
| 183 | + |
| 184 | +The alternative is to disallow pull requests on your git CI as triggers |
| 185 | +for you self-hosted runners since most organizations by default disable |
| 186 | +pushes for unprivileged users to the organization. |
| 187 | + |
| 188 | +# Github CI solution |
| 189 | + |
| 190 | +Github CI is implemented by leveraging yaml files in `.github/workflows/` |
| 191 | +directory of your project. There are two separate ways we leverage github CI, |
| 192 | +one for testing kdevops itself and making sure kdevops keeps working, and |
| 193 | +another is for Linux kernel development. The github CI for kdevops is part of |
| 194 | +kdevops itself, in the `.github/workflows/` directory. The github CI targeted |
| 195 | +for Linux kernel developers is managed through a separate tree, the |
| 196 | +[kdevops-ci](https://github.com/linux-kdevops/kdevops-ci) which is intended to |
| 197 | +be used as a merge into your Linux kernel development tree once you want testing |
| 198 | +for it. |
| 199 | + |
| 200 | +# kdevops CI results |
| 201 | + |
| 202 | +Since CI provides the automation test vehicle we want a way to collect results. |
| 203 | +Today's git CI solutions only provide ephemeral results archiving. For Linux |
| 204 | +kernel development we want test results which will we can always procure. To |
| 205 | +address this the |
| 206 | +[kdevops-results-archive](https://github.com/linux-kdevops/kdevops-results-archive) |
| 207 | +automatically allows us to capture results leveraging |
| 208 | +[git LFS](https://git-lfs.com/) on the backend. Using git LFS we can allow |
| 209 | +folks to only gather specific results they are interested and allow git host |
| 210 | +providers to leverage their preferred storage solutions for archiving cold data. |
| 211 | +This also increases the max tarball we can support, and allows us to use epochs |
| 212 | +for achiving, enabling easy transitions to new epochs on the same tree. |
| 213 | + |
| 214 | +## The kdevops github CI |
| 215 | + |
| 216 | +The kdevops project leverages a github CI, for details refer to |
| 217 | +[kdevops CI](kernel-ci-kdevops.md) for details on how and what |
| 218 | +kdevops needs to test, and for test results look at the |
| 219 | +[kdevops actions results page](https://github.com/linux-kdevops/kdevops/actions). |
| 220 | + |
| 221 | +## The kdevops-ci for Linux kernel development |
| 222 | + |
| 223 | +You can just merge your subsystem |
| 224 | +[kdevops-ci](https://github.com/linux-kdevops/kdevops-ci) |
| 225 | +topic branch on your subsystem development branch to enable testing of your |
| 226 | +code for that subsystem through your self hosted runners. For details refer |
| 227 | +to the [kdevops-ci documentation](kernel-ci-kdevops-ci.md). |
| 228 | + |
| 229 | +# Gitlab CI solution |
| 230 | + |
| 231 | +This just requires an eager beaver to cat the existing github CI files into |
| 232 | +an AI agent and as it to port it to gitlab, then test it with a self-hosted |
| 233 | +gitlab runner. |
| 234 | + |
| 235 | +# kdevops runner requirements |
| 236 | + |
| 237 | +If you're going to use kdevops for a CI solution, you will need enough |
| 238 | +system resources either locally for VMs or on the cloud to run your tests. |
28 | 239 |
|
29 | 240 | # kdevops kernel-ci automation framework |
30 | 241 |
|
|
0 commit comments