Store RHEL8 image layer cache in GHCR instead of the Actions cache - #14358
Merged
Conversation
The nightly image build has failed since 2026-07-23 with "failed to solve: not_found" while exporting the BuildKit layer cache, because the repository's GitHub Actions cache is at the 10 GB limit and entries are evicted as fast as they are written (0% cache hit rate on restore). Use a registry cache (ci-rhel8:buildcache in GHCR) instead, which has no size cap, and exclude the buildcache tag from the daily image cleanup. Make the cache effective across nightly rebuilds: key the vcpkg stage on its actual inputs (vcpkg.json, the vcpkg configuration and the vcpkg tool) with a direct manifest install instead of copying the entire build context, and exclude .git from the Docker build context since its internals differ between checkouts of the same commit and invalidated 'COPY . /src' on every run. Nightly builds now reuse the compiled vcpkg ports from the layer cache and only recompile the ResInsight warmup stage.
magnesj
force-pushed
the
rhel8-image-registry-cache
branch
from
July 27, 2026 13:38
82a96db to
044029a
Compare
This file contains hidden or 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
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.
The nightly "Build RHEL8 CI Image" workflow has failed every night since 2026-07-23 (on both OPM/ResInsight and forks) with:
The image itself builds and pushes to GHCR successfully — only the final
cache-to: type=gha,mode=maxexport fails, marking the run red.Root cause: the repository's Actions cache is at the 10 GB per-repo limit (10.4 GB on OPM/ResInsight), shared with all other workflows. The multi-GB BuildKit export is evicted as fast as it is written, which both breaks the export commit (
not_found) and makes restores useless — the build log shows a 0% cache hit rate, so every nightly run did the full cold compile.Changes:
ci-rhel8:buildcache), which has no size cap. The existing${GITHUB_REPOSITORY,,}image-name pattern makes this work unchanged on upstream and forks. Thebuildcachetag is excluded from the daily image-version cleanup, alongsidelatest.vcpkg.json, the vcpkg configuration and the vcpkg tool, and runs a direct manifest install..gitis excluded from the Docker build context. Its internals differ between checkouts of the same commit, which silently invalidatedCOPY . /srcon every run. The in-image build does not need it (the CMake submodule init is guarded byEXISTS .git).Verified on magnesj/ResInsight:
Restored 101 package(s) from /opt/vcpkg-cache, confirming the ABI hashes from the direct manifest install match the CMake-driven configure.vcpkg-builderstage isCACHEDfrom the registry cache; only the build-warmup stage recompiles. This is the nightly scenario — the ~1 h vcpkg portion is eliminated and the cache export no longer fails.