-
Notifications
You must be signed in to change notification settings - Fork 324
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.