1*edff4923SAndrew Geissler# **CI for Yocto Project and meta-arm** 2*edff4923SAndrew Geissler# **CI for Yocto Project** 3*edff4923SAndrew GeisslerThe Yocto Project has an autobuilder that performs nightly builds and image tests on all of the defined QEMU machines, including qemuarm and qemuarm64 Also, it currently runs builds on the hardware reference platforms including genericarm64 and meta-arm mahines fvp-base and sbsa-ref. More information on the autobuilder can be found at <https://autobuilder.yoctoproject.org/>. 4*edff4923SAndrew Geissler 5*edff4923SAndrew GeisslerMore information on the image tests can be found at <https://wiki.yoctoproject.org/wiki/Image_tests>. 6*edff4923SAndrew Geissler 7*edff4923SAndrew GeisslerThe Yocto Project also has the ability to have individual package tests, ptests. For more information on those, go to <https://wiki.yoctoproject.org/wiki/Ptest>. 8*edff4923SAndrew Geissler# **CI for meta-arm** 9*edff4923SAndrew Geisslermeta-arm is using the Gitlab CI infrastructure. This is currently being done internal to Arm, but an external version can be seen at <https://gitlab.com/jonmason00/meta-arm/-/pipelines>. 10*edff4923SAndrew Geissler 11*edff4923SAndrew GeisslerThis CI is constantly being expanded to provide increased coverage of the software and hardware supported in meta-arm. All platforms are required to add a kas file and `.gitlab-ci.yml` entry as part of the initial patch series. More information on kas can be found at <https://github.com/siemens/kas>. 12*edff4923SAndrew Geissler 13*edff4923SAndrew GeisslerTo this end, it would be wise to run kas locally to verify everything works prior to pushing to the CI build system. 14*edff4923SAndrew Geissler## **Running kas locally** 15*edff4923SAndrew Geissler### **Install kas** 16*edff4923SAndrew Geisslerkas can be installed with pip, for example: 17*edff4923SAndrew Geissler``` 18*edff4923SAndrew Geissler$ pip3 install --user kas 19*edff4923SAndrew Geissler``` 20*edff4923SAndrew Geissler 21*edff4923SAndrew GeisslerSee <https://kas.readthedocs.io/en/latest/userguide/getting-started.html> for information on the dependencies and more. 22*edff4923SAndrew Geissler 23*edff4923SAndrew GeisslerThis assumes that the kas path ($HOME/.local/bin) is in $PATH. If not, the user will need to manually add this or the kas command will not be found. 24*edff4923SAndrew Geissler 25*edff4923SAndrew Geissler### **Run kas locally** 26*edff4923SAndrew Geissler``` 27*edff4923SAndrew Geissler$ cd ~/meta-arm/ 28*edff4923SAndrew Geissler$ kas build kas/juno.yml 29*edff4923SAndrew Geissler``` 30*edff4923SAndrew Geissler 31*edff4923SAndrew GeisslerBy default kas will create a build directory under meta-arm to contain the checked out layers, build directory, and downloads. You can change this by setting environment variables. DL\_DIR and SSTATE\_DIR are respected so these can point at existing directories, and setting KAS\_WORK\_DIR to the directory where repositories are already cloned will save having to re-fetch. This can look something like: 32*edff4923SAndrew Geissler``` 33*edff4923SAndrew Geissler$ SSTATE_DIR=/builds/persist/sstate DL_DIR=/builds/persist/downloads kas build ci/qemuarm64.yml:ci/testimage.yml 34*edff4923SAndrew Geissler``` 35*edff4923SAndrew Geissler 36*edff4923SAndrew GeisslerSee the [quick start guide](/documentation/quick-start.md) for more information on how to set this up. 37*edff4923SAndrew Geissler 38*edff4923SAndrew Geissler## **Locked Revisions in CI with lockfiles** 39*edff4923SAndrew GeisslerThe CI in meta-arm will generate a kas "lock file" when it starts to ensure that all of the builds checkout the same revision of the various different layers that are used. If this isn't done then there's a chance that a layer will be modified upstream during the CI, which results in some builds failing and some builds passing. 40*edff4923SAndrew Geissler 41*edff4923SAndrew GeisslerThis lock file is saved as an artefact of the update-repos job by the CI, and only generated if it doesn't already exist in the repository. This can be used to force specific revisions of layers to be used instead of HEAD, which can be useful if upstream changes are causing problems in development. 42*edff4923SAndrew Geissler 43*edff4923SAndrew GeisslerThe lockfile.yml can be downloaded manually, but there's a script in meta-arm to fetch the lock file for the latest successful build of the specified branch: 44*edff4923SAndrew Geissler 45*edff4923SAndrew Geissler``` 46*edff4923SAndrew Geissler$ ./ci/download-lockfile.py --help 47*edff4923SAndrew Geisslerusage: download-lockfile.py [-h] server project refspec 48*edff4923SAndrew Geissler 49*edff4923SAndrew Geisslerpositional arguments: 50*edff4923SAndrew Geissler server GitLab server name 51*edff4923SAndrew Geissler project meta-arm project name 52*edff4923SAndrew Geissler refspec Branch/commit 53*edff4923SAndrew Geissler 54*edff4923SAndrew Geissler$ ./ci/download-lockfile.py https://gitlab.com/jonmason00/meta-arm master 55*edff4923SAndrew GeisslerFetched lockfile.yml 56*edff4923SAndrew GeisslerCommit this lockfile.yml to the top-level of the meta-arm repository and the CI will use it automatically. 57*edff4923SAndrew Geissler``` 58*edff4923SAndrew Geissler# **Relevant Links for kas, CI, and testing** 59*edff4923SAndrew Geissler<https://github.com/siemens/kas.git> 60*edff4923SAndrew Geissler 61*edff4923SAndrew Geissler<https://wiki.yoctoproject.org/wiki/Oe-selftest> 62*edff4923SAndrew Geissler 63*edff4923SAndrew Geissler<https://wiki.yoctoproject.org/wiki/Image_tests> 64*edff4923SAndrew Geissler 65*edff4923SAndrew Geissler<https://wiki.yoctoproject.org/wiki/Ptest> 66*edff4923SAndrew Geissler 67*edff4923SAndrew Geissler<https://wiki.yoctoproject.org/wiki/BSP_Test_Plan> 68