From bb5774dc32a916c2f3af0256fc6b444914503a82 Mon Sep 17 00:00:00 2001 From: tarilabs Date: Wed, 21 Feb 2024 17:12:12 +0100 Subject: [PATCH] kubeflow: rename odh. into kfmr. --- .../python/src/model_registry/types/base.py | 4 ++-- internal/constants/constants.go | 14 +++++------ internal/mapper/mapper_test.go | 24 +++++++++---------- pkg/core/core_test.go | 12 +++++----- test/robot/MRandLogicalModel.robot | 6 ++--- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/clients/python/src/model_registry/types/base.py b/clients/python/src/model_registry/types/base.py index 723813dc9..2e3834a52 100644 --- a/clients/python/src/model_registry/types/base.py +++ b/clients/python/src/model_registry/types/base.py @@ -20,9 +20,9 @@ def get_proto_type_name(cls) -> str: """Name of the proto type. Returns: - Name of the class prefixed with `odh.` + Name of the class prefixed with `kfmr.` """ - return f"odh.{cls.__name__}" + return f"kfmr.{cls.__name__}" @property @abstractmethod diff --git a/internal/constants/constants.go b/internal/constants/constants.go index eabfa9681..704279261 100644 --- a/internal/constants/constants.go +++ b/internal/constants/constants.go @@ -2,11 +2,11 @@ package constants // MLMD type names const ( - RegisteredModelTypeName = "odh.RegisteredModel" - ModelVersionTypeName = "odh.ModelVersion" - ModelArtifactTypeName = "odh.ModelArtifact" - DocArtifactTypeName = "odh.DocArtifact" - ServingEnvironmentTypeName = "odh.ServingEnvironment" - InferenceServiceTypeName = "odh.InferenceService" - ServeModelTypeName = "odh.ServeModel" + RegisteredModelTypeName = "kfmr.RegisteredModel" + ModelVersionTypeName = "kfmr.ModelVersion" + ModelArtifactTypeName = "kfmr.ModelArtifact" + DocArtifactTypeName = "kfmr.DocArtifact" + ServingEnvironmentTypeName = "kfmr.ServingEnvironment" + InferenceServiceTypeName = "kfmr.InferenceService" + ServeModelTypeName = "kfmr.ServeModel" ) diff --git a/internal/mapper/mapper_test.go b/internal/mapper/mapper_test.go index 8f5667c3e..82ce173f4 100644 --- a/internal/mapper/mapper_test.go +++ b/internal/mapper/mapper_test.go @@ -157,10 +157,10 @@ func TestMapToRegisteredModelInvalid(t *testing.T) { assertion, m := setup(t) _, err := m.MapToRegisteredModel(&proto.Context{ TypeId: of(invalidTypeId), - Type: of("odh.OtherEntity"), + Type: of("kfmr.OtherEntity"), }) assertion.NotNil(err) - assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received odh.OtherEntity, please check the provided id", constants.RegisteredModelTypeName), err.Error()) + assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received kfmr.OtherEntity, please check the provided id", constants.RegisteredModelTypeName), err.Error()) } func TestMapToModelVersion(t *testing.T) { @@ -176,10 +176,10 @@ func TestMapToModelVersionInvalid(t *testing.T) { assertion, m := setup(t) _, err := m.MapToModelVersion(&proto.Context{ TypeId: of(invalidTypeId), - Type: of("odh.OtherEntity"), + Type: of("kfmr.OtherEntity"), }) assertion.NotNil(err) - assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received odh.OtherEntity, please check the provided id", constants.ModelVersionTypeName), err.Error()) + assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received kfmr.OtherEntity, please check the provided id", constants.ModelVersionTypeName), err.Error()) } func TestMapToDocArtifact(t *testing.T) { @@ -213,10 +213,10 @@ func TestMapToArtifactInvalid(t *testing.T) { assertion, m := setup(t) _, err := m.MapToArtifact(&proto.Artifact{ TypeId: of(invalidTypeId), - Type: of("odh.OtherEntity"), + Type: of("kfmr.OtherEntity"), }) assertion.NotNil(err) - assertion.Equal("unknown artifact type: odh.OtherEntity", err.Error()) + assertion.Equal("unknown artifact type: kfmr.OtherEntity", err.Error()) } func TestMapToServingEnvironment(t *testing.T) { @@ -232,10 +232,10 @@ func TestMapToServingEnvironmentInvalid(t *testing.T) { assertion, m := setup(t) _, err := m.MapToServingEnvironment(&proto.Context{ TypeId: of(invalidTypeId), - Type: of("odh.OtherEntity"), + Type: of("kfmr.OtherEntity"), }) assertion.NotNil(err) - assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received odh.OtherEntity, please check the provided id", constants.ServingEnvironmentTypeName), err.Error()) + assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received kfmr.OtherEntity, please check the provided id", constants.ServingEnvironmentTypeName), err.Error()) } func TestMapToInferenceService(t *testing.T) { @@ -251,10 +251,10 @@ func TestMapToInferenceServiceInvalid(t *testing.T) { assertion, m := setup(t) _, err := m.MapToInferenceService(&proto.Context{ TypeId: of(invalidTypeId), - Type: of("odh.OtherEntity"), + Type: of("kfmr.OtherEntity"), }) assertion.NotNil(err) - assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received odh.OtherEntity, please check the provided id", constants.InferenceServiceTypeName), err.Error()) + assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received kfmr.OtherEntity, please check the provided id", constants.InferenceServiceTypeName), err.Error()) } func TestMapToServeModel(t *testing.T) { @@ -270,10 +270,10 @@ func TestMapToServeModelInvalid(t *testing.T) { assertion, m := setup(t) _, err := m.MapToServeModel(&proto.Execution{ TypeId: of(invalidTypeId), - Type: of("odh.OtherEntity"), + Type: of("kfmr.OtherEntity"), }) assertion.NotNil(err) - assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received odh.OtherEntity, please check the provided id", constants.ServeModelTypeName), err.Error()) + assertion.Equal(fmt.Sprintf("invalid entity: expected %s but received kfmr.OtherEntity, please check the provided id", constants.ServeModelTypeName), err.Error()) } func TestMapTo(t *testing.T) { diff --git a/pkg/core/core_test.go b/pkg/core/core_test.go index 9c269bc3b..c364101f8 100644 --- a/pkg/core/core_test.go +++ b/pkg/core/core_test.go @@ -453,7 +453,7 @@ func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInRegisteredM // steps to create model registry service _, err = mlmdtypes.CreateMLMDTypes(suite.grpcConn) suite.NotNil(err) - suite.Regexp("error setting up context type odh.RegisteredModel: rpc error: code = AlreadyExists.*", err.Error()) + suite.Regexp("error setting up context type kfmr.RegisteredModel: rpc error: code = AlreadyExists.*", err.Error()) } func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInModelVersion() { @@ -473,7 +473,7 @@ func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInModelVersio // steps to create model registry service _, err = mlmdtypes.CreateMLMDTypes(suite.grpcConn) suite.NotNil(err) - suite.Regexp("error setting up context type odh.ModelVersion: rpc error: code = AlreadyExists.*", err.Error()) + suite.Regexp("error setting up context type kfmr.ModelVersion: rpc error: code = AlreadyExists.*", err.Error()) } func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInModelArtifact() { @@ -493,7 +493,7 @@ func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInModelArtifa // steps to create model registry service _, err = mlmdtypes.CreateMLMDTypes(suite.grpcConn) suite.NotNil(err) - suite.Regexp("error setting up artifact type odh.ModelArtifact: rpc error: code = AlreadyExists.*", err.Error()) + suite.Regexp("error setting up artifact type kfmr.ModelArtifact: rpc error: code = AlreadyExists.*", err.Error()) } func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInServingEnvironment() { @@ -512,7 +512,7 @@ func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInServingEnvi // steps to create model registry service _, err = mlmdtypes.CreateMLMDTypes(suite.grpcConn) suite.NotNil(err) - suite.Regexp("error setting up context type odh.ServingEnvironment: rpc error: code = AlreadyExists.*", err.Error()) + suite.Regexp("error setting up context type kfmr.ServingEnvironment: rpc error: code = AlreadyExists.*", err.Error()) } func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInInferenceService() { @@ -532,7 +532,7 @@ func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInInferenceSe // steps to create model registry service _, err = mlmdtypes.CreateMLMDTypes(suite.grpcConn) suite.NotNil(err) - suite.Regexp("error setting up context type odh.InferenceService: rpc error: code = AlreadyExists.*", err.Error()) + suite.Regexp("error setting up context type kfmr.InferenceService: rpc error: code = AlreadyExists.*", err.Error()) } func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInServeModel() { @@ -552,7 +552,7 @@ func (suite *CoreTestSuite) TestModelRegistryFailureForOmittedFieldInServeModel( // steps to create model registry service _, err = mlmdtypes.CreateMLMDTypes(suite.grpcConn) suite.NotNil(err) - suite.Regexp("error setting up execution type odh.ServeModel: rpc error: code = AlreadyExists.*", err.Error()) + suite.Regexp("error setting up execution type kfmr.ServeModel: rpc error: code = AlreadyExists.*", err.Error()) } // REGISTERED MODELS diff --git a/test/robot/MRandLogicalModel.robot b/test/robot/MRandLogicalModel.robot index fd3ff706e..d50407074 100644 --- a/test/robot/MRandLogicalModel.robot +++ b/test/robot/MRandLogicalModel.robot @@ -29,13 +29,13 @@ Verify basic logical mapping between MR and MLMD # RegisteredModel shall result in a MLMD Context ${mlmdProto} Get Context By Single Id ${rId} Log To Console ${mlmdProto} - Should be equal ${mlmdProto.type} odh.RegisteredModel + Should be equal ${mlmdProto.type} kfmr.RegisteredModel Should be equal ${mlmdProto.name} ${name} # ModelVersion shall result in a MLMD Context and parent Context(of RegisteredModel) ${mlmdProto} Get Context By Single Id ${vId} Log To Console ${mlmdProto} - Should be equal ${mlmdProto.type} odh.ModelVersion + Should be equal ${mlmdProto.type} kfmr.ModelVersion Should be equal ${mlmdProto.name} ${rId}:v1 ${mlmdProto} Get Parent Contexts By Context ${vId} Should be equal ${mlmdProto[0].id} ${rId} @@ -44,7 +44,7 @@ Verify basic logical mapping between MR and MLMD ${aNamePrefix} Set Variable ${vId}: ${mlmdProto} Get Artifact By Single Id ${aId} Log To Console ${mlmdProto} - Should be equal ${mlmdProto.type} odh.ModelArtifact + Should be equal ${mlmdProto.type} kfmr.ModelArtifact Should Start With ${mlmdProto.name} ${aNamePrefix} Should be equal ${mlmdProto.uri} s3://12345 ${mlmdProto} Get Artifacts By Context ${vId}