Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mount imex nodes config #1080

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions assets/state-driver/0500_daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,26 @@ spec:
- name: run-mellanox-drivers
mountPath: /run/mellanox/drivers
mountPropagation: HostToContainer
- name: check-imex-config
tariq1890 marked this conversation as resolved.
Show resolved Hide resolved
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}
else
echo "No IMEX nodes config found on the host."
fi
securityContext:
privileged: true
volumeMounts:
- name: host-etc
mountPath: /host/etc
readOnly: true
- name: imex-config
mountPath: /etc/nvidia-imex
containers:
- image: "FILLED BY THE OPERATOR"
imagePullPolicy: IfNotPresent
Expand Down Expand Up @@ -132,6 +152,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 +357,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
Loading