Continuous Integration

Hi all,

I am looking for opinions on how to include ROOT into a continuous integration system (Gitlab CI or TRAVIS CI). At the moment the Ubuntu repos are still pushing ROOT 5, while we would like to test against ROOT 6 as well. These CI build systems typically time out before one can build ROOT and waiting for a complete build takes far too much time. I was hoping that the ROOT Docker would resolve the issue, but it is not clear to me how one could compile against the ROOT system in the docker. Any suggestions or comments would be appreciated.

Thanks

What exactly are you trying to do? The ROOT team uses Jenkins internally for testing ROOT and running all tests, but that uses CERN’s infrastructure, since as you mentioned, the builds are heavy and would time out on Travis CI, etc. With Gitlab CI you can add your own computer as a runner, though, which should help. Are you working on official packaging of ROOT 6 on Ubuntu?

Thanks for the quick response, I am not working on packaging ROOT. I’m working on projects that rely on ROOT as a prerequisite and as such need it to test the builds. I’m involved in projects using both the Travis CI for one project and Gitlab CI for another. The gitlab system is flexible enough to give a number of solutions such as using your own runner as you suggested or using fedora as the build environment which has ROOT 6 in the repos.

The other project using Travis CI is light on resources and as such does not have any back-end computing available to build a separate runner or host Jenkins, thus we have chosen Travis. The drawback to that is that we are stuck with their Ubuntu build environment and the outdated ROOT version in the repos.

The preferred solution would be a quick installing version of ROOT to setup the environment and execute test of the project and not waiting for the environment to be prepared.

I see. You may be able to use docker builds with the new ROOT container images on Ubuntu 16:

https://root.cern.ch/root-docker-container-alpha-version

The ROOT container has the last passing version of ROOT 6 from our Jenkins infrasctructure.

It is not clear to me how I can compile against a docker though. We are using CMake and the find_package macro will clearly have problems automatically determining that a docker has the libraries needed. Maybe someone has an example CMake file for a project that is dependent on a ROOT docker? Is this even possible?

In Gitlab you can use our image with image: rootproject/root-ubuntu16 in your .gitlab-ci.yml. Not sure how to do that in Travis CI, though.

Thanks, I will give that a try. I’m still a bit stuck with Travis CI at the moment.

Also, we have tried using the ROOT binaries, but there was a mismatch in the compiler version as we are using Ubuntu 14 with gcc 5.

Sorry for the bump, but just in case it’s useful, an example of using a docker image in Travis-CI here:

and the script that gets run in the container:

The containers use linuxbrew, but ROOT’s docker image should work just as well.

1 Like

Thanks for the info, I will see if your tips can help solve the issue. This means that for every job I will need to setup up a container and a separate script to be run?

Yes, Travis requires manual pull and run of the image/container as part of the setup steps, whilst this is a little awkward, speed is pretty good even with the multi-GB containers we have (certainly the time is dominated by the build/test of the project itself!). The script is really just convenience to avoid several docker exec commands. Not sure if that answers the question though?

Gitlab CI does seem easier for docker use as you just specify the image(s) needed for the job(s) and it takes care of pull/start and drops you into the running container.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

uhm…sorry for re-opening the thread, I’m just curious to know if it worked for you…?