-
Notifications
You must be signed in to change notification settings - Fork 40.4k
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
Make plugins importable for other projects #91983
Comments
/sig scheduling |
cc @k82cn |
/cc @kubernetes/sig-scheduling-feature-requests |
If we want to support something for external consumption it should probably be staged. If you have to import k8s.io/kubernetes then it's generally been considered unsupported. |
IMO, staging is better; if we do not support that, we have to copy it under Apache License :( |
@k82cn IIRC, it was intentional to move the cache/queue code to internal package, in some release lead by @misterikkit (he/him). The intention was that cache/queue are quite internal mechanics of the upstream scheduler, so shouldn't support external consumption. So personally, I quite doubt if it's desired to move the internal stuff back publicly. |
Honestly, I don-t care about the cache, but the algorithm in upstream dependent on it :( |
That's great if we can get it ready ASAP :) Before that, we have to do hard copy under Apache License. |
@hzxuzhonghu , I think we need to follow Apache License to highlight this hard copy. |
To clarify on the reasoning of the snapshot being internal: We envisioned the scheduler framework to be used by simulators (such as cluster autoscaler) to predict how pods would get scheduled if conditions are changed. Those are only required to implement the The snapshot is highly associated with the scheduler cache, which should remain internal. Perhaps you should make your own cache implement the |
Yeah, #89930 is intended to make the framework more portable by breaking internal k/k dependencies and is basically the first step we need to take to do that. |
But we can not import algorithm directly; that's wired that we dependent on algorithms in upstream and that algortihm dependent on my implementations :(. |
I don't follow. By algorithm you mean plugins? |
One goal of Scheduler Framework is to have other scheduler implementations import certain parts of the scheduler, staging seems like the best way to make that importable. @k82cn when you say Another intent with the refactoring effort was to improve the way that other projects (like autoscaler) import our predicate implementations. In theory, each predicate should be a simple piece of logic with very few imports. That function could be imported by other projects, but the scheduler will wrap it in some boilerplate so it can fit into the Framework. |
I'd like to import predicates and prioritise :)
IMO, predicates & priorities should be self-contains for other project, e.g. autoscaler as misterikkit@ mentoned; if |
+1
Staging seems better; but I'm open on that part :) |
pkg/scheduler/internal/cache
public
@hzxuzhonghu @k82cn If you just want to import the plugins (predicates and priorities have all been refactored into plugins), I'm confused at this requirement:
Why not importing the plugins directly? I cannot get the point of "use NewSnapshot to initialize the interface ... to call plugins". I checked the latest code, no plugin code (excluding unit tests) is dependent on the internal "cache" or "queue" pkg. If you spot some, can you show me the example? |
The only case I can think of is to use pkg/scheduler/internal/cache.NewSnapshot to building tests, but other than that, I don't see anything can prevent users from importing the plugins. |
The snapshot package is used to build |
There is no concept of predicates and priorities in the scheduler anymore, please update the title. The description of the issue is also not quite related to the title. If the ask is to be able to import plugins, then this will be doable as part of the long term plan of breaking up most of the scheduler code and move it to staging repo: https://docs.google.com/document/d/1WO-ixERpqkCSEXEq30YtEH_z_G-BoLKeCbkRJcKq3xA/edit Once in staging, you are guaranteed that dependencies on internal pkgs or dependencies on the specific implementation of default-scheduler will not exist. |
No? Please refer me to the line were it is required.
If we provide an implementation, I'm quite sure you will eventually find it limiting. Specially in the volcano use case, were you have to simulate multiple pods being added and rerun the plugins. Also, are you sure you need to directly instantiate plugins. In general, you should be good instantiating a Framework and use their exposed functions to run the plugins for you. |
I think the dependency they are referring to comes from the plugins unit tests, we should create a separate testing pkg and cut the dependency on the internal pkg in tests. |
hm... which term are we going to use for that,
That's great we have a long term plan for that :) |
Yes, To summarize:
|
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. |
/remove-lifecycle stale |
Don't see it referenced here yet, but this is currently blocked by #92507, which initializes an external "component-helpers" repo with the goal of migrating internal/duplicate helpers to this repo in order to break the framework's internal dependencies. |
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. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close |
@k8s-triage-robot: Closing this issue. 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. |
Context
volcano scheduler is making use of kubernetes' scheduler algorithms. But during the k8s dependency upgrade, we found that the scheduler framework has been refactored.
And we need to use pkg/scheduler/internal/cache.NewSnapshot to initialize the interface that needed to call related plugins. As internal package can not be imported, so i have to copy the code.
That is hard to maintain, so i doubt if we can remove the
internal
limitation in the k/k./sig-scheduling
The text was updated successfully, but these errors were encountered: