Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit 3973ef8

Browse files
uniemimutkatila
authored andcommitted
Lint fixes and version update
Go bumped to 1.19 and library dependencies updated Co-authored-by: Tuomas Katila <[email protected]> Co-authored-by: Ukri Niemimuukko <[email protected]>
1 parent 9568b99 commit 3973ef8

File tree

8 files changed

+97
-243
lines changed

8 files changed

+97
-243
lines changed

gpu-aware-scheduling/.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ issues:
4444
- funlen
4545
- goimports
4646
- gofmt
47+
- unparam

gpu-aware-scheduling/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ifneq ($(TAG),)
22
IMAGE_TAG=:$(TAG)
33
endif
44

5-
GOLICENSES_VERSION?=v1.2.1
5+
GOLICENSES_VERSION?=v1.5.0
66

77
ifneq ("$(wildcard licenses/)","")
88
LOCAL_LICENSES=TRUE

gpu-aware-scheduling/deploy/images/Dockerfile_gpu-extender

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2022 Intel Corporation
22
# SPDX-License-Identifier: Apache-2.0
33

4-
FROM golang:1.18 as builder
4+
FROM golang:1.19 as builder
55
ARG GOLICENSES_VERSION
66
ARG LOCAL_LICENSES
77
COPY . /src_root

gpu-aware-scheduling/go.mod

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
module github.com/intel/platform-aware-scheduling/gpu-aware-scheduling
22

3-
go 1.18
3+
go 1.19
44

55
require (
6-
github.com/intel/platform-aware-scheduling/extender v0.2.0
6+
github.com/intel/platform-aware-scheduling/extender v0.3.0
7+
github.com/pkg/errors v0.9.1
78
github.com/smartystreets/goconvey v1.7.2
8-
github.com/stretchr/testify v1.7.4
9-
k8s.io/api v0.24.2
10-
k8s.io/apimachinery v0.24.2
11-
k8s.io/client-go v0.24.2
12-
k8s.io/klog/v2 v2.70.0
9+
github.com/stretchr/testify v1.8.1
10+
k8s.io/api v0.26.0
11+
k8s.io/apimachinery v0.26.0
12+
k8s.io/client-go v0.26.0
13+
k8s.io/klog/v2 v2.80.1
1314
)
1415

