Skip to content

Commit

Permalink
Handle updated model manifest path with latest NIMs (#262) (#264)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
shivamerla authored Dec 19, 2024
1 parent 3d62bb7 commit ed2e8a5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion internal/controller/nimcache_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,21 @@ func getManifestConfigName(nimCache *appsv1alpha1.NIMCache) string {
return fmt.Sprintf("%s-manifest", nimCache.GetName())
}

func getCommand() []string {
return []string{
"sh",
"-c",
strings.Join([]string{
"if [ -f /opt/nim/etc/default/model_manifest.yaml ]; then",
"cat /opt/nim/etc/default/model_manifest.yaml;",
"else",
"cat /etc/nim/config/model_manifest.yaml;",
"fi;",
"sleep infinity",
}, " "),
}
}

// constructPodSpec constructs a Pod specification
func constructPodSpec(nimCache *appsv1alpha1.NIMCache, platformType k8sutil.OrchestratorType) *corev1.Pod {
labels := map[string]string{
Expand Down Expand Up @@ -938,7 +953,7 @@ func constructPodSpec(nimCache *appsv1alpha1.NIMCache, platformType k8sutil.Orch
{
Name: NIMCacheContainerName,
Image: nimCache.Spec.Source.NGC.ModelPuller,
Command: []string{"sh", "-c", "cat /etc/nim/config/model_manifest.yaml; sleep infinity"},
Command: getCommand(),
SecurityContext: &corev1.SecurityContext{
AllowPrivilegeEscalation: ptr.To[bool](false),
Capabilities: &corev1.Capabilities{
Expand Down

0 comments on commit ed2e8a5

Please sign in to comment.