Code Monkey home page Code Monkey logo

jenkins-cirt-libs's Introduction

CI-RT jenkins pipeline library repository

This repository contains the CI-RT Jenkins pipeline library functions and an explanation how to setup the Jenkins master and slaves.

  1. Setup of Jenkins master instance

  2. Database for test results

  3. 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".

Setup of Jenkins master instance

The Jenkins instance is setup on a Debian 9 (stretch) based system.

Required Debian Packages

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:

Required Jenkins Plugins

Base functionality:

Plugins for slaves (including real hardware):

Notification:

Required Configuration

Configuration of Plugins

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"

r4d cloud
  • 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!

Jenkins global configuration

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:

configure libs

Jenkins credential for database

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:

db credentials

Jenkins job setup

Please refer to the test-description README.

Database for Test Results

Jenkins needs a database to fill in the test results. For setup of the database please consider database README.

Setup of Jenkins slaves

All Jenkins instances are known as Jenkins Nodes. The Jenkins main instance is already configured as "Master".

Required Debian Packages

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

Preparation

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.

Configuration in Jenkins

The CI-RT testing infrastructure uses two different types of slaves:

  • slaves with the label "kernel" for compile jobs as "permanent agent":

permanent agent details
  • several slaves as test targets (with the same label as the hostname) as "Slave virtual computer running on a virtualization platform (via libvirt)":

iommu details

License rules

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> --%>

Copyright notices shall be placed right below the SPDX identifier with the same comment format as the SPDX identifier. The canonical form for a copyright notice is:

Copyright (c) <year> <copyright holders>

jenkins-cirt-libs's People

Contributors

bene42 avatar anna-marialx avatar djfun avatar

Watchers

James Cloos avatar  avatar Manuel Traut avatar  avatar

Forkers

metux

jenkins-cirt-libs's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.