This repository contains the CI-RT Jenkins pipeline library functions and an explanation how to setup the Jenkins master and slaves.
-
Setup of Jenkins master instance
-
Database for test results
-
Setup of Jenkins slaves: for kernel compile jobs and for a test target
For the sake of completeness, please refer to the CI-RT explanation for detailed information of the hardware setup.
If you like to develop code for CI-RT, please notice the content of the sections "License rules" and "Copyright notice".
The Jenkins instance is setup on a Debian 9 (stretch) based system.
The following Debian packages are required (default Debian package repository):
-
openssh-client
-
openssh-server
-
bash
-
git
-
ntpdate
-
python3-junit.xml
-
python3-sqlalchemy
-
python3-psycopg2
-
python3-numpy
-
python3-pip
-
as PIP: junitparser (PIP installing packages)
CI-RT specific packages (available on a custom Debian repository http://debian.linutronix.de/tools) contain the tooling to communicate with real hardware located in racks via r4d using libvirt (see the CI-RT page for a more detailed hardware setup description):
Jenkins Debian Repository:
-
jenkins (see Installing Jenkins)
Base functionality:
Plugins for slaves (including real hardware):
Notification:
The following plugins require configuration (the names of specific sections in the Jenkins configuration are given only as a hint):
-
Email Extension; fill out fields in section "Extended E-mail Notification" and set field "System Admin e-mail address" in section "Jenkins Location"
-
Libvirt Slaves; see the example configuration with "r4d hypervisor"
-
Warnings; add the content of the following table into the appearing fields when click on "Add" in the section "Compiler Warnings"
Name: | Linux Kernel Makefile Errors |
---|---|
Link name: |
Linux Kernel Makefile Errors Result |
Trend report name: |
Linux Kernel Makefile Errors Trend |
Regular Expression: |
^\s*(ERROR:.*)$ |
Mapping Script: |
import hudson.plugins.warnings.parser.Warning import hudson.plugins.analysis.util.model.Priority String message = matcher.group(1); return new Warning("nil", 0, "Linux Kernel Makefile Errors", "build error", message, Priority.HIGH); |
Example Log Message: |
ERROR: "handle_bad_irq" [drivers/gpio/gpio-omap.ko] undefined! |
The shell executable used for the sh() command needs to be specified in the Jenkins global configuration. Please fill /bin/bash in the field "Shell executable".
The ci-rt libs need to be specified in the Jenkins global configuration:
For the credentials of the database, a global Jenkins credential with the ID "POSTGRES_CREDENTIALS" needs to be generated. This is done so that no hard-coded credentials are available as plain text in library source code or log files:
Please refer to the test-description README.
Jenkins needs a database to fill in the test results. For setup of the database please consider database README.
All Jenkins instances are known as Jenkins Nodes. The Jenkins main instance is already configured as "Master".
The following Debian package is required on every slave (default Debian package repository):
-
openjdk-8-jre-headless
On the slaves a CI-RT specific packages is required. (available on a custom Debian repository http://debian.linutronix.de/tools):
-
pyjutest
Please make sure that the following steps are executed as jenkins@Jenkins-master:
-
create ssh key without passphrase
-
copy ssh id to target
ssh-copy-id -i <SSH_IDENTITY> jenkins@<TARGET>
-
connect to target and test sudo
ssh -i <SSH_IDENTITY> -oPasswordAuthentication=no -t jenkins@<TARGET> "sudo /bin/systemctl status"
Please also make sure that the test targets are added to the CI-RT database and to r4d.
The CI-RT testing infrastructure uses two different types of slaves:
-
slaves with the label "kernel" for compile jobs as "permanent agent":
-
several slaves as test targets (with the same label as the hostname) as "Slave virtual computer running on a virtualization platform (via libvirt)":
The CI-RT Jenkins library is provided under the terms of the MIT license as provided in the LICENSE file.
Instead of adding MIT boilerplates to the individual files, CI-RT uses SPDX license identifiers, which are machine parseable and considered legaly equivalent.
The SPDX license identifier in CI-RT Jenkins lib shall be added at the first possible line in a file which can contain a comment. This is normally the first line except for scripts. Scripts require the #!PATH_TO_INTERPRETER tag in the first line; place the SPDX identifier into the second line.
The SPDX license identifier is added in form of a comment. The comment style depends on the file type::
groovy scripts: // SPDX-License-Identifier: <SPDX License Expression> bash/python scripts: # SPDX-License-Identifier: <SPDX License Expression> txt templates: <%-- SPDX-License-Identifier: <SPDX License Expression> --%>