-
Notifications
You must be signed in to change notification settings - Fork 241
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
Support buildx for amd64 and arm64 builds (#766) #870
Conversation
Codecov Report
@@ Coverage Diff @@
## main #870 +/- ##
=======================================
Coverage 50.38% 50.38%
=======================================
Files 11 11
Lines 385 385
=======================================
Hits 194 194
Misses 175 175
Partials 16 16 Continue to review full report at Codecov.
|
Wouldn't it be simpler to add arm64 support after #860 gets merged in? Could just add it to the platforms https://github.com/docker/build-push-action/blob/master/docs/advanced/multi-platform.md |
Merge aws-observability/aws-otel-test-framework#480 first |
From @jefchien and I spoke on slack that this will require these changes to the dockerfile |
0e6ce52
to
a3a7004
Compare
24f1803
to
40a4d9d
Compare
40a4d9d
to
4c8b0ee
Compare
eda5f29
to
2c8c86e
Compare
################################ | ||
FROM alpine:latest as build | ||
|
||
ENV GOPROXY=direct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will take over 1hr to run since no go proxy is used.
657f148
to
34009b8
Compare
.github/workflows/CI.yml
Outdated
@@ -485,6 +485,9 @@ jobs: | |||
aws-secret-access-key: ${{ secrets.INTEG_TEST_AWS_KEY_SECRET }} | |||
aws-region: us-west-2 | |||
|
|||
- name: Set up QEMU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required for multi arc according to docs
78f805c
to
a4c752d
Compare
a4c752d
to
ff8d7c6
Compare
@@ -0,0 +1,13 @@ | |||
#!/bin/sh | |||
BINARY=aoc_linux_x86_64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit I would probably output the same aoc_linux
binary into a folder with the platform, just to reduce moving parts (renaming files).
Even better could be just awscollector
perhaps since that's what we end up renaming to anyways. Results in less names to deal with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that was for backward compatibility in the make file. Any sort of backwards not compatible change we should have a meeting just to discuss that. Or I can just make more make commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COPY --from=build /workspace/config/ecs/otel-instance-metrics-config.yaml /etc/ecs/otel-instance-metrics-config.yaml | ||
COPY --from=build /workspace/config/apprunner/apprunner-default-config.yaml /etc/apprunner/apprunner-default-config.yaml | ||
COPY --from=build /workspace/build/linux/aoc_linux /awscollector | ||
COPY config.yaml /etc/otel-config.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future PR it would be good to redo the folder structure in this repo to allow just one glob COPY command to copy in all the configs to reduce this maintenance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will create an issue for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ff8d7c6
to
d0c35b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need to change the CD as well or will retagging pull all platforms?
Will need to copy multiple platforms since the local image cache can only store a single architecture per image. |
d0c35b5
to
ee6ecf1
Compare
@khanhntd it seems you use https://github.com/akhilerm/tag-push-action this should support multi platform out of box according to their docs |
Description:
Support Buildx for amd64 and arm64 builds
Link to tracking Issue:
#766
Testing:
(Make creates binaries)
make docker-build
make docker-build-arm
(With binary not created -takes a very long time since it requires go mod download-)
docker buildx build --platform linux/amd64 -t amazon/awscollector:v0.15.0 -f ./cmd/awscollector/Dockerfile .
docker buildx build --platform linux/arm64 -t amazon/awscollector:v0.15.0 -f ./cmd/awscollector/Dockerfile .
(defaults to amd64)
docker build -t amazon/awscollector:latest -f ./cmd/awscollector/Dockerfile .