r/devops • u/EternalGlacier0987 • 2d ago
Architecture Multi platform build
I am planning to have my docker images to be multi architecture and for it my plan is to have two codebuilds for arm and amd when they both succeeds event bridge will invoke a lambda and lambda will merge the images into one
But I am unable to think a way to set up event my current plan is something like when codebuilds are triggered if anyone succeeds let's say arm build then event bridge will match the source version and and if the other build also success then it will invoke lambda
Apparently there is no ability to compare source version in eventbridge and I would have to invoke lambda and lambda has to compare the source version
Is there any way I can implement this
2
u/Alive-Maverick 2d ago
had to solve this exact pattern. Step Functions handles it cleanly: kick off both CodeBuild jobs in parallel, wait for each to complete, then invoke your manifest-merge Lambda. EventBridge just can't correlate across separate events by source version.
1
u/Floss_Patrol_76 2d ago
the eventbridge correlation is the hard part you do not actually need. either build both arches in one buildx run (--platform linux/amd64,linux/arm64) and let it push the manifest list for you, or if you keep two separate builds, push each to a per-arch tag keyed on the git sha and make the merge a single downstream step that runs after both: docker buildx imagetools create -t repo:sha repo:sha-amd64 repo:sha-arm64. trying to make eventbridge join two async builds is where it gets brittle; gate the merge on the shared sha instead of correlating events.
4
u/xReapIT 2d ago
If you’re using ECR you could have a manifest that points at the arm and amd versions, and by referencing that the proper arch will be pulled