-
-
Notifications
You must be signed in to change notification settings - Fork 25
init LOADER_IMAGE with env variable MODEL_LOADER_IMAGE #389
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
Conversation
/kind cleanup |
Coming back here again, if we put this value in playground.backendConfig.env, it will be rendered into service and lws, and also rendered into pod env 🤔 , so it seems to be a convenient way to get this value. But I'm not sure if it's the right way this time. like this: func (p *ModelHubProvider) InjectModelLoader(template *corev1.PodTemplateSpec, index int) {
initContainerName := MODEL_LOADER_CONTAINER_NAME
if index != 0 {
initContainerName += "-" + strconv.Itoa(index)
}
var loaderImage string
for _, container := range template.Spec.Containers {
for _, env := range container.Env {
if env.Name == "MODEL_LOADER_IMAGE" {
loaderImage = env.Value
break
}
}
if loaderImage != "" {
break
}
}
if loaderImage == "" {
loaderImage = pkg.LOADER_IMAGE
}
// Handle initContainer.
initContainer := &corev1.Container{
Name: initContainerName,
Image: loaderImage,
VolumeMounts: []corev1.VolumeMount{
{
Name: MODEL_VOLUME_NAME,
MountPath: CONTAINER_MODEL_PATH,
},
},
}
....
} |
import "os" | ||
|
||
var ( | ||
LOADER_IMAGE = os.Getenv("MODEL_LOADER_IMAGE") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the way this works is to get it from the controller env. I'm not sure if this is what we want.
Can we use configmap for long-term solution, because we may introduce more configures with ai gateway introduced, I think it doesn't require too much efforts. |
it means we don't need this change? |
We need the feature but we need to use configmap to set the value instead. |
/close |
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes part of #350 (comment)
Special notes for your reviewer
Does this PR introduce a user-facing change?