-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Refactor the dynamicResources struct to DynamicResources #128399
Conversation
|
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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-sigs/prow repository. |
Welcome @JesseStutler! |
Hi @JesseStutler. Thanks for your PR. I'm waiting for a kubernetes 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-sigs/prow 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.
/lgtm
Now might be a good time to merge this, with classic DRA removed and methods thus simplified. Hopefully other pending PRs won't conflict.
@JesseStutler asked for backporting to 1.31 on Slack. I don't think we can do that because it would update an alpha feature and such backports are discouraged. OTOH, the risk is so low here, perhaps it would be acceptable?
LGTM label has been added. Git tree hash: 9ee528a18c85117c1e4ebd90756c90a9417c03ac
|
Now we are actually adapting volcano to k8s v1.31, so it will be nicer to merge it into 1.31, but if 1.31 does not have a patch version anymore, I think v1.32 also is fine. We currently make a copy of all the DRA codes of the latest master branch into volcano to make our DRA plugin. |
/retest "cluster supports count/resourceclaims.resource.k8s.io ResourceQuota" flakes occasionally |
/assign @kerthcet For approval. |
How will the volcano community handle this with different versions of kubernetes? I think if you are consuming this as part of a library you would want versioned APIs. I worry that volcano is going to include a Kubernetes/Kubernetes plus our library packages. I think that may cause some confusion with dependency updates. |
I had communicated with @JesseStutler offline, I suggested that we (in volcano community) adapt this after DRA promoted to beta, because beta is a relatively stable version. |
// dynamicResources is a plugin that ensures that ResourceClaims are allocated. | ||
type dynamicResources struct { | ||
// DynamicResources is a plugin that ensures that ResourceClaims are allocated. | ||
type DynamicResources struct { |
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.
Kubernetes/Kubernetes is not meant to be consumed externally
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.
Not meant to, but some things are done that way anyway:
- Cluster Autoscaler
- any custom scheduler which uses scheduler plugins like those from https://github.com/kubernetes-sigs/scheduler-plugins
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.
just saying, reading the PR description it felt to me people may have some expectations that I think is important to clarify ... but looking at those links I wonder if sig-scheduler should work on moving that path to staging 🤔
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.
Hi @aojea, thanks for your review. Not mean to directly open this PR, but I have discussed it with @pohly on slack, DRA plugin wasn't mature enough so it can't be consumed externally, but after the volcano verification was completed, he felt that it would be ok to open DRA. I saw that lots of other scheduler plugins can also be consumed externally, volcano introduces them the same way. In fact, as long as volcano can access the DRA plugin externally, it doesn’t matter which dependent package the DRA plugin is in.
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.
sig-scheduler should work on moving that path to staging
I agree that this would be cleaner.
I wasn't involved in discussions around it, but I suppose it's not getting done because it would be a major change: it's not sufficient to just move plugins or the framework, for the "custom scheduler" use case everything related to the scheduler would have to be under staging, similar to the apiserver. That's a lot of work for something that mostly just works the way it is...
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.
yeah, I was just curious about it, if people is happy with existing workflow and it works for everybody then it is ok
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.
cc @alculquicondor wdyt is the preferred pattern here? It seems that the changes proposed by @JesseStutler in this PR are the more common pattern for plugins, but strictly speaking abstracting behind a framework.Plugin
seems cleaner (the way the DRA plugin currently looks, which this PR is advocating we change).
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.
According to my experience, most custom schedulers are vendoring default-scheduler for particular plugin's implementation wthin their own framework. So things would get complicated and vague if we move things to staging - where we only place generic APIs for now - it'd be like our goal is to build sth. generic for all scheduler-like components, and users would treat them as backwards-compatible API which would be a wrong assumption.
Current workflow works better IMO - for plugin itself, it'd ok to public them as a contract of SDK level of implementation instead of API. And consumers are responsible to upgrade the SDK along with k8s version upgrade.
If we want to upgrade dependency versions, we will upgrade kubernetes dependencies and API version dependencies together. I have discussed with @pohly before that there will be no major changes to the API, so it's fine to introduce DRA in 1.31 now. When 1.32 comes, the API upgrade will only change the version from the v1alpha3 version to the beta version, the conversion function of v1alpha3 won't be deleted in 1.32 kube-apiserver right? We are introducing DRA now as an experimental feature to ask users for more feedback( |
If there are no review opinions, can anyone merge it? Hope it can be carried in v1.32. |
/assign @Huang-Wei |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Huang-Wei, JesseStutler, pohly 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 |
/ok-to-test |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
I'm from volcano community. Currently, volcano wants to introduce DRA in k8s v1.31, we need to use the dynamicresources struct. Now dynamicresources is still private in master branch and can not be accessed outside the package. It needs to be refactored to
DynamicResources
, therefore we can access directly. I communicated with@pohly before, If I verify in volcano when there is no problem I can refactor the dynamicresources struct to public.Which issue(s) this PR fixes:
We had a PR before and wanted to refactor this, but this person stopped following up: #124269
Special notes for your reviewer:
Our verification in volcano:
We follow up https://github.com/kubernetes-sigs/dra-example-driver to deploy an example resource driver and deploy the demo yaml
gpu-test{1,2,3,4,5}.yaml
, the pod can be successfully scheduled:And allocation result in
ResourceClaim
is successfully updated:Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: