Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: improve container image build times #277

Merged
merged 1 commit into from
Feb 15, 2025
Merged

Conversation

basti1302
Copy link
Member

No description provided.

@basti1302 basti1302 force-pushed the improve-build-times branch 5 times, most recently from 78cf6f7 to 4d9c3a1 Compare February 15, 2025 10:39
@basti1302 basti1302 marked this pull request as ready for review February 15, 2025 10:39
@basti1302 basti1302 enabled auto-merge (rebase) February 15, 2025 10:41
Essentially this adds --platform=${BUILDPLATFORM} to the FROM
instruction for the build stage. This makes that stage run on the
platform of the underlying machine instead running in the target
platform/architecture. We then let the Go compiler take care of
producing a binary for the target platform by setting GOARCH to
TARGETPLATFORM.

This massively speeds up multi-platform builds, as it removes the need
for emulation in the compilation phase.

Before, building all images for both platforms (x86_64 and arm64) on
cold caches via GitHub actions would take around 1:13 h, with individual
image build times roughly as follows:
- operator controller: 15 minutes
- instrumentation: 4 minutes
- collector: 37 minutes
- configuration reloader: 4 minutes
- filelog offset synch: 11 minutes

With this change, building all images for both platforms (x86_64 and
arm64) on cold caches via GitHub actions takes only 16 minutes, with
individual image build times roughly as follows:
- operator controller: 3 minutes
- instrumentation: 4 minutes
- collector: 6 minutes
- configuration reloader: 1 minute
- filelog offset synch: 2 minutes

Note: The instrumentation image is not yet migrated to this new
strategy.
@basti1302 basti1302 merged commit 9bb9fc0 into main Feb 15, 2025
11 checks passed
@basti1302 basti1302 deleted the improve-build-times branch February 15, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant