Skip to content

Commit eec5c44

Browse files
committed
Update kubeflow/model-registry manifests from v0.3.2
Signed-off-by: tarilabs <[email protected]>
1 parent 3247f52 commit eec5c44

19 files changed

+269
-74
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This repository periodically synchronizes all official Kubeflow components from
7171
| KServe | applications/kserve/kserve | [v0.15.0](https://github.com/kserve/kserve/releases/tag/v0.15.0/install/v0.15.0) | 600m | 1200Mi | 0GB |
7272
| KServe Models Web Application | applications/kserve/models-web-app | [v0.15.0](https://github.com/kserve/models-web-app/tree/v0.15.0/config) | 6m | 259Mi | 0GB |
7373
| Kubeflow Pipelines | applications/pipeline/upstream | [2.14.3](https://github.com/kubeflow/pipelines/tree/2.14.3/manifests/kustomize) | 970m | 3552Mi | 35GB |
74-
| Kubeflow Model Registry | applications/model-registry/upstream | [v0.3.0](https://github.com/kubeflow/model-registry/tree/v0.3.0/manifests/kustomize) | 510m | 2112Mi | 20GB |
74+
| Kubeflow Model Registry | applications/model-registry/upstream | [v0.3.2](https://github.com/kubeflow/model-registry/tree/v0.3.2/manifests/kustomize) | 510m | 2112Mi | 20GB |
7575
| Spark Operator | applications/spark/spark-operator | [2.3.0](https://github.com/kubeflow/spark-operator/tree/v2.3.0) | 9m | 41Mi | 0GB |
7676
| Istio | common/istio | [1.27.0](https://github.com/istio/istio/releases/tag/1.27.0) | 750m | 2364Mi | 0GB |
7777
| Knative | common/knative/knative-serving <br /> common/knative/knative-eventing | [v1.16.2](https://github.com/knative/serving/releases/tag/knative-v1.16.2) <br /> [v1.16.4](https://github.com/knative/eventing/releases/tag/knative-v1.16.4) | 1450m | 1038Mi | 0GB |

applications/model-registry/upstream/base/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ resources:
88
images:
99
- name: ghcr.io/kubeflow/model-registry/server
1010
newName: ghcr.io/kubeflow/model-registry/server
11-
newTag: v0.3.0
11+
newTag: v0.3.2
Lines changed: 96 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,115 @@
11
# Model Catalog Manifests
22

3-
To deploy the model catalog:
3+
This directory contains manifests for deploying the Model Catalog using Kustomize.
4+
5+
## Deployment
6+
7+
The model catalog manifests deploy a PostgreSQL database, set `POSTGRES_PASSWORD` in `postgres.env` before deploying the manifests. On Linux, you can generate a random password with:
48

59
```sh
6-
kubectl apply -k . -n NAMESPACE
10+
(echo POSTGRES_USER=postgres ; echo -n POSTGRES_PASSWORD=; dd if=/dev/random of=/dev/stdout bs=15 count=1 status=none | base64) >base/postgres.env
711
```
812

9-
Replace `NAMESPACE` with your desired Kubernetes namespace.
13+
To deploy the Model Catalog to your Kubernetes cluster (without Kubeflow--see below for Istio support), run the following command from this directory:
1014

11-
## sources.yaml Configuration
15+
```sh
16+
kubectl apply -k base -n <your-namespace>
17+
```
1218

13-
The `sources.yaml` file configures the model catalog sources. It contains a top-level `catalogs` list, where each entry defines a single catalog source.
19+
Replace `<your-namespace>` with the Kubernetes namespace where you want to deploy the catalog.
1420

15-
### Common Properties
21+
This command will create:
22+
* A `Deployment` to run the Model Catalog server.
23+
* A `Service` to expose the Model Catalog server.
24+
* A `ConfigMap` named `model-catalog-sources` containing the configuration for the catalog sources.
25+
* A `StatefulSet` with a PostgreSQL database
26+
* A `PersistentVolumeClaim` for PostgreSQL
1627

17-
Each catalog source entry supports the following common properties:
28+
For deployment in a Kubeflow environment with Istio support, use the `overlay` directory instead:
1829

19-
- **`name`** (*string*, required): A user-friendly name for the catalog source.
20-
- **`id`** (*string*, required): A unique identifier for the catalog source.
21-
- **`type`** (*string*, required): The type of catalog source. Supported values are `yaml` and `rhec`.
22-
- **`enabled`** (*boolean*, optional): Whether the catalog source is enabled. Defaults to `true` if not specified.
30+
```sh
31+
kubectl apply -k overlay -n <your-namespace>
32+
```
2333

24-
### Catalog Source Types
34+
## Configuring Catalog Sources
2535

26-
Below are the supported catalog source types and their specific `properties`.
36+
The Model Catalog is configured via the `sources.yaml` file. This file is **not** a Kubernetes manifest itself, but rather a configuration file for the application.
2737

28-
#### `yaml`
38+
When you run `kubectl apply -k .`, Kustomize generates a `ConfigMap` that includes `sources.yaml` and any referenced local YAML catalog files. This `ConfigMap` is then mounted into the Model Catalog pod, making the files available to the application.
2939

30-
The `yaml` type sources model metadata from a local YAML file.
40+
### Adding your own YAML-based catalog
41+
42+
You can define your own model catalog by providing a YAML file with model definitions. Here's how to add your own catalog source:
43+
44+
1. **Create your catalog definition file.** Create a new YAML file with your model definitions. You can use `sample-catalog.yaml` as a reference for the format. Let's say you name it `my-catalog.yaml` and place it in this directory.
45+
46+
2. **Add your file to the ConfigMap.** Edit `kustomization.yaml` to include your new file in the `configMapGenerator`:
47+
48+
```yaml
49+
# kustomization.yaml
50+
...
51+
configMapGenerator:
52+
- behavior: create
53+
files:
54+
- sources.yaml=sources.yaml
55+
- sample-catalog.yaml=sample-catalog.yaml
56+
- my-catalog.yaml=my-catalog.yaml # <-- Add your file here
57+
name: sources
58+
options:
59+
disableNameSuffixHash: true
60+
```
61+
62+
3. **Add a new source entry.** Edit `sources.yaml` to add a new entry for your catalog under the `catalogs` list.
63+
64+
```yaml
65+
# sources.yaml
66+
catalogs:
67+
- name: Sample Catalog
68+
id: sample_custom_catalog
69+
type: yaml
70+
enabled: true
71+
properties:
72+
yamlCatalogPath: sample-catalog.yaml
73+
- name: My Custom Catalog
74+
id: my_custom_catalog
75+
type: yaml
76+
enabled: true
77+
properties:
78+
yamlCatalogPath: my-catalog.yaml # <-- Path to your file
79+
```
80+
The `yamlCatalogPath` must be the filename of your catalog definition, as it will be mounted into the same directory as `sources.yaml` inside the pod.
81+
82+
4. **Apply the changes.**
83+
84+
```sh
85+
kubectl apply -k . -n <your-namespace>
86+
```
87+
88+
### Multiple Catalog Sources
89+
90+
The Model Catalog can be configured with multiple sources. You can add multiple entries to the `catalogs` list in `sources.yaml`. The catalog application only loads the single `sources.yaml` file specified at startup, so all sources must be defined within that file.
3191

32-
##### Properties
3392

34-
- **`yamlCatalogPath`** (*string*, required): The path to the YAML file containing the model definitions. This path is relative to the directory where the `sources.yaml` file is located.
35-
- **`excludedModels`** (*string list*, optional): A list of models to exclude from the catalog. These can be an exact name with a tag (e.g., `model-a:1.0`) or a pattern ending with `*` to exclude all tags for a repository (e.g., `model-b:*`).
3693

37-
##### Example
94+
### Catalog Source Configuration Details
95+
96+
Each entry in the `catalogs` list configures a single catalog source.
97+
98+
#### Common Properties
99+
100+
- **`name`** (*string*, required): A user-friendly name for the catalog source.
101+
- **`id`** (*string*, required): A unique identifier for the catalog source.
102+
- **`type`** (*string*, required): The type of catalog source. Currently supported types are: `yaml`.
103+
- **`enabled`** (*boolean*, optional): Whether the catalog source is enabled. Defaults to `true`.
104+
105+
#### `yaml` source type properties
106+
107+
The `yaml` type sources model metadata from a local YAML file.
108+
109+
- **`yamlCatalogPath`** (*string*, required): The path to the YAML file containing the model definitions. This file must be available in the `ConfigMap` alongside `sources.yaml`.
110+
- **`excludedModels`** (*string list*, optional): A list of models to exclude from the catalog. These can be an exact name with a tag (e.g., `model-a:1.0`) or a pattern ending with `*` to exclude all tags for a model (e.g., `model-b:*`).
111+
112+
##### Example `sources.yaml` entry
38113

39114
```yaml
40115
catalogs:
@@ -49,27 +124,6 @@ catalogs:
49124
- model-b:*
50125
```
51126

52-
#### `rhec`
53-
54-
The `rhec` type sources model metadata from the Red Hat Ecosystem Catalog.
127+
### Sample Catalog File
55128

56-
##### Properties
57-
58-
- **`models`** (*string list*, required): A list of models to include from the Red Hat Ecosystem Catalog. Each entry contains the full name of the model repository in the Red Hat Ecosystem Catalog (e.g., `rhelai1/modelcar-granite-7b-starter`).
59-
- **`excludedModels`** (*string list*, optional): A list of models to exclude from the catalog. These can be an exact name with a tag (e.g., `rhelai1/modelcar-granite-7b-starter:b9514c3`) or a pattern ending with `*` to exclude all tags for a repository (e.g., `rhelai1/modelcar-granite-7b-starter:*`).
60-
61-
##### Example
62-
63-
```yaml
64-
catalogs:
65-
- name: Red Hat Ecosystem Catalog
66-
id: sample_rhec_catalog
67-
type: rhec
68-
enabled: true
69-
properties:
70-
models:
71-
- rhelai1/modelcar-granite-7b-starter
72-
excludedModels:
73-
- rhelai1/modelcar-granite-7b-starter:v0
74-
- rhelai1/modelcar-granite-*
75-
```
129+
You can refer to `sample-catalog.yaml` in this directory for an example of how to structure your model definitions file.

applications/model-registry/upstream/options/catalog/deployment.yaml renamed to applications/model-registry/upstream/options/catalog/base/deployment.yaml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: server
4+
name: model-catalog-server
55
labels:
6-
component: model-catalog-server
6+
app.kubernetes.io/name: model-catalog
7+
app.kubernetes.io/part-of: model-catalog
8+
app.kubernetes.io/component: server
79
spec:
810
replicas: 1
911
selector:
1012
matchLabels:
11-
component: model-catalog-server
13+
app.kubernetes.io/name: model-catalog
14+
app.kubernetes.io/part-of: model-catalog
15+
app.kubernetes.io/component: server
1216
template:
1317
metadata:
1418
labels:
1519
sidecar.istio.io/inject: "true"
16-
component: model-catalog-server
20+
app.kubernetes.io/name: model-catalog
21+
app.kubernetes.io/part-of: model-catalog
22+
app.kubernetes.io/component: server
1723
spec:
1824
securityContext:
1925
seccompProfile:
@@ -25,6 +31,19 @@ spec:
2531
name: model-catalog-sources
2632
containers:
2733
- name: catalog
34+
env:
35+
- name: PGHOST
36+
value: model-catalog-postgres
37+
- name: PGUSER
38+
valueFrom:
39+
secretKeyRef:
40+
name: model-catalog-postgres
41+
key: POSTGRES_USER
42+
- name: PGPASSWORD
43+
valueFrom:
44+
secretKeyRef:
45+
name: model-catalog-postgres
46+
key: POSTGRES_PASSWORD
2847
command:
2948
- /model-registry
3049
- catalog
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33

4-
namePrefix: model-catalog-
5-
64
resources:
75
- deployment.yaml
86
- service.yaml
7+
- postgres-statefulset.yaml
8+
- postgres-pvc.yaml
9+
- postgres-service.yaml
910

1011
configMapGenerator:
1112
- behavior: create
1213
files:
1314
- sources.yaml=sources.yaml
1415
- sample-catalog.yaml=sample-catalog.yaml
15-
name: sources
16+
name: model-catalog-sources
17+
options:
18+
disableNameSuffixHash: true
19+
20+
secretGenerator:
21+
- envs:
22+
- postgres.env
23+
name: model-catalog-postgres
1624
options:
1725
disableNameSuffixHash: true
1826
images:
1927
- name: ghcr.io/kubeflow/model-registry/server
2028
newName: ghcr.io/kubeflow/model-registry/server
21-
newTag: v0.3.0
29+
newTag: v0.3.2
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: model-catalog-postgres
5+
spec:
6+
accessModes:
7+
- ReadWriteOnce
8+
resources:
9+
requests:
10+
storage: 5Gi
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
kind: Service
2+
apiVersion: v1
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: model-catalog
6+
app.kubernetes.io/part-of: model-catalog
7+
app.kubernetes.io/component: database
8+
name: model-catalog-postgres
9+
spec:
10+
selector:
11+
app.kubernetes.io/part-of: model-catalog
12+
app.kubernetes.io/name: postgres
13+
app.kubernetes.io/component: database
14+
type: ClusterIP
15+
ports:
16+
- port: 5432
17+
protocol: TCP
18+
name: postgres
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: model-catalog-postgres
5+
labels:
6+
component: model-catalog-server
7+
spec:
8+
selector:
9+
matchLabels:
10+
app.kubernetes.io/name: postgres
11+
app.kubernetes.io/part-of: model-catalog
12+
replicas: 1
13+
template:
14+
metadata:
15+
name: postgres
16+
labels:
17+
app.kubernetes.io/name: postgres
18+
app.kubernetes.io/part-of: model-catalog
19+
app.kubernetes.io/component: database
20+
sidecar.istio.io/inject: "false"
21+
spec:
22+
securityContext:
23+
seccompProfile:
24+
type: RuntimeDefault
25+
runAsNonRoot: true
26+
fsGroup: 70
27+
containers:
28+
- name: postgres
29+
image: postgres:17.6
30+
env:
31+
- name: PGDATA
32+
value: /var/lib/postgresql/data/pgdata
33+
envFrom:
34+
- secretRef:
35+
name: model-catalog-postgres
36+
ports:
37+
- name: postgres
38+
containerPort: 5432
39+
volumeMounts:
40+
- name: model-catalog-postgres
41+
mountPath: /var/lib/postgresql/data
42+
securityContext:
43+
runAsUser: 70
44+
runAsGroup: 70
45+
allowPrivilegeEscalation: false
46+
capabilities:
47+
drop:
48+
- ALL
49+
volumes:
50+
- name: model-catalog-postgres
51+
persistentVolumeClaim:
52+
claimName: model-catalog-postgres
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
POSTGRES_USER=postgres
2+
POSTGRES_PASSWORD=postgres

0 commit comments

Comments
 (0)