1516
require (
1617
github.com/davecgh/go-spew v1.1.1 // indirect
17-
github.com/emicklei/go-restful/v3 v3.8.0 // indirect
18+
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
1819
github.com/evanphx/json-patch v5.6.0+incompatible // indirect
1920
github.com/go-logr/logr v1.2.3 // indirect
2021
github.com/go-openapi/jsonpointer v0.19.5 // indirect
2122
github.com/go-openapi/jsonreference v0.20.0 // indirect
22-
github.com/go-openapi/swag v0.21.1 // indirect
23+
github.com/go-openapi/swag v0.22.3 // indirect
2324
github.com/gogo/protobuf v1.3.2 // indirect
2425
github.com/golang/protobuf v1.5.2 // indirect
2526
github.com/google/gnostic v0.6.9 // indirect
26-
github.com/google/go-cmp v0.5.8 // indirect
27+
github.com/google/go-cmp v0.5.9 // indirect
2728
github.com/google/gofuzz v1.2.0 // indirect
2829
github.com/gopherjs/gopherjs v1.17.2 // indirect
2930
github.com/imdario/mergo v0.3.13 // indirect
@@ -34,26 +35,24 @@ require (
3435
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3536
github.com/modern-go/reflect2 v1.0.2 // indirect
3637
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
37-
github.com/pkg/errors v0.9.1 // indirect
3838
github.com/pmezard/go-difflib v1.0.0 // indirect
3939
github.com/smartystreets/assertions v1.13.0 // indirect
4040
github.com/spf13/pflag v1.0.5 // indirect
41-
github.com/stretchr/objx v0.4.0 // indirect
42-
golang.org/x/net v0.0.0-20220621193019-9d032be2e588 // indirect
43-
golang.org/x/oauth2 v0.0.0-20220608161450-d0670ef3b1eb // indirect
44-
golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c // indirect
45-
golang.org/x/term v0.0.0-20220526004731-065cf7ba2467 // indirect
46-
golang.org/x/text v0.3.7 // indirect
47-
golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect
48-
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
41+
github.com/stretchr/objx v0.5.0 // indirect
42+
golang.org/x/net v0.4.0 // indirect
43+
golang.org/x/oauth2 v0.3.0 // indirect
44+
golang.org/x/sys v0.3.0 // indirect
45+
golang.org/x/term v0.3.0 // indirect
46+
golang.org/x/text v0.5.0 // indirect
47+
golang.org/x/time v0.3.0 // indirect
4948
google.golang.org/appengine v1.6.7 // indirect
50-
google.golang.org/protobuf v1.28.0 // indirect
49+
google.golang.org/protobuf v1.28.1 // indirect
5150
gopkg.in/inf.v0 v0.9.1 // indirect
5251
gopkg.in/yaml.v2 v2.4.0 // indirect
5352
gopkg.in/yaml.v3 v3.0.1 // indirect
54-
k8s.io/kube-openapi v0.0.0-20220621154418-c39d0f63fac8 // indirect
55-
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 // indirect
56-
sigs.k8s.io/json v0.0.0-20220525155127-227cbc7cc124 // indirect
57-
sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
53+
k8s.io/kube-openapi v0.0.0-20221207184640-f3cff1453715 // indirect
54+
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 // indirect
55+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
56+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
5857
sigs.k8s.io/yaml v1.3.0 // indirect
5958
)

gpu-aware-scheduling/go.sum

Lines changed: 56 additions & 210 deletions
Large diffs are not rendered by default.

gpu-aware-scheduling/pkg/gpuscheduler/node_resource_cache.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,14 @@ func NewCache(client kubernetes.Interface) *Cache {
200200
nodeTileStatuses: make(map[string]nodeTiles),
201201
}
202202

203-
podInformer.Informer().AddEventHandler(c.createFilteringPodResourceHandler())
204-
nodeInformer.Informer().AddEventHandler(c.createFilteringNodeResourceHandler())
203+
_, err := podInformer.Informer().AddEventHandler(c.createFilteringPodResourceHandler())
204+
_, err2 := nodeInformer.Informer().AddEventHandler(c.createFilteringNodeResourceHandler())
205+
206+
if err != nil || err2 != nil {
207+
klog.Errorf("informer event handler init failure (%v, %v)", err, err2)
208+
209+
return nil
210+
}
205211

206212
go func() { c.startPodWork(stopChannel) }()
207213
go func() { c.startNodeWork(stopChannel) }()

gpu-aware-scheduling/pkg/gpuscheduler/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ func concatenateSplitLabel(node *v1.Node, labelName string) string {
224224
klog.Warningf("concatenated chuck has invalid prefix: %s", continuingLabelValue[:len(labelControlChar)])
225225

226226
return ""
227-
} else {
228-
value += continuingLabelValue[len(labelControlChar):]
229227
}
230228

229+
value += continuingLabelValue[len(labelControlChar):]
230+
231231
postFix++
232232
continuingLabelValue, ok = node.Labels[labelName+strconv.Itoa(postFix)]
233233
}

gpu-aware-scheduling/pkg/gpuscheduler/utils_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,11 @@ func TestGPUNameToLZeroDeviceId(t *testing.T) {
118118
}
119119

120120
func TestPCIGroups(t *testing.T) {
121+
defaultGroups := "0.1_2.3.4"
122+
121123
Convey("When the GPU belongs to a PCI Group", t, func() {
122124
node := getMockNode(1, 1)
123-
node.Labels[pciGroupLabel] = "0.1_2.3.4"
125+
node.Labels[pciGroupLabel] = defaultGroups
124126
So(getPCIGroup(node, "card0"), ShouldResemble, []string{"0", "1"})
125127
So(getPCIGroup(node, "card1"), ShouldResemble, []string{"0", "1"})
126128
So(getPCIGroup(node, "card2"), ShouldResemble, []string{"2", "3", "4"})
@@ -130,7 +132,7 @@ func TestPCIGroups(t *testing.T) {
130132

131133
Convey("When the GPU belongs to a PCI Group with multiple group labels", t, func() {
132134
node := getMockNode(1, 1)
133-
node.Labels[pciGroupLabel] = "0.1_2.3.4"
135+
node.Labels[pciGroupLabel] = defaultGroups
134136
node.Labels[pciGroupLabel+"2"] = "Z_5.6_7.8_11.12"
135137
node.Labels[pciGroupLabel+"3"] = "Z_9.10"
136138
So(getPCIGroup(node, "card6"), ShouldResemble, []string{"5", "6"})
@@ -140,7 +142,7 @@ func TestPCIGroups(t *testing.T) {
140142

141143
Convey("When I call addPCIGroupGPUs with a proper node and cards map", t, func() {
142144
node := getMockNode(1, 1)
143-
node.Labels[pciGroupLabel] = "0.1_2.3.4"
145+
node.Labels[pciGroupLabel] = defaultGroups
144146
cards := []string{}
145147
cards = addPCIGroupGPUs(node, "card3", cards)
146148

0 commit comments

Comments
 (0)