-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
No kubebuilder #66
No kubebuilder #66
Conversation
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 understand this is a work in progress, but wanted to comment to the parts I saw that we part of build and I don't think should not be here
# Next, make sure that you have no builds or build templates in your current namespace: | ||
kubectl delete builds --all | ||
kubectl delete buildtemplates --all | ||
kubectl delete clusterbuildtemplates --all | ||
|
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.
- This cleanup of builds, buildtemplates and clusterbuildtemplates is not applicable here, should be cleaning up pipeline things
|
||
To make changes to these CRDs, you will probably interact with: | ||
``` |
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 way the build tests run might not be applicable here
README.md
Outdated
@@ -1,142 +1,51 @@ | |||
# Pipeline CRD | |||
# Knative build | |||
|
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.
- should be build-pipeline
README.md
Outdated
1. Visit the [How to contribute](./CONTRIBUTING.md) page for information about |
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.
- all this readme is about build, we need the one about build-pipeline that already existed
logger = logger.With(zap.String(logkey.ControllerType, logLevelKey)) | ||
|
||
logger.Info("Starting the Build Controller") | ||
|
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'm guessing this should be pipeline controller
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 Build controller is actually a bit old-fashioned in Knative terms, and doesn't use some of the new best practices available in knative/pkg, like the reconciler and webhook validation stuff. It might be better to base pipelines' controller on serving or eventing, until build can get updated to the latest-and-greatest.
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.
For a super skeletal example to start from using the knative/pkg
goodies check out https://github.com/mattmoor/warm-image.
This doesn't leverage things like the webhook (which Build hasn't yet adopted), but it shows the Reconciler
bits.
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.
There are a skeleton implementation in build but its not fully completed yet. Serving
is a better example
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'm going to leave this as is for now and refactor to using the new controller interfaces/libs in another PR
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.
isn't the point of this PR to refactor the controllers interfaces libs to the new style? Just that it will be harder to refactor when other work gets added to this structure
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.
isn't the point of this PR to refactor the controllers interfaces libs to the new style?
This particular PR is about removing kubebuilder, but I agree that we want the controller code to settle in the style we want to continue with. Since this PR is so huge, I think we should go ahead with it as-is, then have a subsequent PR to update to the new style.
Hopefully I'm not underestimating the differences between this and the new style, but from what I can tell it seems like folks can go ahead and get unblocked if we merge this, then it's just a few changes to update to the latest.
(As part of updating to the latest I'd also like to write some docs about it b/c I haven't been able to find any.)
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.
ok, I agree this PR is getting to big to follow, we can fix up whatever needs changes after.
cmd/creds-init/main.go
Outdated
defer logger.Sync() | ||
|
||
builders := []credentials.Builder{dockercreds.NewBuilder(), gitcreds.NewBuilder()} | ||
for _, c := range builders { |
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.
- builders is what the build project uses to execute the builds, I'm expecting it will be a little different 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.
removed creds-init for now
cmd/logs/main.go
Outdated
func main() { | ||
flag.Parse() | ||
if len(flag.Args()) != 1 { | ||
log.Fatalf("Usage: %s [-n NAMESPACE] BUILD-NAME\n", os.Args[0]) |
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.
Pipeline name instead of build name
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.
Do we need the logs package at all for now? I'd prefer to add it only when/if we find a use for it.
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.
removed cmd/logs for now
config/300-build.yaml
Outdated
# limitations under the License. | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: |
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 build CRD should not be part of the build-pipeline project
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.
Currently, I believe the idea is to have Tasks create builds from the buildSpec field in a Task. It is unclear if installing knative/build should be a dependency for knative/build-pipeline or we should import pieces of knative/build in knative/build-pipeline (build controller, etc.) and manage those pieces that way. I am open to either. Currently, the build CRD is in config/ as the installation method is ko apply -f config
and Build CRD is a dependency for the Task CRD.
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 think it would be better as a dependency, similar to what serving has. This way we would have less duplication and can easily pick up changes in the build project
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.
knative/build is now a requirement to install knative/build-pipeline, removed related yamls and controllers from knative/build-pipeline
config/300-buildtemplate.yaml
Outdated
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition |
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 buildTemplate CRD should not be part of the build-pipeline project
config/300-clusterbuildtemplate.yaml
Outdated
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: clusterbuildtemplates.pipeline.knative.dev |
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 clusterBuildTemplate CRD should not be part of the build-pipeline project
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.
When you're ready to go, plz make sure to update the commit message(s) to:
-
explain why we're doing this (https://github.com/knative/build-pipeline/blob/master/CONTRIBUTING.md#commit-messages)
-
include
"fixes #57"
/me focusing on the important things first 😎
Another request for the commit message: listing everything that existed in the kubebuilder based iteration that was removed and why (e.g. "existing tests had to be removed because X") |
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 think a lot of this was covered by @pivotal-nader-ziada already but here's a list of the immediate things I've noticed:
- This PR clobbers our existing:
- issue-template.md
- README.md
- CONTRIBUTING.md
- DEVELOPMENT.md - most of what got replaced here is great and super useful, but we lost some stuff from our existing file (e.g. getting started, where's the code) and gained some stuff that doesn't quite make sense (e.g. running the integration tests)
pkg/apis/pipeline/v1alpha1/resource_types.go
is gone for some reason
It also removes all of our existing tests - is it possible to keep sanity_test.go
(including the dependency on kubebuilder) around, or does that only work with the kubebuilder based controllers?
What is cover.out?
I think we should remove for now:
- AUTHORS
- config/*.yaml which duplicate types from knative/build that we don't use (e.g. 300-build, 300-build-template, i think there are probably more like imagecache, etc.)
- cmd/creds-init, cmd/git-init (until we need them, maybe @pivotal-nader-ziada and @shashwathi will be re-adding these or have a different opinion)
- cmd/logs - unless we need it? it's not clear to me waht this is
I'd like to get a review from someone like @imjasonh specifically of the contents of config/*.yaml, it's not 100% clear to me which of those we need (e.g. is everything in the cluster role required)
I like how the controllers are empty of logic for now! I think that's a great starting place so we can unblock @pivotal-nader-ziada, @shashwathi and our other issues. re. the better controller implementations that @imjasonh and @mattmoor mentioned we can work from (thanks for the pointer in the right direction!! ❤️ ), I suggest we go ahead and commit the controllers as we have them in this PR, then update them in the next PR (so we don't have to do too much in this PR, there's so much already). But feel free to disregard if you'd prefer @aaron-prindle |
👍 Looking forward for this! |
That is used for tailing build logs. For now I would vote for removing this component and add the feature when we user requests it.
Yes I vote for removing these as well. @pivotal-nader-ziada let me know if you feel otherwise.
I will also echo everybody's thought on not adding this change. |
I think this is almost there! I'm making a few more tweaks. |
This PR removes the kubebuilder dependency and framework from knative/build-pipeline, opting to instead use the hack/update-codegen.sh scripts approach to generating CRD libraries. The controller and directory structure were also updated to more closely mirror knative/build. Resource was temporarily renamed StandardResource as it collided with a method Register in pkg/apis/pipeline/v1alpha1/register.go. Currently tests are stubbed out since all of the existing tests were kubebuilder specific - we'll have to add more! Updates developer docs to include how to interact with this repo now that we've switched styles. Fixes #57
In our first iteration of the API, we were using `v1beta1` as the version. We bumped this to `v1alpha1` while removing kubebuilder but didn't update it everywhere. Also removed extra references to git-init and creds-init (at the moment we aren't building these from anything in this repo) Co-authored-by: Tejal Desai <tejaldesai@google.com>
Okay I think we are ready! drumroll |
/lgtm |
In response to this:
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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aaron-prindle, bobcatfish 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 |
* Replace kubebuilder with knative/build style controllers This PR removes the kubebuilder dependency and framework from knative/build-pipeline, opting to instead use the hack/update-codegen.sh scripts approach to generating CRD libraries. The controller and directory structure were also updated to more closely mirror knative/build. Resource was temporarily renamed StandardResource as it collided with a method Register in pkg/apis/pipeline/v1alpha1/register.go. Currently tests are stubbed out since all of the existing tests were kubebuilder specific - we'll have to add more! Updates developer docs to include how to interact with this repo now that we've switched styles. Fixes #57 * Fix resource version In our first iteration of the API, we were using `v1beta1` as the version. We bumped this to `v1alpha1` while removing kubebuilder but didn't update it everywhere. Also removed extra references to git-init and creds-init (at the moment we aren't building these from anything in this repo) Co-authored-by: Tejal Desai <tejaldesai@google.com>
This PR removes the kubebuilder dependency and framework from knative/build-pipeline, opting to instead use the hack/update-codegen.sh scripts approach to generating CRD libraries. The controller and directory structure were also updated to more closely mirror knative/build. Resource was temporarily renamed StandardResource as it collided with a method Register in pkg/apis/pipeline/v1alpha1/register.go.