-
Notifications
You must be signed in to change notification settings - Fork 273
Increase parallelism in Travis builds #2047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
IMO this is not better than the random scattering of options (e.g. per the matrix suggested in #1706). I believe this changes not knowing precisely which variant flag causes the problem (around ~6 options) to not knowing precisely which PR caused the problem (~3/day). However, I think it is easier to try different options (easy to turn on flags locally on your PR, easy to compile with make rather than cmake) than check out each of the PRs. Further, this allows broken stuff to get merged. There then ends up being a lag in getting it fixed, and for that duration more PRs can break the configuration that doesn't work. |
.travis.yml
Outdated
@@ -173,12 +203,19 @@ jobs: | |||
- libstdc++-5-dev | |||
- libubsan0 | |||
before_install: | |||
- | | |||
if [[ "${TRAVIS_EVENT_TYPE}" != "cron" ]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do better, not starting the job at all, like https://docs.travis-ci.com/user/conditional-builds-stages-jobs/#Conditional-Builds
@thk123 my take is the matrix is actually quite large: roughly 2 OSes x 2 compilers x 2 build systems x 2^5 (or so) flag combinations. By scattering the flags around the different configs we effectively randomly sample the matrix, testing <linux, g++, !USE_DSTRING>, <osx, clang, SUB_IS_LIST>, <linux, g++, USE_GLUCOSE>, ... Contrast the solution proposed by this PR: we use all the most common entries in the matrix at PR time. In either case we're missing some matrix cells which are untested and so may break. There's not much getting around that unless you're willing to do 2^8 or so builds per PR. The question is, what configurations do we most care about not breaking? I'd say surely vanilla configs, as these are most likely to be used by new / inexperienced users. As to tracking down how we broke it: |
Incidentally if you want to include other particular configs in the every-PR build then fair enough -- but this allows the weekly job to check <osx, clang, !USE_DSTRING, NDEBUG, SUB_IS_LIST>, which is obviously never tested at present. |
Does anyone know how many jobs Travis will run concurrently within a stage? Assuming all the builds of various configurations take roughly the same amount of time we could run a lot of them, as long as they execute concurrently. Edit: I think we are wasting a lot of available time in the first stage (actually n-1 slots, all waiting on this one job). Let me try to work on this. |
This is bounded by our willingness to burn cash I suspect ;) |
Out-of-band conversation: it seems 5 or 10 concurrent builds should be within the current limits. I'll tweak the configuration accordingly. |
11c5c24
to
a190e47
Compare
This should now be ready for further discussion and/or another review. Note that I have updated the description of the pull request at the top - it used to be about doing (more) cron builds, which now isn't being changed; instead, more parallelism is introduced. |
Tests are run, otherwise using the very same configuration as the primary build, in the second stage. As all tasks within one stage run in parallel, the ~20mins that test execution takes will pass while also doing other work rather than blocking progress to the next stage. Via ccache we will avoid spending time for re-building.
Test configuration options in parallel rather than combining them to make diagnosing problems easier. Don't squash the build matrix as diffblue#1706 suggested earlier. Fixes: diffblue#1706
We can run up to 10 jobs in parallel - make use of that!
before_install: | ||
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc | ||
- HOMEBREW_NO_AUTO_UPDATE=1 brew install ccache parallel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need to install parallel
here, as that's only used for tests.
# env: COMPILER=clang++-3.7 SAN_FLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined,integer -fno-omit-frame-pointer" | ||
env: | ||
- COMPILER="ccache /usr/bin/clang++-3.7" | ||
- EXTRA_CXXFLAGS="-Qunused-arguments -fcolor-diagnostics -DNDEBUG" | ||
- CCACHE_CPP2=yes | ||
|
||
# Ubuntu Linux with glibc using clang++-3.7, debug mode, disable USE_DSTRING | ||
# Ubuntu Linux with glibc using clang++-3.7, debug mode | ||
- stage: Test different OS/CXX/Flags |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these 'build only' tests (i.e. the debug builds) be either moved into the first stage (i.e. builds), or positioned into a third 'debug builds' stage? I don't have a strong opinion, but thought it was worth us making an explicit decision.
packages: | ||
- libwww-perl | ||
- g++-5 | ||
- libubsan0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is libubsan0 actually needed for this build, is it a hangover from when we used to have sanitizer builds? (ditto for elsewhere in this file as well)
env: | ||
- NAME="USE_STD_STRING" | ||
- COMPILER="ccache /usr/bin/g++-5" | ||
- EXTRA_CXXFLAGS="-D_GLIBCXX_DEBUG -DUSE_STD_STRING" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, the USE_STD_STRING builds were not running tests, with this patch hunk they will now be running tests (which appear to fail) - is this an intentional change? If so, we need the tests and/or USE_STD_STRING fixed before merging. :-)
Closing as most CI tasks are nowadays performed via GitHub actions. |
Rarely used configuration options (aka preprocessor defines) that are notgenerally used in production settings can safely be tested at cron-defined
intervals only rather than upon every PR/change to a PR.
The remaining non-cron builds are: {GCC, Clang} x {Linux, OS X} +CMake/GCC/Linux.
The changes proposed here break up large build+test tasks into separate steps so that as much work as possible can be done in parallel, resulting in failures being reported as soon as possible.