Skip to content

Commit

Permalink
mount imex nodes config
Browse files Browse the repository at this point in the history
lint fixes
  • Loading branch information
guptaNswati committed Oct 31, 2024
1 parent 752e8ae commit ef20f1b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions assets/state-driver/0500_daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ spec:
- name: run-mellanox-drivers
mountPath: /run/mellanox/drivers
mountPropagation: HostToContainer
- name: check-imex-config
image: "FILLED BY THE OPERATOR"
command: ["/bin/bash", "-c"]
args:
- |
IMEX_NODES_CONFIG_FILE=/etc/nvidia-imex/nodes_config.cfg
if [[ -f /host/${IMEX_NODES_CONFIG_FILE} ]]; then
echo "Copying host IMEX nodes config"
cp /host/${IMEX_NODES_CONFIG_FILE} ${IMEX_NODES_CONFIG_FILE}
fi
securityContext:
privileged: true
volumeMounts:
- name: host-etc
mountPath: /host/etc
subPath: etc
readOnly: true
- name: imex-config
mountPath: /etc/nvidia-imex
containers:
- image: "FILLED BY THE OPERATOR"
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -132,6 +151,8 @@ spec:
mountPath: /sys/module/firmware_class/parameters/path
- name: nv-firmware
mountPath: /lib/firmware
- name: imex-config
mountPath: /etc/nvidia-imex
startupProbe:
exec:
command:
Expand Down Expand Up @@ -335,3 +356,9 @@ spec:
hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
- name: host-etc
hostPath:
path: /etc
type: Directory
- name: imex-config
emptyDir: {}
8 changes: 8 additions & 0 deletions controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -3139,6 +3139,14 @@ func transformDriverContainer(obj *appsv1.DaemonSet, config *gpuv1.ClusterPolicy
driverContainer.Image = image
}

// update image for driver IMEX init container
for i, initCtr := range obj.Spec.Template.Spec.InitContainers {
if initCtr.Name == "check-imex-config" {
obj.Spec.Template.Spec.InitContainers[i].Image = image
break
}
}

// update image pull policy
driverContainer.ImagePullPolicy = gpuv1.ImagePullPolicy(config.Driver.ImagePullPolicy)

Expand Down

0 comments on commit ef20f1b

Please sign in to comment.