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 blog, we’ll look at two ways of adding a project to build automatically on Power: First as an extension of an existing Intel build, and second as a new project added to Travis CI just for Power build support.
To complete these tasks, I assume that you already have basic familiarity with Travis CI and that you’ve configured
.travis.yml 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 do a Linux build. By default, today, Linux means Linux on Intel. After that line, add:
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
To get Linux on Z or Linux on AMD builds from the same .travis.yml
Adding a new project to Travis CI for Power build support
If you do not already use Travis CI, here is a short intro to the steps involved:
- Add a new project to Travis CI. This is done as follows:
- When sync completes, all the GitHub projects for the logged in user will be listed.
- Enable the project for builds using the toggle button on the left. Once the project is enabled, build will be automatically triggered every time a commit is done.
- Next, update your
.travis.ymlfile for Power build.
As I mentioned previously, platforms (Intel or Power) on which the build runs are controlled by key ‚Äúos‚ÄĚ at Travis CI.
os: linux:¬† Requests an Intel build
arch: ppc64l3: 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 SDK may be able to help.¬† You can find the full SDK here: https://developer.ibm.com/linuxonpower/sdk.
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 web site.¬† 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” https://developer.ibm.com/linuxonpower/open-source-pkgs/ 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 (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 tool https://developer.ibm.com/linuxonpower/tools-technologies/library-finder/ which takes as input an unresolved symbol and outputs the library name and location and the package that contains the library.¬† 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, every so often you’ll find that your source tree includes Intel assembly instructions that won’t move to Power as easily.¬† Many of these optimized implementations also have a generic version which will compile and build on Power.¬† The Power compiler (i.e. 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, there are many references listed at https://developer.ibm.com/linuxonpower.¬† Check out the Resources menu for some suggestions there.
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 System Z!) with great success.
Feel free to reach out if you have questions or need help porting.¬† There is a standard request form available at https://developer.ibm.com/linuxonpower/open-source-pkgs/porting/packages-form/.