Repository navigation
Build cache based on export pipeline (HMS-11233) - #2671
Conversation
aafa992 to
d5b8d28
Compare
There was a problem hiding this comment.
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!
|
Thank you! I fixed your comments, since we need another approval, and changes were quick, I dared to do changes after your approval! |
|
I've kicked the CI jobs. |
|
RHOS is getting really annoying |
|
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? |
ca5fd30 to
9c93666
Compare
|
Clicked rebase. This is going to trigger a lot of builds again. I'll check back on it later today. |
|
9c93666 to
d95b2dc
Compare
|
Another rebase for the KVM runners. |
|
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. |
|
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 If I run this on the branch, I see messages like this 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
left a comment
There was a problem hiding this comment.
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.
| return name | ||
| if image_type: | ||
| return EXPORT_PIPELINE_BY_IMAGE_TYPE.get(image_type) | ||
| return None |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
My suggestion would be to:
- Always have export pipelines as part of the image definition, so that the build request from
gen-manifestsalways includes anexport-pipelinefield. - 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.
d95b2dc to
ca5122c
Compare
Add export pipeline as part of build request structure and add it during the makeManifestJob when creating the build request.
ca5122c to
249dc80
Compare
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.
249dc80 to
db3499b
Compare
achilleas-k
left a comment
There was a problem hiding this comment.
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!
Use the image type's export pipeline when computing/validating cache entries instead of always using the last pipeline in the manifest.