Build your open source projects on IBM Power Systems with Travis CI

As of 13 November, 2019 we are moving our Travis CI beta into production! We will be working with communities to move jobs from the current travis-ci.org site to the updated travis-ci.com front end, which will now have support for Linux on Power (ppc64le – Little Endian) continuous integration. Support only exists for open source projects that are hosted on GitHub (github.com). IBM is providing free Power server back end support through the IBM Cloud for open source projects hosted on github.com.

In this tutorial, we’ll look at the following two ways of adding a project to build automatically on IBM® Power Systems™ servers:

  • An extension of an existing Intel® build
  • A new project added to Travis CI just for IBM Power® build support

Prerequisites

To complete these tasks, I assume that you already have basic familiarity with Travis CI and that you’ve configured the .travis.yml file before proceeding. If you aren’t familiar, you might want to start here: https://docs.travis-ci.com/user/tutorial/.

Adding Power support to an existing Intel build on Travis CI

This is very, very simple. First, in the .travis.yml file for your project, find the os: linux line. This is what tells Travis CI to perform a Linux® build. By default, today, Linux means Linux on Intel. After that line, add:

arch: ppc64le

This tells Travis CI to add your build to the Power build queue. In the ideal case, this is the only change you would need to make. Note that you can also add

arch: s390x

or

arch: amd64

To get Linux distribution on IBM Z® or Linux on AMD builds from the same .travis.yml file.

Adding a new project to Travis CI for Power build support

If you have not yet used Travis CI, perform the following steps:

  1. Add a new project to Travis CI. This is done as follows:
    1. Log into the Travis CI dashboard (https://travis-ci.com) using your GitHub credentials (github.com).
    2. After logging in, click Accounts (a drop-down list option under the user name) and sync the GitHub repositories with the Travis dashboard.
  2. After the sync is complete, notice that all the GitHub projects for the logged in user is listed.
  3. Enable the project for builds using the toggle button on the left. After the project is enabled, build will be automatically triggered every time a commit is done.
  4. Update your .travis.yml file for Power build. As I mentioned previously, platforms (Intel or Power) on which the build runs are controlled by os at Travis CI.

    • os: linux: Requests an Intel build
    • arch: ppc64le: Requests a Power build

These steps should be enough to get your job to run on the Travis CI Power servers.

What to do if the build fails?

You may find that your build environment has dependencies that are available somewhere for Intel but are not available for Power. If so, you may need to identify your application’s dependencies, depending on what errors you encountered.

Type mismatches in your application could occur if you code to the compiler on Intel, as opposed to the standard; as a result, some type mismatches happen to do the right thing but aren’t technically correct. If so, the Migration Advisor from the Power software development kit (SDK) may be able to help. You can find the information about SDK here: https://developer.ibm.com/articles/intro-to-sdk-for-lop/.

In some cases, your application may depend on packages that have Intel-based binaries that you downloaded either from the distro or from some external website. If the package is in the distro for Intel, it is probably in the same distro for Power, but it may not have been downloaded to your Travis environment. You can use a tool called OSPAT to find those packages. If they are in the distro, the tool will let you know. The Source and other links field will say Distribution in which case, you can use apt-get install or yum install to install the package.

You may find that the package that you want is not in the distro. If it has been ported to Power but a binary is not available, there may be either a container or build instructions, or both, available. OSPAT will point to them in the output (in the Source and other links field). You’ll need to use wget or the equivalent to download the source and the build script or install the container as appropriate.

In other cases, you may find that your build breaks because of unresolved symbols – typically from libraries that are not available on your system. For these, you can try the new Library Finder which takes an unresolved symbol as input and provides the library name, location, and the package that contains the library as the output. Then it is simply a matter of installing that library in your build environment and configuring it in the configuration files for your application.

These are relatively simple steps to resolve most errors. However, often you’ll find that your source tree includes Intel assembly instructions that won’t move to Power easily. Many of these optimized implementations also have a generic version which will compile and build on Power. The Power compiler (that is, gcc) will apply many optimizations as part of the normal compilation process. This should get your application to the point of building and being functional. Even so, you may find that the optimization was in a key part of the application that will require you to port the instructions to Power. The Power instruction set is located here for reference: https://openpowerfoundation.org/?resource_lib=power-isa-version-3-0.

If you need help, try the Travis CI forum.

In general, getting projects running on Travis CI is fairly easy. On an internal instance of Travis CI at IBM, we build over 200 of our next generation projects using Travis CI on Power. We are also working actively with communities to enable their projects to build on Power (and soon on IBM System z®) with great success.