history: finalize export records on their owning node#3716
history: finalize export records on their owning node#3716tonistiigi merged 4 commits intodocker:masterfrom
Conversation
|
Hum still fails, looking at the logs: https://github.com/docker/buildx/actions/runs/22947651040/job/66604243143?pr=3716#step:9:321
|
bfa30ad to
7b2fc84
Compare
7b2fc84 to
c08d761
Compare
c08d761 to
546ef34
Compare
b8b84bf to
a3f74ef
Compare
9bf67d2 to
ba2f865
Compare
51f5b32 to
3a4686a
Compare
31ed9f1 to
be4a2c2
Compare
33926f5 to
3675c74
Compare
5095d06 to
e0b8929
Compare
8b1bba8 to
3fc8c06
Compare
3fc8c06 to
363853f
Compare
commands/history/export.go
Outdated
| return errors.Errorf("no record found for ref %q", ref) | ||
| } | ||
|
|
||
| selected := recs |
There was a problem hiding this comment.
selected -> toExport
prefixLen -> recCount
commands/history/export.go
Outdated
| return b.CreatedAt.AsTime().Compare(a.CreatedAt.AsTime()) | ||
| }) | ||
| if len(selected) > 1 { | ||
| // A logical build ref can appear once per node. Keep one candidate |
There was a problem hiding this comment.
Not sure I understand this. Multi-node build still has two separate history records with different data. If you are dropping one node here, the data from another node still gets dropped from the export.
There was a problem hiding this comment.
Ah yes you're right, I was treating duplicate refs as alternative candidates for the same logical record, but bundle.Export does not merge them. It exports one manifest per input record.
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
363853f to
5245d50
Compare
needs #3724fixes docker/build-push-action#1388
closes #3344
closes docker/build-push-action#1392
closes docker/bake-action#336
This fixes
history export --finalizefor multi-node builders such as the Kubernetes driver.The failure happens when the same logical build ref appears more than once in history, once per node, and export finalization is not applied to the node that owns the selected record. In that case Buildx can later try to export a record whose trace descriptor is still not readable and fail with
NotFoundwhile loading the trace descriptor:This keeps the existing finalize behavior for records that do not yet expose a trace descriptor, but changes finalization to follow record ownership. Buildx now deduplicates selected records by (ref, node), sends finalize to the owning node for each selected record, re-queries records before export, and collapses duplicate per-node entries down to one logical record per ref.
It also fixes bundle export to use all available node content stores instead of stopping at the first one. That allows the exported records to resolve their referenced content correctly across multi-node builders during archive creation.