From 3ceaca9f3c8d71c5fa6643277c39163f6ae569fa Mon Sep 17 00:00:00 2001 From: vprashar2929 Date: Thu, 24 Oct 2024 22:09:21 +0530 Subject: [PATCH] feat: bump up model-server version to 0.7.12 This commit bumps up the model-server version to 0.7.12 Signed-off-by: vprashar2929 --- api/v1alpha1/kepler_internal_types.go | 3 +++ ...stem.sustainable.computing.io_keplerinternals.yaml | 3 +++ docs/api.md | 9 +++++++++ pkg/components/estimator/estimator.go | 2 +- pkg/components/modelserver/modelserver.go | 11 ++++++----- pkg/components/modelserver/modelserver_test.go | 5 ++++- 6 files changed, 26 insertions(+), 7 deletions(-) diff --git a/api/v1alpha1/kepler_internal_types.go b/api/v1alpha1/kepler_internal_types.go index 12fab21d..536722be 100644 --- a/api/v1alpha1/kepler_internal_types.go +++ b/api/v1alpha1/kepler_internal_types.go @@ -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"` diff --git a/config/crd/bases/kepler.system.sustainable.computing.io_keplerinternals.yaml b/config/crd/bases/kepler.system.sustainable.computing.io_keplerinternals.yaml index 6c20ccd7..1ed72fed 100644 --- a/config/crd/bases/kepler.system.sustainable.computing.io_keplerinternals.yaml +++ b/config/crd/bases/kepler.system.sustainable.computing.io_keplerinternals.yaml @@ -274,6 +274,9 @@ spec: requestPath: default: "" type: string + resourceDir: + default: "" + type: string storage: properties: persistentVolumeClaim: diff --git a/docs/api.md b/docs/api.md index a9956789..ef274281 100644 --- a/docs/api.md +++ b/docs/api.md @@ -822,6 +822,15 @@ Kepler Model Server Spec Default:
false + + resourceDir + string + +
+
+ Default:
+ + false storage object diff --git a/pkg/components/estimator/estimator.go b/pkg/components/estimator/estimator.go index 43326a51..e4e858f0 100644 --- a/pkg/components/estimator/estimator.go +++ b/pkg/components/estimator/estimator.go @@ -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" ) diff --git a/pkg/components/modelserver/modelserver.go b/pkg/components/modelserver/modelserver.go index fbfb991d..7d9f83be 100644 --- a/pkg/components/modelserver/modelserver.go +++ b/pkg/components/modelserver/modelserver.go @@ -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" ) @@ -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{{ @@ -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 @@ -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) diff --git a/pkg/components/modelserver/modelserver_test.go b/pkg/components/modelserver/modelserver_test.go index 7cb3c0ce..399566d2 100644 --- a/pkg/components/modelserver/modelserver_test.go +++ b/pkg/components/modelserver/modelserver_test.go @@ -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", }, @@ -47,6 +48,7 @@ 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", @@ -54,6 +56,7 @@ func TestConfigMap(t *testing.T) { "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", },