Skip to content

[Proposal] Make Openapi(REST) client the only entrypoint #398

@Al-Pragliola

Description

@Al-Pragliola

At the moment Model Registry has two client entrypoints in the codebase:

  1. pkg/openapi: the auto generated client from the openapi schema
  2. pkg/core: a grpc client that talks directly with the MLMD service

image

This creates a strong dependency on the MLMD service and makes difficult changing the underlying service without major breaking changes in the future, also we cannot trace/log/audit what users are doing to the metadata store if they bypass our proxy. My proposal is to move the package from pkg/core to internal/core and do a refactoring to make it a switchable datastore for the model registry. What I mean by switchable datastore is to change the config arguments that we take in the proxy:

  • (change) mlmd_hostname -> datastore_hostname
  • (change) mlmd_port -> datastore_port
  • (create) datastore_service(type?) = mlmd / sqlite / whatever

then in model registry we can use a factory method to use the correct datastore implementation of the interface ModelRegistryServiceAPIServicer

I did a check on which projects import pkg/core and for upstream I didn't find any (https://pkg.go.dev/github.com/kubeflow/model-registry/pkg/core?tab=importedby), but we have a breaking change in the midstream (https://pkg.go.dev/github.com/opendatahub-io/model-registry/pkg/core?tab=importedby) we should make the team that works on opendatahub-io/odh-model-controller aware of this change.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions