-
Notifications
You must be signed in to change notification settings - Fork 807
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
Build and push multi-arch/os (amazon and windows, no debian) image manifest via Make rules #957
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wongma7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
13293fc
to
fb44a43
Compare
/hold |
This comment has been minimized.
This comment has been minimized.
/hold cancel |
96109f2
to
593ecf3
Compare
824cf72
to
edfe3f3
Compare
…nifest via Make rules
GIT_COMMIT?=$(shell git rev-parse HEAD) | ||
BUILD_DATE?=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ") | ||
BUILD_DATE?=$(shell date -u -Iseconds) |
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.
Any reason to not use human readable here?
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.
it is the same, just shows offest instead of Z, e.g. 2021-08-05T21:02:49+00:00
--progress=plain \ | ||
--target=$(OS)-$(OSVERSION) \ | ||
--output=type=$(OUTPUT_TYPE) \ | ||
-t=$(IMAGE):$(TAG)-$(OS)-$(ARCH)-$(OSVERSION) \ |
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.
Is there a standard for this format of tag? If not we should make sure we come up with something across the provider-aws subprojects (i.e. just use the same format that you are using). This docker post shows a buildx example where the different platforms share a tag, but I'm not clear how pulling works in that case.
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 tag is only used for local build and adding the locally built image to the manifest list, it won't get pushed with the same tag as far as I can tell . At least, when I pushed it to public ECR as a test it did not expose these intermediary tags anywhere https://gallery.ecr.aws/b5w6x5z2/aws-ebs-csi-driver
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.
Ah, makes sense 👍
/lgtm |
@wongma7 which helm chart version multi-arch/os changes are going in, as I am currently running the chart version: 2.3.0, but ebs-csi-node ds is not running on arm64 node:
|
Is this a bug fix or adding new feature? /feature
What is this PR about? / Why do we need it? Windows support merged recently but we haven't yet released a version with it. In preparation for that we need to build a multi-arch/os image manifest list with one of those manifests being a windows image.
The new Makefile copies heavily from the
pause
image Makefile which I found to have the prettiest patterns for achieving multi-arch build https://github.com/kubernetes/kubernetes/blob/v1.22.0-beta.0/build/pause/MakefileI just made some minor adjustments for personal taste (like naming rules
image
instead ofcontainer
). And, given a new enough docker cli we don't need to do the osversion workaround used there, we can just annotate manifests with argument --os-version.In 1.2.0 release we decided to push only amazon linux based variant to GCR and ECR. So, this PR is also stopping the debian based build. (Decision came after sufficient debate which you can see by the silly amount of edits to this PR)
Before:
After:
What testing is done?
build and push succeeded for my personal registry.