Skip to content

Commit

Permalink
kubeflow: rename odh. into kfmr.
Browse files Browse the repository at this point in the history
Signed-off-by: tarilabs <[email protected]>
  • Loading branch information
tarilabs committed Feb 21, 2024
1 parent 197c929 commit 6dfa2ad
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions clients/python/src/model_registry/types/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
24 changes: 12 additions & 12 deletions internal/mapper/mapper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions pkg/core/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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() {
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/robot/MRandLogicalModel.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand Down

0 comments on commit 6dfa2ad

Please sign in to comment.