Skip to content
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

Build process and caching improvements #414

Merged
merged 29 commits into from
Jun 15, 2018
Merged

Build process and caching improvements #414

merged 29 commits into from
Jun 15, 2018

Conversation

GUI
Copy link
Member

@GUI GUI commented Jun 15, 2018

This is something of a followup to #409 But this focuses more on improving the build process with caching for our CI environment and Docker development environments in mind.

While this still not be the best approach to building all our dependencies, I think it's a bit cleaner than before, and the caching improvements reduce test run times in our CI environment by around 8 minutes. It will also make for lighter-weight Docker development environments, since we can clean out unnecessary, intermediate build files.

The underlying changes here shift us away from using CMake and switch to some bash shell scripts for handling building our dependencies. While we had used CMake due to it's ExternalProject support, which seemed to fit well with our need to build various external dependencies (like OpenResty, and rsyslog), it turned out that more of our build process was shell scripts inside CMake commands (since we're not really compiling anything our selves), so it became a bit cumbersome and in the end, I don't think we gained much from what CMake can normally do. Furthermore, with the way we were caching build files for the CI environment and Docker development images, CMake's approach forced us to cache all the intermediate build files, which significantly increased the amount of duplicate data needing to be cached (and thus sped up the builds).

So the change here mostly translates the existing shell commands that were embedded in the CMake scripts into standalone shell scripts. Our trick to improve caching for the CI and development environment is to use go-task (via a normal Makefile, so everything still acts the same), which has checksum-based caching built-in, so we can more easily skip tasks unless the checksum changes (checksums are a bit easier than relying on file timestamps, which is why we used this over just straight make). And again, this may not be the most ideal build setup, but it seems a bit easier to wrangle than before.

In the end, the build process is still the same for users, though, following the standard ./configure && make && make install pattern.

GUI added 29 commits June 10, 2018 00:01
Due to changes in the lint task, we're now testing more Ruby files that
we had previously missed.
Disable the unused variable checks in helpers.sh, since these variables
might be used in scripts  that source helpers.sh.
If the "core" task was modified but the admin-ui and web-app's caches
were cleared, then the core task could fail to load. Persist the core's
dependencies, so the core task can run successfully in the CI
environment, even if the other normal build files are cleared.
Just to better tidy things up as we shift most of the scripts into
./tasks.
@GUI GUI merged commit 8bb301c into master Jun 15, 2018
@GUI GUI deleted the build-caching branch June 15, 2018 04:23
@GUI GUI added this to the v0.15.0 milestone May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant