Skip to content

Commit a4af156

Browse files
authored
Handle updated model manifest path with latest NIMs (#262)
* Handle updated model manifest path with latest NIMs Model manifest file path has changed with recent NIMs to /opt/nim/etc/default/model_manifest.yaml. This change will handle that. Signed-off-by: Shiva Krishna, Merla <smerla@nvidia.com> * Update command to check for the latest manifest path inside the NIM container Signed-off-by: Shiva Krishna, Merla <smerla@nvidia.com> --------- Signed-off-by: Shiva Krishna, Merla <smerla@nvidia.com>
1 parent 16914b3 commit a4af156

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

internal/controller/nimcache_controller.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,21 @@ func getManifestConfigName(nimCache *appsv1alpha1.NIMCache) string {
910910
return fmt.Sprintf("%s-manifest", nimCache.GetName())
911911
}
912912

913+
func getCommand() []string {
914+
return []string{
915+
"sh",
916+
"-c",
917+
strings.Join([]string{
918+
"if [ -f /opt/nim/etc/default/model_manifest.yaml ]; then",
919+
"cat /opt/nim/etc/default/model_manifest.yaml;",
920+
"else",
921+
"cat /etc/nim/config/model_manifest.yaml;",
922+
"fi;",
923+
"sleep infinity",
924+
}, " "),
925+
}
926+
}
927+
913928
// constructPodSpec constructs a Pod specification
914929
func constructPodSpec(nimCache *appsv1alpha1.NIMCache, platformType k8sutil.OrchestratorType) *corev1.Pod {
915930
labels := map[string]string{
@@ -938,7 +953,7 @@ func constructPodSpec(nimCache *appsv1alpha1.NIMCache, platformType k8sutil.Orch
938953
{
939954
Name: NIMCacheContainerName,
940955
Image: nimCache.Spec.Source.NGC.ModelPuller,
941-
Command: []string{"sh", "-c", "cat /etc/nim/config/model_manifest.yaml; sleep infinity"},
956+
Command: getCommand(),
942957
SecurityContext: &corev1.SecurityContext{
943958
AllowPrivilegeEscalation: ptr.To[bool](false),
944959
Capabilities: &corev1.Capabilities{

0 commit comments

Comments
 (0)