Difference between revisions of "Continuous integration"

From CRIU
Jump to navigation Jump to search
m
 
(24 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
This page describes various system performing automatic build verification for CRIU.
 +
 
== Travis CI ==
 
== Travis CI ==
It's a public service, which is integrated with github and it's available for everyone.
+
[https://travis-ci.org Travis CI] is a free public service, it is well integrated with github.
 +
 
 +
To test CRIU with Travis CI, the Ubuntu 14.04 "trusty" VM is used, which has root access and an ability to run Docker containers.details.
 +
 
 +
With Travis CI, we do the following tests:
 +
* check compilation on all supported platforms (x86_64, arm, aarch64, and power)
 +
* do the same with <code>CC=clang</code> instead of gcc
 +
* check compilation on Alpine Linux (x86_64 only)
 +
* execute all tests that can work on the kernel available ([[ZDTM test suite]] and some other tests).
 +
* collect code coverage and upload it to [https://coveralls.io/github/xemul/criu Coveralls]
 +
 
 +
For implementation details, see <code>.travis.yml</code>, <code>scripts/travis/</code> and <code>scripts/build/</code> in CRIU sources for details.
 +
 
 +
=== Patchwork ===
 +
[https://patchwork.criu.org/project/criu Patchwork] is a web patch tracking system for projects using a mailing list for contributions and reviews.
 +
 
 +
In CRIU it is used to grab patch series from the CRIU mailing list, create a new git branch which is tested by Travis, and report success/failure back to the mailing list.
 +
 
 +
'''For more info, see [[Patchwork]]'''.
 +
 
 +
=== Non-x86 architectures ===
 +
 
 +
Travis CI only provides x86_64, so using other platforms is a bit tricky. We use [[Docker build|Docker]] to get a container for a target platform, and a static build of qemu-user-$ARCH to run this container. As qemu-user-static is not available for Ubuntu 14.04, [https://github.com/xemul/criu/blob/master/scripts/build/extract-deb-pkg a script] downloads it from Debian and extracts binaries.
 +
 
 +
Unfortunately, qemu-user functionality is limited (for example, <code>strace</code> syscall is not implemented), so we can't run any tests on these architectures.
 +
 
 +
=== Kernel testing ===
 +
 
 +
In addition to testing CRIU, we use Travis CI to test a few branches of the Linux kernel, to make sure recent changes does not break our precious software. We report found bugs to the kernel, and maintain a list of those bugs at [[Linux-next]].
 +
 
 +
The process consists of "git clone" the kernel, compiling it, and using kexec to reboot to a new kernel. The catch is we have to use CRIU itself to checkpoint/restore the travis control process, so that the VM is not lost to Travis upon reboot. Please see [https://avagin.github.io/travis-kexec-criu this article] for more details on the process.
 +
 
 +
To check the recent builds, see https://travis-ci.org/avagin/linux/builds .
 +
 
 +
=== Enable Travis CI for your repo ===
  
We use "The Trusty beta Build Environment", where we have a full root access and an ability to execute docker containers. We use Travis to check compilation on x86_64, arm and aarch64. In addition, we execute all tests which have to work on the Trusty kernel.
+
You can test your own criu repo with Travis (and it's highly recommended to check your changes before sending patches to the mailing list).
  
The most interesting part of this work is how to build CRIU for other platforms on x86_64. We use [[Docker build|Docker]] to get a container for a target platform and qemu-static to run this container. qemu-static doesn't exist in all distributions, so we download it from Debian and extract binaries from it [https://github.com/xemul/criu/blob/master/scripts/build/extract-deb-pkg].
+
The setup is really easy, all you need to do is:
  
It's highly recommended to enable Travis for your criu repo on github and check changes before sending them to the mail list.
+
* [https://travis-ci.org/auth Sign in] to Travis CI, using your github account.
 +
* Wait till Travis CI synchronizes your github repositories.
 +
* Check your [https://travis-ci.org/profile profile page] and enable Travis CI for your CRIU repo.
 +
* Create a new branch or push a new commit to github to trigger a build.
  
 
== Mr Jenkins ==
 
== Mr Jenkins ==
We use Jenkins to execute tests. It works only for the criu upstream repo and isn't available to users yet. If you visit [https://ci.openvz.org/view/CRIU/], you will find more than dozen jobs for different configurations. We try to test all criu features. In addition, we execute our tests on linux-next to be sure that nobody breaks us in a kernel space.
+
We use Jenkins to execute tests. It works only for the criu upstream repo and isn't available to users yet. If you visit [https://ci.openvz.org/view/CRIU/], you will find more than dozen jobs for different configurations. We try to test all criu features.
 +
 
 +
Most part of jobs uses [[ZDTM test suite]]. There each test is a small program. Each job plays different scenarios with these tests:
 +
* dump/restore
 +
* dump/restore a few times
 +
* dump/restore with a freezer cgroup
 +
* dump only
 +
* pre-dump, dump/restore with or without page-server
 +
* pre-dump with duplication
 +
* [[fault injection]]
 +
* collect code coverage
 +
 
 +
In addition, we execute our tests on linux-next to be sure that nobody breaks us in a kernel space.
 +
 
 +
[https://ci.openvz.org/job/CRIU/ https://ci.openvz.org/job/CRIU/job/CRIU-x86_64/branch/criu-dev/badge/icon?believeme=.png]
 +
[https://ci.openvz.org/computer/CRIU-linux-next https://ci.openvz.org/job/CRIU-linux-next/badge/icon?believeme=.png]
 +
 
 +
== Targets ==
 +
 
 +
CRIU project supports different hardware architectures and we test all of supported archs. This chapter describes targets used for CRIU testing.
 +
 
 +
* Virtuozzo virtual machine (x86_64, Fedora?)
 +
 
 +
* [http://www.fit-pc.com/web/products/fitlet/ Fitlet] (x86_64, Fedora 23)
 +
 
 +
* Raspberry Pi Model B Rev 2 (ARM, Raspbian)
 +
 
 +
* Virtual machine (PPC64el)
 +
 
 +
== See also ==
 +
 
 +
* [[How to submit patches]]
 +
* [[ZDTM test suite]]
 +
* [[Linux-next]]
 +
* [[Patchwork]]
  
== Links ==
+
== External links ==
 
* [https://travis-ci.org/xemul/criu Travis]
 
* [https://travis-ci.org/xemul/criu Travis]
 
* [https://ci.openvz.org/view/CRIU/ Mr Jenkins]
 
* [https://ci.openvz.org/view/CRIU/ Mr Jenkins]
 +
* [https://coveralls.io/github/xemul/criu Coveralls]
  
 
[[Category: Development]]
 
[[Category: Development]]
 +
[[Category: Infrastructure]]

Latest revision as of 08:03, 16 February 2018

This page describes various system performing automatic build verification for CRIU.

Travis CI[edit]

Travis CI is a free public service, it is well integrated with github.

To test CRIU with Travis CI, the Ubuntu 14.04 "trusty" VM is used, which has root access and an ability to run Docker containers.details.

With Travis CI, we do the following tests:

  • check compilation on all supported platforms (x86_64, arm, aarch64, and power)
  • do the same with CC=clang instead of gcc
  • check compilation on Alpine Linux (x86_64 only)
  • execute all tests that can work on the kernel available (ZDTM test suite and some other tests).
  • collect code coverage and upload it to Coveralls

For implementation details, see .travis.yml, scripts/travis/ and scripts/build/ in CRIU sources for details.

Patchwork[edit]

Patchwork is a web patch tracking system for projects using a mailing list for contributions and reviews.

In CRIU it is used to grab patch series from the CRIU mailing list, create a new git branch which is tested by Travis, and report success/failure back to the mailing list.

For more info, see Patchwork.

Non-x86 architectures[edit]

Travis CI only provides x86_64, so using other platforms is a bit tricky. We use Docker to get a container for a target platform, and a static build of qemu-user-$ARCH to run this container. As qemu-user-static is not available for Ubuntu 14.04, a script downloads it from Debian and extracts binaries.

Unfortunately, qemu-user functionality is limited (for example, strace syscall is not implemented), so we can't run any tests on these architectures.

Kernel testing[edit]

In addition to testing CRIU, we use Travis CI to test a few branches of the Linux kernel, to make sure recent changes does not break our precious software. We report found bugs to the kernel, and maintain a list of those bugs at Linux-next.

The process consists of "git clone" the kernel, compiling it, and using kexec to reboot to a new kernel. The catch is we have to use CRIU itself to checkpoint/restore the travis control process, so that the VM is not lost to Travis upon reboot. Please see this article for more details on the process.

To check the recent builds, see https://travis-ci.org/avagin/linux/builds .

Enable Travis CI for your repo[edit]

You can test your own criu repo with Travis (and it's highly recommended to check your changes before sending patches to the mailing list).

The setup is really easy, all you need to do is:

  • Sign in to Travis CI, using your github account.
  • Wait till Travis CI synchronizes your github repositories.
  • Check your profile page and enable Travis CI for your CRIU repo.
  • Create a new branch or push a new commit to github to trigger a build.

Mr Jenkins[edit]

We use Jenkins to execute tests. It works only for the criu upstream repo and isn't available to users yet. If you visit [1], you will find more than dozen jobs for different configurations. We try to test all criu features.

Most part of jobs uses ZDTM test suite. There each test is a small program. Each job plays different scenarios with these tests:

  • dump/restore
  • dump/restore a few times
  • dump/restore with a freezer cgroup
  • dump only
  • pre-dump, dump/restore with or without page-server
  • pre-dump with duplication
  • fault injection
  • collect code coverage

In addition, we execute our tests on linux-next to be sure that nobody breaks us in a kernel space.

icon?believeme=.png icon?believeme=.png

Targets[edit]

CRIU project supports different hardware architectures and we test all of supported archs. This chapter describes targets used for CRIU testing.

  • Virtuozzo virtual machine (x86_64, Fedora?)
  • Raspberry Pi Model B Rev 2 (ARM, Raspbian)
  • Virtual machine (PPC64el)

See also[edit]

External links[edit]