-
Task
-
Resolution: Done
-
Normal
-
None
-
None
-
False
-
False
-
-
2
-
2022-Q3
Our docker builds take too long to finish because we build the same two containers over and over for each commit and PR. We can speed that up by caching the container using the GitHub Container Registry.
This should speed up significantly the build times for the container and the run times for them as well.
Currently, we use the containers for two things:
1) Testing (Both for coverage and normal testing)
2) Linting
And for each of them, we are building the same container that will be reused in each step. And in total, we are building the same container 6 times (We build the containers for CentOS 7 and CentOS 8).
Notes
- GitHub has an internal registry for open source projects that we can use to upload the final image.
- This image will only be refreshed if any layers from the build change, and considering that we don't change that often, it will be cached for a long time
- There is a mechanism in GitHub to refresh that manually.
- To know more about this, please refer to Working with the Docker registry.
Acceptance Criteria
- Split the container build to happen before the other checks, so we can build that and cache it right away
- Upload the final image to the GitHub Container Registry after the build
- Modify the actions for linting/testing to use the image in the registry instead of building a new one
- The image upload should be based on branch, if it's happening in the main branch, or the PR number if it's a PR.