Skip to content

Commit b92df5e

Browse files
Merge branch 'main' into main
2 parents 4576c36 + b54431c commit b92df5e

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The list of prerequisites for running the Volcano device plugin is described bel
3636
* nvidia-docker version > 2.0 (see how to [install](https://github.com/NVIDIA/nvidia-docker) and it's [prerequisites](https://github.com/nvidia/nvidia-docker/wiki/Installation-\(version-2.0\)#prerequisites))
3737
* docker configured with nvidia as the [default runtime](https://github.com/NVIDIA/nvidia-docker/wiki/Advanced-topics#default-runtime).
3838
* Kubernetes version >= 1.16
39-
* Volcano verison >= 1.19
39+
* Volcano verison >= 1.9
4040

4141
## Quick Start
4242

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ require (
77
github.com/NVIDIA/go-nvml v0.12.4-0
88
github.com/NVIDIA/gpu-monitoring-tools v0.0.0-20201109160820-d08ea3cdcce4
99
github.com/fsnotify/fsnotify v1.4.9
10+
github.com/mitchellh/gox v1.0.1 // indirect
1011
github.com/prometheus/client_golang v1.0.0
1112
github.com/prometheus/common v0.4.1
1213
github.com/spf13/cobra v0.0.5

pkg/plugin/vgpu/util/util.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ func GetPendingPod(node string) (*v1.Pod, error) {
6969
return nil, err
7070
}
7171

72-
oldestPod := getOldestPod(podList.Items)
72+
oldestPod := getOldestPod(podList.Items, node)
7373
if oldestPod == nil {
7474
return nil, fmt.Errorf("cannot get valid pod")
7575
}
7676

7777
return oldestPod, nil
7878
}
7979

80-
func getOldestPod(pods []v1.Pod) *v1.Pod {
80+
func getOldestPod(pods []v1.Pod, nodename string) *v1.Pod {
8181
if len(pods) == 0 {
8282
return nil
8383
}
@@ -96,6 +96,13 @@ func getOldestPod(pods []v1.Pod) *v1.Pod {
9696
continue
9797
}
9898
}
99+
if assignedNodeAnnotations, ok := pod.Annotations[AssignedNodeAnnotations]; !ok {
100+
continue
101+
} else {
102+
if strings.Compare(assignedNodeAnnotations, nodename) != 0 {
103+
continue
104+
}
105+
}
99106
klog.V(4).Infof("pod %s, predicate time: %s", pod.Name, pod.Annotations[AssignedTimeAnnotations])
100107
if oldest == nil || getPredicateTimeFromPodAnnotation(oldest) > getPredicateTimeFromPodAnnotation(&pod) {
101108
oldest = &pods[i]

0 commit comments

Comments
 (0)