Add multi-platform container builds for amd64 and arm64#985
Open
pditommaso wants to merge 16 commits intomasterfrom
Open
Add multi-platform container builds for amd64 and arm64#985pditommaso wants to merge 16 commits intomasterfrom
pditommaso wants to merge 16 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>
5 tasks
- 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>
Collaborator
Author
|
@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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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