Model Registry provides a single pane of glass for ML model developers to index and manage models, versions, and ML artifacts metadata. It fills a gap between model experimentation and production activities. It provides a central interface for all stakeholders in the MLOps lifecycle to collaborate on ML models.
Go to file
Alessio Pragliola ad0d5f857b
feat: use db as source in model catalog (#1667)
* feat: switch to db usage WIP

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: partially fix model_catalog_service tests

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: tests

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: change mustache template to support array of primitive type plus reflect removal

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: /models endpoint not working

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: artifacts route 500 status code

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* feat: make artifacts run on a unified repository

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* feat: add custom properties to catalog artifacts

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* feat: add tests files to db_catalog and ctalog_artifact

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: pagination issues

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: return 404 is the model does not exist in the Get model

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: 500 error code on bad user input

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* fix: q parameter not working

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>

* chore: better function/alias naming

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>
Co-authored-by: Paul Boyd <paul@pboyd.io>

---------

Signed-off-by: Alessio Pragliola <seth.pro@gmail.com>
Co-authored-by: Paul Boyd <paul@pboyd.io>
2025-10-01 11:58:33 +00:00
.github build(deps): bump actions/setup-go from 5 to 6 (#1610) 2025-09-24 16:36:44 +00:00
api/openapi feat: use db as source in model catalog (#1667) 2025-10-01 11:58:33 +00:00
bin Fixes #35, refactor DB schema 2023-09-28 18:52:41 -07:00
catalog feat: use db as source in model catalog (#1667) 2025-10-01 11:58:33 +00:00
clients chore: bump MR py client version to 0.3.2 (#1684) 2025-10-01 11:57:32 +00:00
cmd Merge model-catalog-enhancements branch (#1656) 2025-10-01 10:47:33 +00:00
devenv Merge model-catalog-enhancements branch (#1656) 2025-10-01 10:47:33 +00:00
docs feat: mlmd removal from codebase (#1267) 2025-08-13 13:31:14 +00:00
gorm-gen feat: move to go 1.24 (#1313) 2025-07-14 19:02:37 +00:00
internal Merge model-catalog-enhancements branch (#1656) 2025-10-01 10:47:33 +00:00
jobs/async-upload build(deps): bump model-registry from 0.2.19 to 0.3.0 in /jobs/async-upload (#1612) 2025-09-15 16:37:33 +00:00
manifests/kustomize Merge model-catalog-enhancements branch (#1656) 2025-10-01 10:47:33 +00:00
patches OAS: Fix discriminator field definition for Artifact (#22) 2024-03-01 08:39:04 +00:00
pkg feat: add metric history bulk fetch endpoint (#1535) 2025-09-05 06:11:12 +00:00
proposals docs: Add information about KEPs (#803) 2025-02-17 07:58:39 +00:00
scripts ci: ensure manual Fuzz Test use local built image (#1637) 2025-09-19 15:48:38 +00:00
templates/go-server feat: use db as source in model catalog (#1667) 2025-10-01 11:58:33 +00:00
test feat(csi): improve CSI logging (#1540) 2025-09-03 13:49:03 +00:00
.dockerignore More controlled environment in the build (#52) 2024-04-12 07:38:48 +00:00
.gitattributes fix: force line endings to LF (#1290) 2025-07-10 16:16:53 +00:00
.gitignore fix(catalog): add missing metadataType values in test catalog YAML (#1634) 2025-09-19 06:00:35 +00:00
.openapi-generator-ignore Initial Model Catalog API (#1209) 2025-06-24 15:34:15 +00:00
.pre-commit-config.yaml Automate openapi server generation (#308) 2024-02-15 11:17:29 +01:00
.readthedocs.yaml Add readthedocs config (#137) 2024-06-28 14:51:41 +00:00
ADOPTERS.md docs: refine ADOPTERS.md description (#1150) 2025-05-27 09:51:32 +00:00
CONTRIBUTING.md docs: add suggestion to add coreutils (#1156) 2025-05-27 09:53:51 +00:00
Dockerfile Unescape catalog model names / publish catalog openapi client (#1555) 2025-09-09 09:44:37 +00:00
Dockerfile.odh chore: move to more general purpose tag for go 1.24 (#1355) 2025-07-21 14:37:59 +00:00
LICENSE Initial commit 2023-09-15 12:55:39 -05:00
Makefile feat: add go.work.sum update check to prepare workflow (#1650) 2025-09-23 09:06:18 +00:00
OWNERS chore: add myself as reviewer (#1282) 2025-07-08 18:29:51 +00:00
README.md docs: add OpenSSF ScoreCard link in README (#1618) 2025-09-17 11:01:34 +00:00
RELEASE.md Update RELEASE.md (#1682) 2025-09-30 15:23:34 +00:00
ROADMAP.md docs: document ROADMAP.md per current process (#1110) 2025-05-16 10:57:23 +00:00
SECURITY.md feat(docs): Guide to report security vulnerabilities (#1301) 2025-07-16 15:22:40 +00:00
docker-compose-local.yaml Merge model-catalog-enhancements branch (#1656) 2025-10-01 10:47:33 +00:00
docker-compose.yaml Merge model-catalog-enhancements branch (#1656) 2025-10-01 10:47:33 +00:00
go.mod feat: use db as source in model catalog (#1667) 2025-10-01 11:58:33 +00:00
go.sum build(deps): bump github.com/testcontainers/testcontainers-go/modules/postgres from 0.38.0 to 0.39.0 (#1640) 2025-09-24 16:35:44 +00:00
go.work Unescape catalog model names / publish catalog openapi client (#1555) 2025-09-09 09:44:37 +00:00
go.work.sum Upgrade ginkgo to 2.25.1 (#1534) 2025-08-29 12:40:23 +00:00
main.go ci: ensure manual Fuzz Test use local built image (#1637) 2025-09-19 15:48:38 +00:00
openapitools.json Refactor model registry openapi definition. (#66) 2023-10-18 09:15:17 -07:00
tilt-controller.dockerfile build(deps): bump alpine from 3.21 to 3.22 (#1175) 2025-06-10 08:48:52 +00:00
tilt-ui.dockerfile build(deps): bump alpine from 3.21 to 3.22 (#1175) 2025-06-10 08:48:52 +00:00
tilt.dockerfile build(deps): bump alpine from 3.21 to 3.22 (#1175) 2025-06-10 08:48:52 +00:00

README.md

Model Registry

build checks status codecov FOSSA Status OpenSSF Best Practices OpenSSF Scorecard

Model registry provides a central repository for model developers to store and manage models, versions, and artifacts metadata.

Red Hat's Pledge

  • Red Hat drives the project's development through Open Source principles, ensuring transparency, sustainability, and community ownership.
  • Red Hat values the Kubeflow community and commits to providing a minimum of 12 months' notice before ending project maintenance after the initial release.

Alpha

This Kubeflow component has alpha status with limited support. See the Kubeflow versioning policies. The Kubeflow team is interested in your feedback about the usability of the feature.

  1. Introduction
  1. Installation
  1. Concepts
  1. Python client
  1. Tutorials
  1. FAQs
  2. Development
  1. UI

Pre-requisites:

OpenAPI Proxy Server

The model registry proxy server implementation follows a contract-first approach, where the contract is identified by model-registry.yaml OpenAPI specification.

You can also easily display the latest OpenAPI contract for model-registry in a Swagger-like editor directly from the documentation site, here.

Starting the OpenAPI Proxy Server

Run the following command to start the OpenAPI proxy server from source:

make run/proxy

The proxy service implements the OpenAPI defined in model-registry.yaml to create a Model Registry specific REST API.

Model registry logical model

For a high-level documentation of the Model Registry logical model, please check this guide.

Model Registry Core

The model registry core is the layer which implements the core/business logic by interacting with the underlying datastore internal service. It provides a model registry domain-specific api that is in charge to proxy all, appropriately transformed, requests to the datastore internal service.

Model registry library

For more background on Model Registry Go core library and instructions on using it, please check getting started guide.

Development

Database Schema Changes

When making changes to the database schema, you need to regenerate the GORM structs. This is done using the gen/gorm target:

make gen/gorm

This target will:

  1. Start a temporary database
  2. Run migrations
  3. Generate GORM structs based on the schema
  4. Clean up the temporary database

NOTE: The target requires Docker to be running.

Building

Run the following command to build the server binary:

make build

The generated binary uses spf13 cmdline args. More information on using the server can be obtained by running the command:

./model-registry --help

Run the following command to clean the server binary, generated models and etc.:

make clean

Testing

Run the following command to trigger all tests:

make test

or, to see the statement coverage:

make test-cover

Docker Image

Building the docker image

The following command builds a docker image for the server with the tag model-registry:

docker build -t model-registry .

Note that the first build will be longer as it downloads the build tool dependencies. Subsequent builds will re-use the cached tools layer.

Running the proxy server

The following command starts the proxy server:

docker run -d -p <hostname>:<port>:8080 --user <uid>:<gid> --name server model-registry proxy -n 0.0.0.0

Where, <uid>, <gid>, and <host-path> are the same as in the migrate command above. And <hostname> and <port> are the local ip and port to use to expose the container's default 8080 listening port. The server listens on localhost by default, hence the -n 0.0.0.0 option allows the server port to be exposed.

Running model registry

NOTE: Docker Compose or Podman Compose must be installed in your environment.

There are two docker-compose files that make the startup easier:

  • docker-compose.yaml - Uses pre-built images from registry
  • docker-compose-local.yaml - Builds model registry from source

Both files support MySQL and PostgreSQL databases using profiles.

The easiest way to run the services is using the provided Makefile targets:

# Start with MySQL (using pre-built images)
make compose/up

# Start with PostgreSQL (using pre-built images)  
make compose/up/postgres

# Start with MySQL (builds from source)
make compose/local/up

# Start with PostgreSQL (builds from source)
make compose/local/up/postgres

# Stop services
make compose/down  # or compose/local/down

# Clean up all volumes and networks
make compose/clean

Manual docker-compose usage

Alternatively, you can run the compose files directly:

# Using pre-built images with MySQL
docker-compose --profile mysql up

# Using pre-built images with PostgreSQL  
DB_TYPE=postgres docker-compose --profile postgres up

# Building from source with PostgreSQL
DB_TYPE=postgres docker-compose -f docker-compose-local.yaml --profile postgres up

The Makefile automatically detects whether to use docker-compose, podman-compose, or docker compose based on what's available on your system.

Testing architecture

The following diagram illustrates testing strategy for the several components in Model Registry project:

Go layers components are tested with Unit Tests written in Go, as well as Integration Tests leveraging Testcontainers. This allows to verify the expected "Core layer" of logical data mapping developed and implemented in Go, matches technical expectations.

Python client is also tested with Unit Tests and Integration Tests written in Python.

End-to-end testing is developed with KinD and Pytest; this higher-lever layer of testing is used to demonstrate User Stories from high level perspective.

Model Catalog Service

Kubernetes Components

  • Controller - Kubernetes controller for model registry CRDs
  • CSI Driver - Container Storage Interface for model artifacts

Client Components

Job Components

Development & Deployment

FAQ

How do I delete metadata resources using the Model Registry API?

MR utilizes a common ARCHIVED status for all types. To delete something, simply update its status.

Tips

Pull image rate limiting

Occasionally you may encounter an 'ImagePullBackOff' error when deploying the Model Registry manifests. See example below for the model-registry-db container.

Failed to pull image “mysql:8.3.0”: rpc error: code = Unknown desc = fetching target platform image selected from image index: reading manifest sha256:f9097d95a4ba5451fff79f4110ea6d750ac17ca08840f1190a73320b84ca4c62 in docker.io/library/mysql: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

This error is triggered by the rate limits from docker.io; in this example specifically about the image mysql:8.3.0 (the expanded reference is docker.io/library/mysql:8.3.0). To mitigate this error you could authenticate using image pull secrets for local development; or replace the image used with alternative mirrored images, for instance with the following example:

manifests/kustomize/overlays/db/model-registry-db-deployment.yaml file.

spec.template.spec.containers.image: public.ecr.aws/docker/library/mysql:8.3.0