From 7bf2ec378cc50d34bc3219997378bea838b2ceb6 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 17 Oct 2024 17:17:17 +0200 Subject: [PATCH] Always use ID to synthesize URLs --- bundle/config/mutator/initialize_urls_test.go | 6 +++--- bundle/config/resources/mlflow_model.go | 2 +- bundle/config/resources/model_serving_endpoint.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bundle/config/mutator/initialize_urls_test.go b/bundle/config/mutator/initialize_urls_test.go index 4af7f4a8..5847dcc2 100644 --- a/bundle/config/mutator/initialize_urls_test.go +++ b/bundle/config/mutator/initialize_urls_test.go @@ -42,13 +42,13 @@ func TestInitializeURLs(t *testing.T) { }, Models: map[string]*resources.MlflowModel{ "model1": { - ID: "6", + ID: "a model uses its name for identifier", Model: &ml.Model{Name: "model1"}, }, }, ModelServingEndpoints: map[string]*resources.ModelServingEndpoint{ "servingendpoint1": { - ID: "7", + ID: "my_serving_endpoint", CreateServingEndpoint: &serving.CreateServingEndpoint{ Name: "my_serving_endpoint", }, @@ -93,7 +93,7 @@ func TestInitializeURLs(t *testing.T) { "job1": "https://mycompany.databricks.com/jobs/1?o=123456", "pipeline1": "https://mycompany.databricks.com/pipelines/3?o=123456", "experiment1": "https://mycompany.databricks.com/ml/experiments/4?o=123456", - "model1": "https://mycompany.databricks.com/ml/models/model1?o=123456", + "model1": "https://mycompany.databricks.com/ml/models/a model uses its name for identifier?o=123456", "servingendpoint1": "https://mycompany.databricks.com/ml/endpoints/my_serving_endpoint?o=123456", "registeredmodel1": "https://mycompany.databricks.com/explore/data/models/8?o=123456", "qualityMonitor1": "https://mycompany.databricks.com/explore/data/catalog/schema/qualityMonitor1?o=123456", diff --git a/bundle/config/resources/mlflow_model.go b/bundle/config/resources/mlflow_model.go index 1fd681a1..201ba49f 100644 --- a/bundle/config/resources/mlflow_model.go +++ b/bundle/config/resources/mlflow_model.go @@ -45,7 +45,7 @@ func (s *MlflowModel) InitializeURL(urlPrefix string, urlSuffix string) { if s.ID == "" { return } - s.URL = urlPrefix + "ml/models/" + s.Name + urlSuffix + s.URL = urlPrefix + "ml/models/" + s.ID + urlSuffix } func (s *MlflowModel) GetName() string { diff --git a/bundle/config/resources/model_serving_endpoint.go b/bundle/config/resources/model_serving_endpoint.go index f8981707..4ec6fb3c 100644 --- a/bundle/config/resources/model_serving_endpoint.go +++ b/bundle/config/resources/model_serving_endpoint.go @@ -53,7 +53,7 @@ func (s *ModelServingEndpoint) InitializeURL(urlPrefix string, urlSuffix string) if s.ID == "" { return } - s.URL = urlPrefix + "ml/endpoints/" + s.Name + urlSuffix + s.URL = urlPrefix + "ml/endpoints/" + s.ID + urlSuffix } func (s *ModelServingEndpoint) GetName() string {