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

support build docker images for arm64 arch #1906

Merged
merged 13 commits into from
Dec 13, 2021
Merged

Conversation

daixiang0
Copy link
Member

@daixiang0 daixiang0 commented Dec 18, 2019

Signed-off-by: Xiang Dai [email protected]

  • I added CHANGELOG entry for this change.

Changes

Fix #1851

@daixiang0
Copy link
Member Author

I have no permission to test push related things, build pass at local.

@daixiang0
Copy link
Member Author

Prometheus also support arm, but i saw corss build only generate binary for amd64 and arm64, so do not add it.

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

But I think we can simplify here a lot. Let's instead use the way Prometheus is doing this, so https://github.com/prometheus/prometheus/blob/337a1fbffd17ad3c7952dadf1246ee6eedf57b01/Makefile.common#L213

And dockerfile taking from promu (we already use promu for the build process):
https://github.com/prometheus/prometheus/blob/bca6e90ea6788100a56809e73f9eeaaa11480036/Dockerfile#L6

What do you think? (:

Makefile Outdated Show resolved Hide resolved
@daixiang0
Copy link
Member Author

@bwplotka I use the way Prometheus does, please review again.

@daixiang0 daixiang0 requested a review from bwplotka December 18, 2019 12:02
@simonpasquier
Copy link
Contributor

A few things from my Prometheus experience:

  • someone with permissions needs to create in advance the following repositories on quay.io.
    • quay.io/thanos/thanos-linux-amd64
    • quay.io/thanos/thanos-linux-arm64
  • you need to add a step running docker run --privileged linuxkit/binfmt:v0.7 (see here).
  • you might need to upgrade the Docker version to 18.06.0-ce.

And there might other things that I don't remember ;-)

@daixiang0
Copy link
Member Author

@simonpasquier yep, but i have no premissions to test while process:(

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, but indeed only the maintainer can test it and I will do this in free time.

Thanks for nice tips @simonpasquier !

Also make build with promu build just ./thanos so make build and building docker will not work anymore... This was a nice manual flow that some dev uses. I think this is fine though, we adjust it in local dev script.

.circleci/config.yml Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@daixiang0 daixiang0 requested a review from bwplotka December 19, 2019 12:58
@daixiang0
Copy link
Member Author

@bwplotka wait for your feedback~

@daixiang0
Copy link
Member Author

@bwplotka do you have time to test it?

@simonpasquier
Copy link
Contributor

This looks good to me. The only real way to be sure it works would be to merge and see what happens :-)

@stale
Copy link

stale bot commented Mar 21, 2020

This issue/PR has been automatically marked as stale because it has not had recent activity. Please comment on status otherwise the issue will be closed in a week. Thank you for your contributions.

@stale stale bot added stale and removed stale labels Mar 21, 2020
@daixiang0
Copy link
Member Author

@bwplotka hi, do you have time to test it?

@bwplotka
Copy link
Member

bwplotka commented Mar 21, 2020 via email

@povilasv
Copy link
Member

Hey, I'm interested in this and I think I will be able to help, ping me on monday :)

@daixiang0
Copy link
Member Author

@povilasv thanks!

Copy link
Member

@povilasv povilasv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So right github actions for e2e are failing and are not flaky, we need to fix this.

The issue is believe that build step produces binaries not in .build/${OS}-${ARCH}/thanos :

build: check-git deps $(PROMU)
	@echo ">> building binaries $(GOBIN)"	
	@$(PROMU) build --prefix $(PREFIX)

I suggest trying to change that to:

build: check-git deps $(PROMU)
	@echo ">> building binaries $(GOBIN)"	
	@$(PROMU) crossbuild --prefix $(PREFIX) -p 'linux/amd64'

I think this should put the binary into correct dir.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
@daixiang0
Copy link
Member Author

daixiang0 commented May 7, 2020

The CI test result show that we can not use --prefix for promu crossbuild:

>> building binaries /go/bin
promu-9583e5a6448f97c6294dca72dd1d173e28f8d4a4: error: unknown long flag '--prefix', try --help
##[error]make: *** [Makefile:153: build] Error 1

Just change "linux" to "$OS" is enough.

CHANGELOG.md Outdated Show resolved Hide resolved
@daixiang0 daixiang0 force-pushed the arm64 branch 4 times, most recently from 0ff6d16 to b68a5fb Compare May 8, 2020 02:55
@daixiang0
Copy link
Member Author

@GiedriusS @hanjm Please review again.

daixiang0 and others added 5 commits December 6, 2021 09:59
Signed-off-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Giedrius Statkevičius <[email protected]>
Only create a manifest & push it after pushing images with the new
names.

Signed-off-by: Giedrius Statkevičius <[email protected]>
Makefile Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
daixiang0 and others added 6 commits December 7, 2021 12:55
Signed-off-by: Loong <[email protected]>
Signed-off-by: Loong <[email protected]>
Signed-off-by: Loong <[email protected]>
Signed-off-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Loong <[email protected]>
Makefile Outdated Show resolved Hide resolved
Signed-off-by: Giedrius Statkevičius <[email protected]>
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪 hope this works

@GiedriusS GiedriusS merged commit 58f042d into thanos-io:main Dec 13, 2021
@GiedriusS
Copy link
Member

Had to use a different emulator to make it work: 9faf940. Now thanos:latest cannot be found, working on it.

@GiedriusS GiedriusS mentioned this pull request Dec 13, 2021
@daixiang0 daixiang0 deleted the arm64 branch December 14, 2021 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upload container images for arm64 architecture