Make as many as possible containers run native on Apple Silicon #1594
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.
This PR improves build/runtime on Apple Silicon by using as much as possible native containers images for ARM.
Building
Clean build:
darwin/amd64
(core i5, native)time make build-no-cache
:339.94s
darwin/amd64
(m4, emulated)time DOCKER_DEFAULT_PLATFORM=linux/amd64 make build-no-cache
:584.05s
darwin/arm64
(m4, native+emulated)time make build-no-cache
:600.39s
darwin/arm64
(m1, native+emulated)time make build-no-cache
:917.0s
Cached rebuild:
darwin/amd64
(core i5, native)make build; time make build
:36.16s
darwin/amd64
(m4, emulated)DOCKER_DEFAULT_PLATFORM=linux/amd64 make build; time DOCKER_DEFAULT_PLATFORM=linux/amd64 make build
:5.92s
darwin/arm64
(m4, native+emulated)make build; time make build
:6.08s
darwin/arm64
(m1, native+emulated)make build; time make build
:10.73s
Testing
darwin/amd64 (core i5, native)
make up env=test; time make integration-tests
:77 passed, 12 skipped, 36 warnings in 63.31s (0:01:03)
, total time:67.74s
darwin/amd64 (m4, emulated)
DOCKER_DEFAULT_PLATFORM=linux/amd64 make up env=test; time make integration-tests
77 passed, 12 skipped, 36 warnings in 113.53s (0:01:53)
, total time:116.83s
darwin/arm64 (m4, native+emulated)
make up env=test; time make integration-tests
:77 passed, 12 skipped, 36 warnings in 41.95s
, total time:44.96s
darwin/arm64 (m1, native+emulated)
make up env=test; time make integration-tests
:77 passed, 12 skipped, 36 warnings in 48.78s
, total time:52.18s
Notes
Verify container architecture:
docker ps -q | xargs -I% -n1 docker exec -i % arch
Forcing
amd64
(RELEASE=main
asutil
image is not available aslatest
:DOCKER_DEFAULT_PLATFORM=linux/amd64 RELEASE=main make up env=test