-
Notifications
You must be signed in to change notification settings - Fork 2k
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
add support for building multi-CPU architecture images #1130
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: paulfantom The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There is some work on publishing the images to k8s.gcr.io automatically, at that point we will probably no longer support the quay repo. I'm not sure how much work we should put into it. I'm fine with this, but be aware that it might disappear soon, and I don't know if the auto publishing workflow will support multi-arch. |
Yes we discussed with Pawel :)
Not true, we will still publish the coreos images, no? |
/hold Apparently docker on travis has permissions problems when trying to create manifests. Apparently this is fixed but not really: docker/for-linux#396 |
Signed-off-by: paulfantom <[email protected]>
/unhold moved to use |
${DOCKER_CLI} tag $(MULTI_ARCH_IMG):$(TAG) $(MULTI_ARCH_IMG):latest | ||
rm -rf "${TEMP_DIR}" | ||
manifest-tool: | ||
curl -fsSL https://github.com/estesp/manifest-tool/releases/download/v1.0.2/manifest-tool-linux-amd64 > ./manifest-tool |
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.
Let's move the manifest-tool
version to a variable
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.
Let's also have a bin existence check, so that we don't run this every time. Something like this:
HAS_GOLANGCI := $(shell which golangci-lint) which is used in the lint
make target
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.
Simple checking for binary existence is a contrast to requiring a version of a binary. Consider having a pre-existing system-wide binary in version A, but specifying version B in Makefile. In such scenario you would need to add another check to validate globally installed binary version against version requested in Makefile. It is a question of code simplicity vs first execution speed.
@@ -84,41 +80,57 @@ TEMP_DIR := $(shell mktemp -d) | |||
all: all-container | |||
|
|||
sub-container-%: | |||
$(MAKE) --no-print-directory ARCH=$* container | |||
# 'clean' is necessary since build process needs to overwrite kube-state-metrics binary. Otherwise all images end up with binary made for one architecture |
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.
Why not have clean
as a pre-requisite to the sub-container-%
target?
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.
That was the first thing I did, but it didn't work 🤷
|
||
sub-push-%: | ||
$(MAKE) --no-print-directory ARCH=$* push | ||
# 'clean' is necessary since build process needs to overwrite kube-state-metrics binary. Otherwise all images end up with binary made for one architecture |
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.
Why not have clean
as a pre-requisite to the sub-push-%
target?
Thanks for the PR @paulfantom :). Provided some review comments |
@tariq1890 @paulfantom since I'm using kube-state-metrics on arm64, I would love to see this change in as it will simplifying deployment a lot. Anything I can help out with here to move it forward? |
What this PR does / why we need it:
kube-state-metrics
targetTested by running:
Output can be seen in https://quay.io/repository/paulfantom/kube-state-metrics?tab=tags
Images validated on ARMv7 and AMD64 systems.
NOTE: This changes how images are published to quay.io. After merging, publishing images is done with
make release-images
. Added info about it in RELEASE.mdWhich issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1037