You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
10
14
11
-
## sources.yaml Configuration
15
+
```sh
16
+
kubectl apply -k base -n <your-namespace>
17
+
```
12
18
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.
14
20
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
16
27
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:
18
29
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
+
```
23
33
24
-
### Catalog Source Types
34
+
##Configuring Catalog Sources
25
35
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.
27
37
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.
29
39
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.
31
91
32
-
##### Properties
33
92
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:*`).
36
93
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
38
113
39
114
```yaml
40
115
catalogs:
@@ -49,27 +124,6 @@ catalogs:
49
124
- model-b:*
50
125
```
51
126
52
-
#### `rhec`
53
-
54
-
The `rhec` type sources model metadata from the Red Hat Ecosystem Catalog.
127
+
### Sample Catalog File
55
128
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.
0 commit comments