-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
tidy cluster-autoscaler go modules #3593
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
This seems to duplicate #3566. The reason for the current complicated setup is:
The current setup with update-vendor.sh duplicates what the kubernetes is doing and it uses staging/ repo as the source of truth for all repos in kubernetes org. So the problem we're facing is how to simplify vendor mechanism of CA while keeping the ability to vendor a specific k8s commit (and not just a tagged version). Some ideas have been proposed in #3566. Note that this has little to do with the SDK problem - in principle provider specific dependencies could be vendored in in the current system by using go.mod-extra. The question here is how to easily strip any provider-specific dependencies when compiling CA with just one provider or forking the CA repo. |
83b806e
to
fb8b715
Compare
Oh...I didn't notice the PR. Glad to see that, I'll review it then.
I don't have much background in this, so I'm still confused. How could Kubernetes changes broke CA? |
How about split CA to different repos, just like |
CA works by using vendored scheduler code to predict if pending pods would become schedulable if a new node was added. This way we don't have to play catch-up game and when a new scheduler feature is added or some behavior is changed we get it for free just by importing the right version of scheduler. The downside is that we rely on internal implementation of scheduler and we make assumptions about how it should behave. This is not a public API and in principle any random commit to scheduler may break CA. In fact this has happened many times in the past. Sig-scheduling have always been very helpful and they try to avoid breaking CA, but there is always a risk of some minor change affecting CA in subtle way.
There were multiple proposals for this in the past (and there are many providers implemented as CA forks). I don't think we could split existing providers without regressions:
One proposed compromise would be to implement an 'external' provider that proxies all calls over grpc or similar. That should be enough to cover most use-cases, while leaving an option to implement "full" cloudprovider module if needed.
No argument there. Would it help to temporarily add your SDK to https://github.com/kubernetes/autoscaler/blob/master/hack/boilerplate/boilerplate.py#L148 until we figure this out? |
Yes, this way I don't need to add boilerplate to each file, but I still need to change the import path init. Even though it's not perfect, but much better. |
I feel like we're closing up on a solution for vendoring kubernetes in a better way in #3566, but it don't think it really helps your case all that much - it's not the problem with kubernetes vendoring that was the reason for inlining SDK (I also mentioned this in #3566 (comment)). I'd be very interested to hear your ideas for improving that. My feeling is, however, that it may take some time to fix. If you want to remove your SDK from boilerplate check in the meantime just tag me on the PR. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@RainbowMango: PR needs rebase. 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. |
Closing due to inactivity. Feel free to reopen if needed. |
What this PR does / why we need it:
This PR just tries to adjust the CA dependencies management mechanism in a normal way.
It includes:
go mod vendor
.For now, we generate
go.mod
based on k/kgo.mod
andgo.mod-extra
for the extral dependencies. This way is a little bit weird and sometimes also causes some confusion and inconvenience for users such as #3146, #2858.In addition, I found most CA providers have to commit their SDKs directly to the codebase, like this provider.
It's not graceful as we need to add boilerplate to each go file in SDK, and it will be a disaster when we bumping the SDK version.
Special notes for your reviewer:
This PR is a first iteration towards improving the CA dependency management mechanism. After this PR we also need to update docs such as FAQ, and
hack/update-vendor.sh
.