-
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
Rethink the Scheduler's Framework Permit API #82385
Comments
/cc |
Thanks! It is reasonable. I could work on it.
Would it be a public or private API? Is there any other uses cases that might use it? If not, private functions seems enough. |
/cc |
We could add an events channel parameter and a deadline time channel as a return value in the permit plugin API: type PermitStatus struct {
PluginName string
Status *Status
}
type PermitPlugin interface {
Plugin
Permit(pc *PluginContext, p *v1.Pod, nodeName string, events <-chan PermitStatus) (*Status, <-time.Time)
}
|
/assign @hex108 |
Doesn't it make more sense to have separate timeouts for each permit and cancel them in case one reduses to accept the plugin at any time? |
After we make |
Also the A Permit plugin would call one of these funcions, pass the returned |
Thanks all for the suggestions. @hex108 please start a design doc with the various options with examples how each option would be used, we can continue the discussion there. |
Thanks all! As @ahg-g suggested, I'll write a design doc for it. |
Sorry for late reply, I have been busy in the past days. I write a proposal in https://docs.google.com/document/d/1ftrPlERI5GVzWh0qAM_fChrhcpsBTYyyCleVvmMNEJ4/edit?usp=sharing. PTAL @ahg-g @draveness @Adirio @danielqsj @SataQiu |
@hex108 Can I ask why are you storing a When a plugin specifies a timeout, |
@Adirio Thanks for the suggestion! I planned to start only one timer for each |
@hex108 Looks nice, I made a small comment on a part that was not updated to the |
A bit related to this, are plugins that are waiting and set an initial timeout allowed to extend this timeout? I think this feature could also open some doors, such as co-schedulers that decide that a pod needs to be scheduled in the next batch instead of this one. |
There is no special need for this now. We could consider it when it is actually needed. |
Thanks @hex108, the proposal looks good to me. It is worth pointing out that if plugin p1 is waiting for plugin p2 to allow the pod, and p2 is also waiting for p1 to allow the pod, the pod will never get scheduled and will always time out. One solution is to provide some sort of an "IntentToAllow" interface though which plugins can show their intent to accept the pod before actually allowing it. We can think more about the above case in a latter iteration of Permit API if it turns out to be an issue (i.e., determining an ordering to solve the deadlock is not possible). |
Thanks for review, I'll send a PR for it.
I'll investigate more about it. Is there any use case for it now? |
I don't see any real use case for it, but I will post some random thoughts.
|
Thanks Adirio for the detailed thoughts, I agree that we will only try to solve this if it turns out to be an issue and that there is a use case for it. I didn't think that much how we are going to solve this, and whether something like IntentToAllow will actually be general enough solution, it may work only in the case of two plugins waiting for each other. But, as you say, lets wait until someone comes with a use case. |
Just sent a PR #83756 for it. Please help review it. |
/cc @liu-cong |
The Permit extension point allows running multiple registered permit plugins, if more than one permit plugin returns Wait with a timeout, then we wait for the shortest of the two timeouts.
The expectation is that the plugins that issue Wait will have logic, likely baked into the plugin itself, that accepts the pod at a later time.
However, different plugins will have different criteria to accept/reject the pod, and given the current API, a plugin could accept the pod while the criteria of another plugin may not be met yet.
At the high-level, we need to change the permit API so that an accept is done for a specific plugin, and the pod will be accepted only after all plugins that issued wait get an accept. We also may want to keep adjusting the timeout every time the pod gets accepted by a plugin (start with the smallest timeout, and if the plugin that requested that timeout accepts the pod, we wait for the next smallest timeout minus the time we waited so far...).
We will also need to provide an API to check which or how many plugins have not yet accepted a pod, this is to allow plugins like gang scheduling to wait until all other plugins accepted the pod, and only then the gang scheduling plugin accept the pod.
/sig scheduling
The text was updated successfully, but these errors were encountered: