Skip to content

Commit 8df153e

Browse files
authored
Merge pull request #19 from intel/fix-status-updating
Minor fixes, bump version
2 parents 4b066e0 + 8bcb038 commit 8df153e

File tree

8 files changed

+16
-58
lines changed

8 files changed

+16
-58
lines changed

cmd/kubelet-gaudi-plugin/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func newCommand() *cobra.Command {
159159
driverPluginPath: driverPluginPath,
160160
}
161161

162-
if flags.status != nil {
162+
if *flags.status != "" {
163163
gas := intelcrd.NewGaudiAllocationState(config.crdconfig, intelclient)
164164
return setStatus(cmd.Context(), *flags.status, gas)
165165
}
@@ -171,12 +171,13 @@ func newCommand() *cobra.Command {
171171
}
172172

173173
func validateFlags(f *flagsType) error {
174-
175174
switch strings.ToLower(*f.status) {
176175
case strings.ToLower(intelcrd.GaudiAllocationStateStatusReady):
177176
*f.status = intelcrd.GaudiAllocationStateStatusReady
178177
case strings.ToLower(intelcrd.GaudiAllocationStateStatusNotReady):
179178
*f.status = intelcrd.GaudiAllocationStateStatusNotReady
179+
case "":
180+
return nil
180181
default:
181182
return fmt.Errorf("unknown status: %v", *f.status)
182183
}

cmd/kubelet-gpu-plugin/main.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func newCommand() *cobra.Command {
159159
driverPluginPath: driverPluginPath,
160160
}
161161

162-
if flags.status != nil {
162+
if *flags.status != "" {
163163
gas := intelcrd.NewGpuAllocationState(config.crdconfig, intelclient)
164164
return setStatus(cmd.Context(), *flags.status, gas)
165165
}
@@ -171,12 +171,13 @@ func newCommand() *cobra.Command {
171171
}
172172

173173
func validateFlags(f *flagsType) error {
174-
175174
switch strings.ToLower(*f.status) {
176175
case strings.ToLower(intelcrd.GpuAllocationStateStatusReady):
177176
*f.status = intelcrd.GpuAllocationStateStatusReady
178177
case strings.ToLower(intelcrd.GpuAllocationStateStatusNotReady):
179178
*f.status = intelcrd.GpuAllocationStateStatusNotReady
179+
case "":
180+
return nil
180181
default:
181182
return fmt.Errorf("unknown status: %v", *f.status)
182183
}

deployments/gaudi/resource-class.yaml

-27
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
apiVersion: gaudi.resource.intel.com/v1alpha1
2-
kind: GaudiClassParameters
3-
metadata:
4-
name: intel-gaudi-params-shared
5-
spec:
6-
shared: true
7-
---
8-
apiVersion: resource.k8s.io/v1alpha2
9-
kind: ResourceClass
10-
metadata:
11-
name: intel-gaudi-shared
12-
driverName: gaudi.resource.intel.com
13-
parametersRef:
14-
apiGroup: gaudi.resource.intel.com/v1alpha1
15-
kind: GaudiClassParameters
16-
name: intel-gaudi-params-shared
17-
18-
---
19-
apiVersion: gaudi.resource.intel.com/v1alpha1
20-
kind: GaudiClassParameters
21-
metadata:
22-
name: intel-gaudi-params
23-
spec:
24-
shared: false
25-
---
261
apiVersion: resource.k8s.io/v1alpha2
272
kind: ResourceClass
283
metadata:
@@ -32,15 +7,13 @@ parametersRef:
327
apiGroup: gaudi.resource.intel.com/v1alpha1
338
kind: GaudiClassParameters
349
name: intel-gaudi-params
35-
3610
---
3711
apiVersion: gaudi.resource.intel.com/v1alpha1
3812
kind: GaudiClassParameters
3913
metadata:
4014
name: intel-gaudi-monitor-params
4115
spec:
4216
monitor: true
43-
shared: false
4417
---
4518
apiVersion: resource.k8s.io/v1alpha2
4619
kind: ResourceClass

deployments/gaudi/resource-defaults.yaml

-11
This file was deleted.

deployments/gaudi/resource-driver.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
serviceAccountName: intel-gaudi-resource-driver-service-account
2020
initContainers:
2121
- name: init
22-
image: intel/intel-gaudi-resource-driver:v0.1.0
22+
image: intel/intel-gaudi-resource-driver:v0.1.1
2323
imagePullPolicy: IfNotPresent
2424
command: ["/kubelet-gaudi-plugin", "--status", "NotReady"]
2525
env:
@@ -43,7 +43,7 @@ spec:
4343
type: RuntimeDefault
4444
containers:
4545
- name: kubelet-plugin
46-
image: intel/intel-gaudi-resource-driver:v0.1.0
46+
image: intel/intel-gaudi-resource-driver:v0.1.1
4747
imagePullPolicy: IfNotPresent
4848
command: ["/kubelet-gaudi-plugin"]
4949
env:
@@ -71,9 +71,6 @@ spec:
7171
mountPath: /etc/cdi
7272
- name: varruncdi
7373
mountPath: /var/run/cdi
74-
- name: defaults
75-
mountPath: "/defaults"
76-
readOnly: true
7774
- name: sysfs
7875
mountPath: "/sysfs"
7976
securityContext:
@@ -101,9 +98,6 @@ spec:
10198
- name: sysfs
10299
hostPath:
103100
path: /sys
104-
- name: defaults
105-
configMap:
106-
name: defaults
107101
---
108102
apiVersion: apps/v1
109103
kind: Deployment
@@ -126,7 +120,7 @@ spec:
126120
serviceAccountName: intel-gaudi-resource-driver-service-account
127121
containers:
128122
- name: controller
129-
image: intel/intel-gaudi-resource-driver:v0.1.0
123+
image: intel/intel-gaudi-resource-driver:v0.1.1
130124
imagePullPolicy: IfNotPresent
131125
command: ["/gaudi-controller"]
132126
env:

deployments/gpu/resource-driver.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ spec:
1919
serviceAccountName: intel-gpu-resource-driver-service-account
2020
initContainers:
2121
- name: init
22-
image: intel/intel-gpu-resource-driver:v0.5.0
22+
image: intel/intel-gpu-resource-driver:v0.5.1
2323
imagePullPolicy: IfNotPresent
2424
command: ["/kubelet-gpu-plugin", "--status", "NotReady"]
2525
env:
@@ -43,7 +43,7 @@ spec:
4343
type: RuntimeDefault
4444
containers:
4545
- name: kubelet-plugin
46-
image: intel/intel-gpu-resource-driver:v0.5.0
46+
image: intel/intel-gpu-resource-driver:v0.5.1
4747
imagePullPolicy: IfNotPresent
4848
command: ["/kubelet-gpu-plugin"]
4949
env:
@@ -126,7 +126,7 @@ spec:
126126
serviceAccountName: intel-gpu-resource-driver-service-account
127127
containers:
128128
- name: controller
129-
image: intel/intel-gpu-resource-driver:v0.5.0
129+
image: intel/intel-gpu-resource-driver:v0.5.1
130130
imagePullPolicy: IfNotPresent
131131
command: ["/gpu-controller"]
132132
env:

gaudi.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515

16-
GAUDI_VERSION ?= v0.1.0
16+
GAUDI_VERSION ?= v0.1.1
1717
GAUDI_IMAGE_NAME ?= intel-gaudi-resource-driver
1818
GAUDI_IMAGE_VERSION ?= $(GAUDI_VERSION)
1919
GAUDI_IMAGE_TAG ?= $(REGISTRY)/$(GAUDI_IMAGE_NAME):$(GAUDI_IMAGE_VERSION)
@@ -31,7 +31,7 @@ pkg/gaudi/cdihelpers/*.go \
3131
pkg/gaudi/device/*.go \
3232
pkg/gaudi/discovery/*.go
3333

34-
GAUDI_LDFLAGS = ${LDFLAGS} -X ${PKG}/pkg/version.driverVersion=${GPU_VERSION}
34+
GAUDI_LDFLAGS = ${LDFLAGS} -X ${PKG}/pkg/version.driverVersion=${GAUDI_VERSION}
3535

3636
.PHONY: gaudi
3737
gaudi: $(GAUDI_BINARIES)
@@ -42,7 +42,7 @@ bin/gaudi-controller: cmd/gaudi-controller/*.go $(GAUDI_COMMON_SRC)
4242

4343
bin/kubelet-gaudi-plugin: cmd/kubelet-gaudi-plugin/*.go $(GAUDI_COMMON_SRC)
4444
CGO_ENABLED=0 GOOS=linux GOARCH=${ARCH} \
45-
go build -a -ldflags "${GAUDI_LDFLAGS}" -mod vendor -o $@ ./cmd/kubelet-gpu-plugin
45+
go build -a -ldflags "${GAUDI_LDFLAGS}" -mod vendor -o $@ ./cmd/kubelet-gaudi-plugin
4646

4747
.PHONY: gaudi-container-build
4848
gaudi-container-build: cleanall vendor

gpu.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
# Use a custom version for E2E tests if we are testing in CI
16-
GPU_VERSION ?= v0.5.0
16+
GPU_VERSION ?= v0.5.1
1717
GPU_IMAGE_NAME ?= intel-gpu-resource-driver
1818
GPU_IMAGE_VERSION ?= $(GPU_VERSION)
1919
GPU_IMAGE_TAG ?= $(REGISTRY)/$(GPU_IMAGE_NAME):$(GPU_IMAGE_VERSION)

0 commit comments

Comments
 (0)