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
chore: Polish node manager image building #974
chore: Polish node manager image building #974
Conversation
Hi @mainred. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
And I notice that azurefile-csi-driver Makefile is tidier and more readable. Maybe we could borrow something from that.
@@ -102,7 +107,7 @@ $(BIN_DIR)/azure-cloud-node-manager: $(PKG_CONFIG) $(wildcard cmd/cloud-node-man | |||
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} go build -a -o $(BIN_DIR)/azure-cloud-node-manager $(shell cat $(PKG_CONFIG)) ./cmd/cloud-node-manager | |||
|
|||
$(BIN_DIR)/azure-cloud-node-manager.exe: $(PKG_CONFIG) $(wildcard cmd/cloud-node-manager/*) $(wildcard cmd/cloud-node-manager/**/*) $(wildcard pkg/**/*) ## Build node-manager binary for Windows. | |||
CGO_ENABLED=0 GOOS=windows go build -a -o $(BIN_DIR)/azure-cloud-node-manager.exe $(shell cat $(PKG_CONFIG)) ./cmd/cloud-node-manager |
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.
Makefile target should be $(BIN_DIR)/azure-cloud-node-manager-${ARCH}.exe
. Or we don't need the ARCH
suffix?
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 tested the target respectively by WINDOWS_OSVERSION=1809 ARCH=arm64 make build-node-image-windows
with output
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -a -o bin/azure-cloud-node-manager-arm64.exe -ldflags '-s -w -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitVersion=v1.23.0-23-g2ef2d846d -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitCommit=2ef2d846d7ecb982a02d9ce82087ac09acf3badb -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitMajor=1 -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitMinor=23+ -X sigs.k8s.io/cloud-provider-azure/pkg/version.buildDate=2022-01-06T14:52:13Z' ./cmd/cloud-node-manager
and
WINDOWS_OSVERSION=1809 ARCH=amd64 make build-node-image-windows
with output
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -a -o bin/azure-cloud-node-manager-amd64.exe -ldflags '-s -w -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitVersion=v1.23.0-23-g2ef2d846d -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitCommit=2ef2d846d7ecb982a02d9ce82087ac09acf3badb -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitMajor=1 -X sigs.k8s.io/cloud-provider-azure/pkg/version.gitMinor=23+ -X sigs.k8s.io/cloud-provider-azure/pkg/version.buildDate=2022-01-06T14:52:13Z' ./cmd/cloud-node-manager
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.
What i mean is that target
should be the name of the binary. (ref: https://www.gnu.org/software/make/manual/html_node/Rule-Introduction.html)
And as the linux version $(BIN_DIR)/azure-cloud-node-manager
does not suffix with ARCH
...
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 doc says usually. Don't you think that will give more complexity to the target?
A target is usually the name of a file that is generated by a program
word-hyphen = $(word $2,$(subst -, ,$1)) | ||
|
||
push-node-image-linux-%: | ||
$(MAKE) ARCH=$* push-node-image-linux |
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.
Maybe we could remove such alias 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.
The makefile target is really messy previous, and I tried to remove as many of them as possible and leave the ones exposed to customers more clear.
We want to make the Linux node images publishing easier from the customer side by calling, they don't have to do an iteration
push-all-node-images-linux: $(addprefix push-node-image-linux-,$(ALL_ARCH.linux))
push-node-image-linux-%: | ||
$(MAKE) ARCH=$* push-node-image-linux | ||
|
||
push-node-image-windows-%: |
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.
ditto.
/ok-to-test |
@mainred the changes have broken image building in CIs. could you fix it? |
Fix is on the way. |
/retest pull-cloud-provider-azure-e2e-ccm-capz failed for authorization failure when pushing windows image to capz registry |
/retest |
1 similar comment
/retest |
8301d3e
to
19b0e43
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, mainred, nilo19 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 |
Thanks for the improvement and adding the docs. |
…er-image-building chore: Polish node manager image building
…er-image-building chore: Polish node manager image building
…er-image-building chore: Polish node manager image building
…ng-release-1.1 cherry-pick of #974 to release-1.1: chore: Polish node manager image building
…ng-release-0.7 cherry-pick of #974 to release-0.7: chore: Polish node manager image building
…ng-release-1.0 cherry-pick of #974 to release-1.0: chore: Polish node manager image building
…-1.23 [cherry-pick #974 to 1.23] Polish node manager image building
What type of PR is this?
What this PR does / why we need it:
Changes included in this PR:
gcr.io/k8s-staging-provider-azure/azure-cloud-node-manager
, and is distinguished by different tag naming patterns. Linux is with tag$TAG-linux-$ARCH
, while windows are with tag$TAG-windows-$OSVERSION-$ARCH
, for example:Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: