Skip to content

Commit

Permalink
[Serving] Rename model-conf to serving-conf (#5635)
Browse files Browse the repository at this point in the history
* [Common] Rename `model-conf` to `serving-conf`

Since it has nothing to do with models.

* Rename constant as well
  • Loading branch information
gtopper committed May 27, 2024
1 parent 31baa55 commit cb4a548
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions mlrun/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#

IMAGE_NAME_ENRICH_REGISTRY_PREFIX = "." # prefix for image name to enrich with registry
MLRUN_MODEL_CONF = "model-conf"
MLRUN_SERVING_SPEC_MOUNT_PATH = f"/tmp/mlrun/{MLRUN_MODEL_CONF}"
MLRUN_SERVING_CONF = "serving-conf"
MLRUN_SERVING_SPEC_MOUNT_PATH = f"/tmp/mlrun/{MLRUN_SERVING_CONF}"
MLRUN_SERVING_SPEC_FILENAME = "serving_spec.json"
MLRUN_SERVING_SPEC_PATH = (
f"{MLRUN_SERVING_SPEC_MOUNT_PATH}/{MLRUN_SERVING_SPEC_FILENAME}"
Expand Down
2 changes: 1 addition & 1 deletion server/api/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1366,7 +1366,7 @@ async def delete_function(
await nuclio_client.delete_function(name=function, project_name=project)

config_map = k8s_helper.get_configmap(
function, mlrun.common.constants.MLRUN_MODEL_CONF
function, mlrun.common.constants.MLRUN_SERVING_CONF
)
if config_map:
k8s_helper.delete_configmap(config_map.metadata.name)
Expand Down
4 changes: 2 additions & 2 deletions server/api/crud/runtimes/nuclio/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ def _compile_function_config(
)
k8s_helper = server.api.utils.singletons.k8s.get_k8s_helper()
confmap_name = k8s_helper.ensure_configmap(
mlrun.common.constants.MLRUN_MODEL_CONF,
mlrun.common.constants.MLRUN_SERVING_CONF,
function_name,
{mlrun.common.constants.MLRUN_SERVING_SPEC_FILENAME: serving_spec},
labels={mlrun_constants.MLRunInternalLabels.created: "true"},
)
volume_name = mlrun.common.constants.MLRUN_MODEL_CONF
volume_name = mlrun.common.constants.MLRUN_SERVING_CONF
volume_mount = {
"name": volume_name,
"mountPath": mlrun.common.constants.MLRUN_SERVING_SPEC_MOUNT_PATH,
Expand Down
2 changes: 1 addition & 1 deletion tests/api/api/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ async def test_delete_function_calls_k8s_helper_methods():
)

assert len(failed_requests) == 0
k8s_helper_mock.get_configmap.assert_called_with("function1", "model-conf")
k8s_helper_mock.get_configmap.assert_called_with("function1", "serving-conf")
k8s_helper_mock.delete_configmap.assert_called_with("config-map-1")


Expand Down
8 changes: 4 additions & 4 deletions tests/api/runtimes/test_serving.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ def _assert_deploy_spec_has_secrets_config(
{
"volume": {
"configMap": {
"name": f"model-conf-{self.project}-{self.name}"
"name": f"serving-conf-{self.project}-{self.name}"
+ (f"-{func_name}" if func_name else "")
},
"name": "model-conf",
"name": "serving-conf",
},
"volumeMount": {
"mountPath": "/tmp/mlrun/model-conf",
"name": "model-conf",
"mountPath": "/tmp/mlrun/serving-conf",
"name": "serving-conf",
"readOnly": True,
},
}
Expand Down

0 comments on commit cb4a548

Please sign in to comment.