-
Notifications
You must be signed in to change notification settings - Fork 81
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
Fix test setup to run on ARM instances #3904
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
cc15fe3
Fix test setup to run on ARM instances
michel-laterman aa6b460
Change arg to TARGETARCH
michel-laterman 2e9427f
Merge branch 'main' into arm-test-fix
michel-laterman 608a7cc
Change DOCKERARCH to SUFFIX, change to main-debian11
michel-laterman fb415f5
Merge branch 'main' into arm-test-fix
michel-laterman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Speaking as someone seeing this for the first time, the fact that
ARCH
can bemain
is very surprising. Can we not use the built-inTARGETARCH
and usemain
in the Dockerfile if the value isamd64
?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.
Or not use the built-in
TARGETARCH
arg at all, as it seems misused in this case. UseGO_ARCH
(in line withGO_VERSION
) or another arbitrary name?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.
The
main
arch seems a bit weird actually...@michel-laterman Does this come from some quirk on golang-crossbuild docker tags?
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.
yep, it's defined in the crossbuild readme
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.
Please see elastic/golang-crossbuild#446.
I recommend using the
Debian-X
version in the name of the Docker image tag. This might help with reproducibility.That's how it's also done in Beats, see elastic/beats#34921
However in Elastic Agent -> https://github.com/elastic/elastic-agent/blob/d99b09b0769f6f34428321eedb00c0b4339c202b/dev-tools/mage/crossbuild.go#L243-L246 , I don't know the build system but it looks weird to me they use
debian-8
butdebian-10
in Beats.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.
I wanted to use TARGETARCH, because it lets us actually build a multiplatform image. But it looks like there isn't a way to conditionally use
main
in the crossbuild image tag based on this. It'd be best if the crossbuild image was multiplatform as well - then this would be completely transparent, and we'd just dodocker buildx build --platform=...
in the Makefile.But as this cannot be done, I'm ok with the previous approach of using a custom variable here.
Incidentally, what are the chances of making the crossbuild image multiplatform?
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.
@v1v is there a specific reason why
main
is used instead of x86/amd64 ? I see the list of the images in golang-crossbuild README and themain
arch sticks out while all the other archs follow more conventional naming (arm, mips, ppc etc.)But at least I can see now why
main
is used as default arg here, to target x86/amd64 architectureThere 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.
I believe
main
is a specific folder:See https://github.com/elastic/golang-crossbuild#gomain-docker-image
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.
I've changed the name variable name to
SUFFIX
to distance it from theTARGETARCH/ARCH
concepts as it includes more information than just the architecture.I also set it to use the same
main-debian11
suffix as our other targets use.I'm more then happy to change to
TARGETARCH
if the upstream sources support it.