This repository was archived by the owner on Dec 6, 2024. It is now read-only.
generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 29
standardize make tooling with top level Makefile #93
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-retired:monorepo
from
BlaineEXE:unified-make
Aug 28, 2024
Merged
standardize make tooling with top level Makefile #93
k8s-ci-robot
merged 1 commit into
kubernetes-retired:monorepo
from
BlaineEXE:unified-make
Aug 28, 2024
Conversation
This file contains hidden or 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
Standardize make tooling. Remove unnecessary duplication where possible, including with common copies of go fmt/vet/test targets. Slighty shift around controller and sidecar 'cmd/' directories to allow specifying a template Dockerfile that can be used to generate Dockerfiles for each image easily. Where it makes sense, this work adopts the make target naming and Dockerfile usage of the kubebuilder project. The biggest divergence from that template is because we build 2 images from one repo, and because we have a 'proto/' dir for gRPC code. Significant testing was done to ensure that the tooling works with Unix make on MacOS as well as GNU-Make (gmake). Testing was also done to ensure the `make all` target works well with `make -j`'s parallel execution flag, allowing dev speedup where possible. Some proto targets were adjusted to allow make to do a better job detecting when file/code generation is not necessary, saving time in the common case where there are no proto changes. A future goal, which this helps lay groundwork for, will be to make sure that there are top-level make targets that are usable by Prow CI. For example, 'test' can be used to run all unit tests. Any unit tests added to any component can be included in 'make test' to ensure we don't need to make frequent changes to Prow CI definitions. Similarly 'make build' should build all binaries and images to ensure builds work. 'make generate' and 'make codegen' should include targets that generate files in any way, which will allow Prow CI to ensure developers are running all generators. In the future, we have room to add intall and/or e2e tests as make targets. Signed-off-by: Blaine Gardner <[email protected]>
41a8d0a
to
e37b86f
Compare
This test-infra PR should unblock the |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BlaineEXE, xing-yang 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 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
cncf-cla: yes
Indicates the PR's author has signed the CNCF CLA.
lgtm
"Looks good to me", indicates that a PR is ready to be merged.
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
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.
Standardize make tooling. Remove unnecessary duplication where possible, including with common copies of go fmt/vet/test targets.
Slighty shift around controller and sidecar 'cmd/' directories to allow specifying a template Dockerfile that can be used to generate Dockerfiles for each image easily.
Where it makes sense, this work adopts the make target naming and Dockerfile usage of the kubebuilder project. The biggest divergence from that template is because we build 2 images from one repo, and because we have a 'proto/' dir for gRPC code.
Significant testing was done to ensure that the tooling works with Unix make on MacOS as well as GNU-Make (gmake). Testing was also done to ensure the
make all
target works well withmake -j
's parallel execution flag, allowing dev speedup where possible.Some proto targets were adjusted to allow make to do a better job detecting when file/code generation is not necessary, saving time in the common case where there are no proto changes.
A future goal, which this helps lay groundwork for, will be to make sure that there are top-level make targets that are usable by Prow CI. For example, 'test' can be used to run all unit tests. Any unit tests added to any component can be included in 'make test' to ensure we don't need to make frequent changes to Prow CI definitions. Similarly 'make build' should build all binaries and images to ensure builds work. 'make generate' and 'make codegen' should include targets that generate files in any way, which will allow Prow CI to ensure developers are running all generators. In the future, we have room to add intall and/or e2e tests as make targets.