Skip to content

Commit 1b00a30

Browse files
committed
Switch Intel plugin pod to use faked devices
Signed-off-by: Eero Tamminen <eero.t.tamminen@intel.com>
1 parent 3c86f24 commit 1b00a30

File tree

1 file changed

+44
-12
lines changed

1 file changed

+44
-12
lines changed

cmd/gpu_plugin/fakedev/intel-gpu-plugin-fake.yaml

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,61 +16,93 @@ spec:
1616
spec:
1717
serviceAccountName: resource-reader-sa
1818
initContainers:
19+
- name: fakedev-generator
20+
image: intel/fakedev-generator:latest
21+
securityContext:
22+
runAsUser: 0
23+
readOnlyRootFilesystem: false
24+
allowPrivilegeEscalation: false
25+
# files are generated under CWD
26+
workingDir: /tmp/fakedev
27+
volumeMounts:
28+
- name: devfs
29+
mountPath: /tmp/fakedev/dev
30+
readOnly: false
31+
- name: sysfs
32+
mountPath: /tmp/fakedev/sys
33+
readOnly: false
34+
- name: fake-conf
35+
mountPath: /config
36+
readOnly: true
37+
# generate fake sysfs / devfs files for GPU plugin based on config
38+
command: ["/generator", "-json", "/config/fakedev.json", "-verbose"]
1939
- name: intel-gpu-initcontainer
2040
image: intel/intel-gpu-initcontainer:0.24.0
2141
imagePullPolicy: IfNotPresent
2242
securityContext:
2343
readOnlyRootFilesystem: true
2444
allowPrivilegeEscalation: false
2545
volumeMounts:
26-
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
27-
name: nfd-source-hooks
46+
- name: sysfs
47+
mountPath: /host-sys
48+
readOnly: true
49+
- name: nfd-features
50+
mountPath: /nfd
51+
readOnly: false
52+
workingDir: /usr/local/bin/gpu-sw
53+
# convert generated sysfs content to NFD feature labels
54+
command: ["sh", "-c", "./intel-gpu-nfdhook | tee /nfd/fake-gpu"]
2855
containers:
2956
- name: intel-gpu-plugin
3057
env:
3158
- name: NODE_NAME
3259
valueFrom:
3360
fieldRef:
3461
fieldPath: spec.nodeName
35-
image: intel/intel-gpu-plugin:0.24.0
36-
imagePullPolicy: IfNotPresent
62+
image: intel/intel-gpu-plugin:latest
3763
securityContext:
3864
readOnlyRootFilesystem: true
3965
allowPrivilegeEscalation: false
4066
command: [
4167
"/usr/local/bin/intel_gpu_device_plugin",
42-
"-shared-dev-num", "300",
68+
"-shared-dev-num", "2",
69+
"-fake-mode", "/tmp/fakedev,",
4370
"-enable-monitoring",
4471
"-resource-manager",
4572
"-v", "2"
4673
]
4774
volumeMounts:
75+
# combined GPU plugin / container runtime limitation:
76+
# device files need to be mounted to same path on host and inside container
4877
- name: devfs
49-
mountPath: /dev/dri
78+
mountPath: /tmp/fakedev/dev
5079
readOnly: true
5180
- name: sysfs
52-
mountPath: /sys/class/drm
81+
mountPath: /tmp/fakedev/sys
5382
readOnly: true
5483
- name: kubeletsockets
5584
mountPath: /var/lib/kubelet/device-plugins
5685
- name: podresources
5786
mountPath: /var/lib/kubelet/pod-resources
5887
volumes:
88+
- name: fake-conf
89+
configMap:
90+
name: fake-gen-config
5991
- name: devfs
6092
hostPath:
61-
path: /dev/dri
93+
path: /tmp/fakedev/dev
94+
type: DirectoryOrCreate
6295
- name: sysfs
63-
hostPath:
64-
path: /sys/class/drm
96+
emptyDir: {}
6597
- name: kubeletsockets
6698
hostPath:
6799
path: /var/lib/kubelet/device-plugins
68100
- name: podresources
69101
hostPath:
70102
path: /var/lib/kubelet/pod-resources
71-
- name: nfd-source-hooks
103+
- name: nfd-features
72104
hostPath:
73-
path: /etc/kubernetes/node-feature-discovery/source.d/
105+
path: /etc/kubernetes/node-feature-discovery/features.d/
74106
type: DirectoryOrCreate
75107
nodeSelector:
76108
kubernetes.io/arch: amd64

0 commit comments

Comments
 (0)