Project

General

Profile

Jenkins build verification jobs

We are building the various Osmocom projects when patches get posted to Gerrit for review and when patches have been merged to the master branch.
The jenkins-job-builder configuration files are in osmo-ci.git/jobs.

Workflow

  • Change in master/Gerrit triggers a one of the jobs generated by master-builds.yml/gerrit-verification.yml (example)
  • Jenkins triggers a new job and waits until it completes (example, you get there from the previous example by clicking the "master-osmo-bsc..." link and opening the job from the build history on the left with the same ID as the previous link has: 4300)
  • This job most likely runs contrib/jenkins.sh of the git repository in question. There are some variations of this, depending on the repository (e.g. using Docker, see below). Look for the repository name in the appropriate .yml config file for details.
  • The contrib/jenkins.sh typically builds the source code and runs the unit tests.

Docker image

Some jobs do not run directly on a Jenkins buildbot, but instead inside a Docker container. That is due to the VTY tests, in order to be able to run them several times in parallel.

The entry for osmo-bsc in gerrit-verification.yml looks like this for example:

- osmo-bsc:
  cmd: |
    docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \
      -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \
      -v "$PWD:/build" -v "$HOME/bin:/build_bin" \
      osmocom:amd64 /build/contrib/jenkins.sh

The Docker image is osmocom:amd64. All of the build verification jobs, that are using Docker, use this image. The Dockerfile_osmocom_jenkins.amd64 is located in osmo-ci.git/docker. Rebuilding it works as follows:
  • update-osmo-ci-on-slaves (update-osmo-ci-on-slaves.yml) gets triggered on changes in osmo-ci.git's master branch
  • runs contrib/jenkins.sh of osmo-ci.git
  • runs docker/rebuild_osmocom_jenkins_image.sh of osmo-ci.git

Running locally

If you are modifying the Dockerfile mentioned above, it is a good idea to check locally if your changes work as intended. Run docker/rebuild_osmocom_jenkins_image.sh first, then a script like the following. Adjust the paths and project as necessary.

#!/bin/sh -xe
export PARALLEL_MAKE=-j5
CISCRIPTS=/home/user/code/osmo-dev/src/osmo-ci/scripts
cd ~/code/osmo-dev/src/osmo-bsc

docker run --rm=true -e HOME=/build -e MAKE=make -e PARALLEL_MAKE="$PARALLEL_MAKE" \
            -e PATH="$PATH:/build_bin" -e OSMOPY_DEBUG_TCP_SOCKETS="1" -w /build -i -u build \
            -v "$PWD:/build" -v "$CISCRIPTS:/build_bin" \
            osmocom:amd64 /build/contrib/jenkins.sh
Add picture from clipboard (Maximum size: 48.8 MB)