Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

move device-sharing logics from predicates to standalone devices plugin #3313

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

archlitchi
Copy link
Contributor

In order support other Heterogeneous AI Computing devices, we'd better separate device-sharing logics to a standalone plugin called 'devices'

@volcano-sh-bot volcano-sh-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 29, 2024
nodeMap := ssn.NodeMap

pCache := predicateCacheNew()
predicate := enablePredicate(pp.pluginArguments)

// Register event handlers to update task info in PodLister & nodeMap
ssn.AddEventHandler(&framework.EventHandler{
AllocateFunc: func(event *framework.Event) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be all removed, just remove device related codes, because other parts are needed by predict plugin.

@@ -34,9 +34,10 @@ data:
- name: conformance
- plugins:
- name: drf
- name: predicates
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

predicate is an important and basic plugin, we should not remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't remove predicates here, i simply add 'devices' before 'predicates'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok

@@ -0,0 +1,185 @@
/*
Copyright 2024 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kubernetes -> Volcano

@@ -227,89 +205,11 @@ func enablePredicate(args framework.Arguments) predicateEnable {
}

func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
pl := ssn.PodLister
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be removed either.

@lowang-bh
Copy link
Member

We'd better add some UTs.

@@ -34,9 +34,10 @@ data:
- name: conformance
- plugins:
- name: drf
- name: predicates
- name: devices
Copy link
Member

@Monokaix Monokaix Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In each doc, we should support two ways guidance, one is before v1.8.2, and another is after v1.8.2. Old way should be kept.

}

func (pp *priorityPlugin) Name() string {
func (pp *devicesPlugin) Name() string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pp -> dp

Signed-off-by: limengxuan <limengxuan@4paradigm.com>
Signed-off-by: limengxuan <limengxuan@4paradigm.com>
@@ -18,6 +18,35 @@ After installed, update the scheduler configuration:
kubectl edit cm -n volcano-system volcano-scheduler-configmap
```

For volcano v1.8.2+(v1.8.2 included), use the following configMap
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, seems v1.8.2 has not included this feature.

Signed-off-by: limengxuan <limengxuan@4paradigm.com>
limitations under the License.
*/

package devices
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

device is too general. It's not easy to know the function of plugin according to the name. It's better use a specific plugin name, like vgpu

Copy link
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 1, 2024
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: william-wang

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 1, 2024
@volcano-sh-bot volcano-sh-bot merged commit 92df051 into volcano-sh:master Mar 1, 2024
14 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants