Add multi-platform container builds for amd64 and arm64#985
Add multi-platform container builds for amd64 and arm64#985pditommaso wants to merge 18 commits intomasterfrom
Conversation
Refactor ContainerPlatform to support multi-arch builds natively, replacing MultiContainerPlatform with a unified model. Fan out security scans per architecture since Trivy only accepts a single --platform flag. Key changes: - Consolidate ContainerPlatform to handle both single and multi-arch - Add ScanIds helper for encoding/decoding per-platform scan IDs - Fan out scans in ContainerScanServiceImpl per architecture - Add BuildRequest.withScanId() for propagating multi-scan IDs - Update views and email templates for per-arch scan links - Poll all per-arch scans in ContainerStatusServiceImpl - Extract ScanIds.populateScanBinding() to DRY scan binding logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ildIds field - Create ChildEntries as a shared value type for encoding/decoding per-platform child IDs (builds and scans), with Jackson serialization support - Stop overloading scanId with multi-platform encoded IDs; add dedicated scanChildIds field to BuildRequest, ContainerRequest, WaveBuildRecord, and WaveContainerRecord - Change buildChildIds from String to ChildEntries type across all data classes - Remove scan/build child entries and scan info from mail notifications - Delete ScanIds utility class and its tests, replaced by ChildEntries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove dead `withScanId()` method from BuildRequest - Add explicit `= null` initialization for scanChildIds in ContainerController - Fix pre-existing bug: `this.mirror == that.mirror` → `=` in WaveContainerRecord copy constructor - Rename mismatched getter `getChildScanIds()` → `getScanChildIds()` in ContainerRequest - Add Jackson round-trip serialization tests for ChildEntries Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add @JsonCreator/@jsonvalue to ContainerPlatform for proper serialization in persistence records (fixes mirror record tests) - Add missing getScanId() stubs to ScanEntry mocks in ContainerStatusServiceTest (scanResult uses scan.scanId not request.scanId for URL) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace separate os/arch/variant/archs fields with a List<Platform> to properly model multi-platform combinations where each platform can have its own OS. Move parsing logic into Platform.of() static factory method. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove the boolean multiPlatform field from SubmitContainerTokenRequest. Multi-platform builds are now triggered by specifying a multi-arch containerPlatform value (e.g. "linux/amd64,linux/arm64"). Add validation that only the linux/amd64+arm64 pair is currently allowed. Add @JsonPropertyOrder to BuildRequest to fix CI field ordering. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChildEntries no longer extends ArrayList — it wraps a List<Entry> field that Moshi can serialize/deserialize correctly through BuildStateStore. Replace Jackson-based tests with Moshi roundtrip tests using the same MoshiEncodeStrategy as production. Remove unused @JsonPropertyOrder from BuildRequest. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@munishchouhan when you have some capacity, it would be useful to stress this a bit to make sure there no regression.
|
# Conflicts: # src/test/groovy/io/seqera/wave/service/persistence/impl/SurrealPersistenceServiceTest.groovy
Add ContainerPlatform.validateSinglePlatform() helper and use it in InspectController to prevent comma-separated platform values (e.g. linux/amd64,linux/arm64) which should only be allowed for container build requests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
When containerPlatform is multi-arch, the resolution process now augments each matching platform manifest in the image index with correctly filtered arch-specific fusion layers (amd64 gets fusion-amd64.tar.gz, arm64 gets fusion-arm64.tar.gz). Key changes: - Add resolveImageIndex() and augmentManifest() to handle per-platform augmentation with arch-specific layer filtering - Add AugmentedManifest class replacing Tuple2<String, Integer> - Move matches() from ContainerPlatform to Platform inner class - Guard ContainerPlatform.os/arch/variant with exception on multi-arch - Move skip-cache setting from debug flag to BuildConfig (default false) - Fix body.bytes double computation in ManifestAssembler Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Multi-arch augmentation and Fusion layer filteringProblemWhen Additionally, fusion layers were not filtered by architecture — both SolutionMulti-arch augmentation (
Fusion layer filtering (
Platform matching (
Other improvements
ResultEach platform in a multi-arch image index now gets augmented with the correct arch-specific fusion layers: amd64 manifests receive |
Summary
linux/amd64andlinux/arm64architecturescontainerPlatformvalue (e.g.linux/amd64,linux/arm64) — the previousmultiPlatformboolean flag has been removedContainerPlatform.Platforminner class to properly model per-platform{os, arch, variant}tuples instead of a shared OS with a list of bare arch namesChildRefsvalue type to track per-platform child build and scan IDs with proper Moshi serializationMultiPlatformBuildServiceorchestrates parallel per-arch builds and assembles an OCI image index (manifest list)Test plan
ContainerPlatformTest— single/multi-arch parsing, round-trip, equality, matchingContainerControllerTest— multi-platform validation and request handlingChildEntriesTest— encoding, round-trip, Jackson serialization, template bindingBuildRequestTest— Jackson serialization with child entriesContainerScanServiceImplTest— multi-platform scan fan-out🤖 Generated with Claude Code