Skip to content

Build cache based on export pipeline (HMS-11233) - #2671

Merged
supakeen merged 2 commits into
osbuild:mainfrom
avitova:cache-bootc
Sep 21, 2026
Merged

supakeen merged 2 commits into
osbuild:mainfrom
avitova:cache-bootc

Conversation

@avitova

@avitova avitova commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Use the image type's export pipeline when computing/validating cache entries instead of always using the last pipeline in the manifest.

@avitova
avitova requested review from a team, achilleas-k and thozza as code owners September 7, 2026 15:17
@avitova
avitova requested a review from supakeen September 7, 2026 15:17
@avitova
avitova force-pushed the cache-bootc branch 4 times, most recently from aafa992 to d5b8d28 Compare September 8, 2026 08:53
achilleas-k
achilleas-k previously approved these changes Sep 9, 2026

@achilleas-k achilleas-k left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thank you.

I'm going to approve this since it appears to be working but there's something missing here. I'm looking at the files in the cache from the S3 bucket and I'm seeing a lot of info.json files with "export-pipeline": null. I suppose this means that the resolve_export_pipeline() call in upload_results() is reaching the final fallback state where it returns None. It's not causing problems because the check_for_build() function only looks at export pipeline names if it's set in the build info. I'd like to see if we could (in a follow-up) change things to always have the export pipeline names when we need them and always include them in the build info. But for now it's fine as it is.

And a small note for the future: @supakeen started work towards having multiple exports. We might have to generalise this solution at some point. It might be as simple as putting all the export pipelines in the build request and combining them to form the manifest ID (e.g. the ID of a manifest with multiple exports could be a concatenation or hash of the pipeline IDs), we'll see.

LGTM!

Comment thread test/scripts/imgtestlib/core.py Resolved
Comment thread test/scripts/imgtestlib/build.py Resolved
Comment thread test/scripts/imgtestlib/core.py Resolved
@avitova

avitova commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Thank you! I fixed your comments, since we need another approval, and changes were quick, I dared to do changes after your approval!

supakeen
supakeen previously approved these changes Sep 11, 2026
@supakeen
supakeen enabled auto-merge September 11, 2026 09:14
@supakeen

Copy link
Copy Markdown
Member

I've kicked the CI jobs.

@achilleas-k

Copy link
Copy Markdown
Member

RHOS is getting really annoying

@avitova

avitova commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Well I supposed failures are not relevant, but after this run, I will look into logs, maybe the last change broke something?

@achilleas-k

Copy link
Copy Markdown
Member

Well I supposed failures are not relevant, but after this run, I will look into logs, maybe the last change broke something?

Did you see any failures that weren't infra capacity issues?

@achilleas-k

Copy link
Copy Markdown
Member

Clicked rebase. This is going to trigger a lot of builds again. I'll check back on it later today.

@achilleas-k

Copy link
Copy Markdown
Member

RHOS is getting really annoying

#2689

@achilleas-k

Copy link
Copy Markdown
Member

Another rebase for the KVM runners.

@supakeen
supakeen added this pull request to the merge queue Sep 16, 2026
@achilleas-k
achilleas-k removed this pull request from the merge queue due to a manual request Sep 16, 2026
@achilleas-k

Copy link
Copy Markdown
Member

I removed it from the queue. I noticed that it was rebuilding everything on the merge queue even though it shouldn't. I think the export-pipeline check isn't totally correct and it cause every image to be added to the config to be built.

@achilleas-k

Copy link
Copy Markdown
Member

FYI, if you have AWS credentials with access to the bucket (under the 438669297788 account), you can verify the behaviour quite easily with something like

./test/scripts/generate-build-config --distro centos-10 --arch x86_64 config.yaml

If I run this on the branch, I see messages like this

  Manifest centos_10-x86_64-container-empty.json was successfully built in commit 72e60262a714f74943defb24b5cb1b15612a6521
  https://github.com/osbuild/images/commit/72e60262a714f74943defb24b5cb1b15612a6521
  This commit was on a merge queue: gh-readonly-queue/main/pr-2671-5809a0e36f75edda6010490281b5856095241238
  Cached build info missing export-pipeline
  Adding config to build pipeline.

Which tells me that the image was built in the pipeline for the merge queue for this PR, but the export pipeline wasn't saved to the build info when it was done.

I thought I had verified this already but maybe I missed something.

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm requesting changes here because if we merge it I think we're going to have caching issues. Something's not 100% right with the logic here I think.

Comment thread test/scripts/imgtestlib/build.py Outdated
return name
if image_type:
return EXPORT_PIPELINE_BY_IMAGE_TYPE.get(image_type)
return None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the source of the problem is this. This gets called by the upload_results() function and if we return null in some cases, then we end up writing that to the info.json for a build. Then if a build request includes the export pipeline, it will never match and the image will always be built.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion would be to:

  • Always have export pipelines as part of the image definition, so that the build request from gen-manifests always includes an export-pipeline field.
  • Never try to guess the pipeline name but always take it from the build request and write it to info.json directly from the build request.

Add export pipeline as part of build request structure and add it during
the makeManifestJob when creating the build request.
Use the image type's export pipeline when computing/validating cache
entries instead of always using the last pipeline in the manifest.

Cache lookups now require a field "export-pipeline", which should fix
cache misses.

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work. I've confirmed that this works as expected now.
Needing to pass the export-pipeline around isn't the prettiest solution, but it works.

Thank you. LGTM!

@achilleas-k
achilleas-k added this pull request to the merge queue Sep 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Sep 21, 2026
@supakeen
supakeen added this pull request to the merge queue Sep 21, 2026
Merged via the queue into osbuild:main with commit b28a589 Sep 21, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants