-
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
Include osbuild NEVRA in build info path for test cache #432
Conversation
6bf9491
to
a4f46b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoiding unnecessary builds - yay! 💖
The logic is sound and the path construction in the code looks plausible!
Please correct me if I'm wrong, but we may end up not rebuilding images if the osbuild commit SHA is updated to a newer version, but that version still has the same NEVRA as the current commit SHA (e.g. both are from |
The RPMs we build for unreleased versions of osbuild contain the short-SHA in their NEVRA, so this shouldn't be an issue. I believe this comes automatically from the
|
Returns the installed rpm version for osbuild.
Helper functions for generating paths will help us avoid inconsistencies when changing the way we create or look up paths for build metadata.
Until now, the following scenario would produce unnecessary rebuilds: - A PR is opened that updates osbuild in `Schutzfile` to `vNew`. - A manifest is generated with id `abc123`. - The build info lookup for `abc123` shows that it was built with `vOld` so it's added to the test matrix. - The new build info is uploaded showing `abc123` was built with `vNew`. - A different PR runs CI with `vOld` (before the update PR is merged or before this PR is rebased). - A manifest is generated with id `abc123` again. - The build info lookup for `abc123` shows that it was built with `vNew` (in the osbuild update PR) but the currently installed version is `vOld` (`!= vNew`) so it's added to the test matrix. - The new build info is uploaded showing `abc123` was built with `vOld`. This commit changes the build info paths to include the osbuild package version (NEVRA) as a path component: s3://images-ci-cache/images/builds/fedora-40/aarch64/osbuild-104-1.fc39.noarch/abc123 The build filter now no longer needs to read the osbuild commit ID from the info.json and compare with the current one. It can simply check the path with the package version component and if it is not found, the new configuration will be tested.
Test the path generators with a mocked get_osbuild_nevra() function so that they can be run without osbuild installed and on non-rpm based systems.
a4f46b7
to
ed75a0b
Compare
Funny. The
Probably a mock thing, right? |
I don't think so... Are you sure that the date is correct on the host which builds the RPM? 🤔 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This gets even weirder. Here's an example build log: https://gitlab.com/redhat/services/products/image-builder/ci/osbuild/-/jobs/6131776245 Mock start with
Date is correct! Then ends with
Date still correct. But:
Date changes during |
AH WAIT. I see it now. It's the last date in the |
Until now, the following scenario would produce unnecessary rebuilds:
Schutzfile
tovNew
.abc123
.abc123
shows that it was built withvOld
so it's added to the test matrix.abc123
was built withvNew
.vOld
(before the update PR is merged or before this PR is rebased).abc123
again.abc123
shows that it was built withvNew
(in the osbuild update PR) but the currently installed version isvOld
(!= vNew
) so it's added to the test matrix.abc123
was built withvOld
.This doesn't just create an unnecessary rebuild, but can create a situation where every image is rebuilt multiple times a day if the two PRs keep getting amended, essentially fighting each other by changing the commit ID back and forth.
This commit changes the build info paths to include the osbuild package version (NEVRA) as a path component:
The build filter now no longer needs to read the osbuild commit ID from the info.json and compare with the current one. It can simply check the path with the package version component and if it is not found, the new configuration will be tested.
Note that this PR will of course create a mass rebuild of all the images. All PRs should be rebased on this when it's merged to avoid pushing images and build info to the old paths.
The old paths should be cleaned up by the bucket retention policy in a few days.