-
Notifications
You must be signed in to change notification settings - Fork 50
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
CI test caching only stores most recently tested BIB hash causing repeat builds #594
Comments
achilleas-k
added a commit
to achilleas-k/images
that referenced
this issue
Apr 15, 2024
On successful boot, save the bootc-image-builder image ID as a separate (empty) file so we can save the boot success of multiple images and avoid unnecessary rebuilds. See osbuild#594
Merged
achilleas-k
added a commit
to achilleas-k/images
that referenced
this issue
Apr 15, 2024
On successful boot, save the bootc-image-builder image ID as a separate (empty) file so we can save the boot success of multiple images and avoid unnecessary rebuilds. See osbuild#594
achilleas-k
added a commit
to achilleas-k/images
that referenced
this issue
Apr 15, 2024
On successful boot, save the bootc-image-builder image ID as a separate (empty) file so we can save the boot success of multiple images and avoid unnecessary rebuilds. See osbuild#594
achilleas-k
added a commit
to achilleas-k/images
that referenced
this issue
Apr 16, 2024
On successful boot, save the bootc-image-builder image ID as a separate (empty) file so we can save the boot success of multiple images and avoid unnecessary rebuilds. See osbuild#594
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 16, 2024
On successful boot, save the bootc-image-builder image ID as a separate (empty) file so we can save the boot success of multiple images and avoid unnecessary rebuilds. See #594
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The CI cache is used to decide if an image should be rebuilt in testing based on whether the image definition or one of the test dependencies has changed. The following items are considered:
The decision is made in the
check_for_build()
function:images/test/scripts/imgtestlib.py
Line 246 in 5ecb18e
The manifest ID and osbuild version are part of the path of the cached results, so any change in one of those elements creates a new entry in the cache directory tree, keeping the old result intact.
However, the bootc-image-builder container ID is only part of the metadata in the
info.json
file for each entry. This means that the following sequence of events can occur and cause unnecessary rebuilds:<distro>/<arch>/<osbuild-version>/<manifest-id>
and theinfo.json
contains"bib-id": "sha256:aaaa"
.sha256:bbbb
doesn't match the one ininfo.json
and rebuilds the image and boot tests it.<distro>/<arch>/<osbuild-version>/<manifest-id>/info.json
is updated and now contains"bib-id": "sha256:bbbb"
.main
branch. The CI run finds the cache entry, sees that the bib ID,sha256:aaaa
doesn't match the one ininfo.json
and rebuilds the image and boot tests it.<distro>/<arch>/<osbuild-version>/<manifest-id>/info.json
is updated and now contains"bib-id": "sha256:aaaa"
again.sha256:bbbb
.Slightly different sequences of events and more PRs can cause more rebuilds, but this demonstrates a simple version of the issue.
A quick solution would be to include the bib ID in the path like we do with the osbuild version, but only a single image type depends on this in testing, so it wouldn't make sense in other cases.
Another solution would be to separate the bib metadata so we could have:
<distro>/<arch>/<osbuild-version>/<manifest-id>/info.json
<distro>/<arch>/<osbuild-version>/<manifest-id>/bib-aaaa.json
: with content{"boot-success": true}
<distro>/<arch>/<osbuild-version>/<manifest-id>/bib-bbbb.json
: with content{"boot-success": true}
Also, we could be a bit smarter with what we test. If the manifest ID and osbuild version haven't changed, and all we need to do is boot test the image, we could download the image itself from the cache instead of rebuilding it and only run the boot test.
The text was updated successfully, but these errors were encountered: