Skip to content

Commit

Permalink
feat: bump up model-server version to 0.7.12
Browse files Browse the repository at this point in the history
This commit bumps up the model-server version to 0.7.12

Signed-off-by: vprashar2929 <[email protected]>
  • Loading branch information
vprashar2929 committed Oct 24, 2024
1 parent 7183d9a commit 213e216
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 7 deletions.
3 changes: 3 additions & 0 deletions api/v1alpha1/kepler_internal_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ type InternalModelServerSpec struct {
// +kubebuilder:default=""
Path string `json:"path,omitempty"`

// +kubebuilder:default=""
ResourceDir string `json:"resourceDir,omitempty"`

// +kubebuilder:default=""
RequestPath string `json:"requestPath,omitempty"`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ spec:
requestPath:
default: ""
type: string
resourceDir:
default: ""
type: string
storage:
properties:
persistentVolumeClaim:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ spec:
requestPath:
default: ""
type: string
resourceDir:
default: ""
type: string
storage:
properties:
persistentVolumeClaim:
Expand Down
9 changes: 9 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,15 @@ Kepler Model Server Spec
<i>Default</i>: <br/>
</td>
<td>false</td>
</tr><tr>
<td><b>resourceDir</b></td>
<td>string</td>
<td>
<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>false</td>
</tr><tr>
<td><b><a href="#keplerinternalspecmodelserverstorage">storage</a></b></td>
<td>object</td>
Expand Down
2 changes: 1 addition & 1 deletion pkg/components/estimator/estimator.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (

const (
// NOTE: update tests/images.yaml when changing this image
StableImage = "quay.io/sustainable_computing_io/kepler_model_server:v0.7.11-2"
StableImage = "quay.io/sustainable_computing_io/kepler_model_server:v0.7.12"
waitForSocketCommand = "until [ -e /tmp/estimator.sock ]; do sleep 1; done && %s"
)

Expand Down
11 changes: 6 additions & 5 deletions pkg/components/modelserver/modelserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const (

const (
defaultModelServer = "http://%s.%s.svc.cluster.local:%d"
StableImage = "quay.io/sustainable_computing_io/kepler_model_server:v0.7.11-2"
StableImage = "quay.io/sustainable_computing_io/kepler_model_server:v0.7.12"
waitForModelServerCommand = "until [[ \"$(curl -s -o /dev/null -w %%{http_code} %s/best-models)\" -eq 200 ]]; do sleep 1; done"
)

Expand Down Expand Up @@ -71,7 +71,7 @@ func NewDeployment(deployName string, ms *v1alpha1.InternalModelServerSpec, name
volumes := []corev1.Volume{
storage,
k8s.VolumeFromConfigMap("cfm", configMapName),
k8s.VolumeFromEmptyDir("resource"),
k8s.VolumeFromEmptyDir("data"),
}

mounts := []corev1.VolumeMount{{
Expand All @@ -82,8 +82,8 @@ func NewDeployment(deployName string, ms *v1alpha1.InternalModelServerSpec, name
Name: "mnt",
MountPath: "/mnt",
}, {
Name: "resource",
MountPath: "/usr/local/lib/python3.10/site-packages/resource",
Name: "data",
MountPath: "/data",
}}

port := ms.Port
Expand Down Expand Up @@ -179,7 +179,8 @@ func NewConfigMap(deployName string, d components.Detail, ms *v1alpha1.InternalM
}
}
msConfig := k8s.StringMap{
"MODEL_PATH": defaultIfEmpty(ms.Path, "/mnt/models"),
"MODEL_PATH": defaultIfEmpty(ms.Path, "/mnt/models"),
"RESOURCE_DIR": defaultIfEmpty(ms.ResourceDir, "/data/resource"),
}
msConfig = msConfig.AddIfNotEmpty("MODEL_SERVER_REQ_PATH", ms.RequestPath)
msConfig = msConfig.AddIfNotEmpty("MODEL_SERVER_MODEL_LIST_PATH", ms.ListPath)
Expand Down
5 changes: 4 additions & 1 deletion pkg/components/modelserver/modelserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func TestConfigMap(t *testing.T) {
{
spec: &v1alpha1.InternalModelServerSpec{},
data: map[string]string{
"MODEL_PATH": "/mnt/models",
"MODEL_PATH": "/mnt/models",
"RESOURCE_DIR": "/data/resource",
},
scenario: "default case",
},
Expand All @@ -47,13 +48,15 @@ func TestConfigMap(t *testing.T) {
ListPath: "fake-model-list-path",
PipelineURL: "fake-pipeline",
ErrorKey: "fake-error-key",
ResourceDir: "fake-resource-dir",
},
data: map[string]string{
"MODEL_PATH": "fake-model-path",
"MODEL_SERVER_REQ_PATH": "fake-request-path",
"MODEL_SERVER_MODEL_LIST_PATH": "fake-model-list-path",
"INITIAL_PIPELINE_URL": "fake-pipeline",
"ERROR_KEY": "fake-error-key",
"RESOURCE_DIR": "fake-resource-dir",
},
scenario: "user defined server-api config",
},
Expand Down

0 comments on commit 213e216

Please sign in to comment.