From 200b245691ed4c533f23a0fa866d5381cc7afb34 Mon Sep 17 00:00:00 2001 From: Heiru Wu Date: Tue, 19 Mar 2024 18:19:41 +0800 Subject: [PATCH] chore(helm): fix missing nvidia cdi spec for helm deployment --- charts/core/templates/ray-service/ray-service.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/core/templates/ray-service/ray-service.yaml b/charts/core/templates/ray-service/ray-service.yaml index 24cdb197..a9c5d56b 100644 --- a/charts/core/templates/ray-service/ray-service.yaml +++ b/charts/core/templates/ray-service/ray-service.yaml @@ -169,7 +169,14 @@ spec: lifecycle: postStart: exec: - command: ["/bin/sh","-c","/home/ray/script/start_ray_serve.sh"] + command: + - "/bin/bash" + - "-c" + - > + if [[ -n $${NVIDIA_VISIBLE_DEVICES} ]]; then + sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml; + fi; + /home/ray/script/start_ray_serve.sh preStop: exec: command: ["/bin/sh","-c","ray stop"]