Skip to content

Commit afa801e

Browse files
authored
RHDHPAI-1089: RHOAI Model catalog bridge (#1478)
* Fixed merge conflicts * title-related changes * Incorporated Gabe's comments * Added links to RHOAI * Incorporated Stephen's comments * Incorporated Ben's comments * Incorporated Gabe's comments * Updating links * Incorporated Judy's comments and Ben's * Updated model registry bridge mentions to the new product name * Incorporated Ben's comments and Gabe's comments
1 parent 2b075cd commit afa801e

16 files changed

+579
-0
lines changed

artifacts/attributes.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
:rhdeveloper-name: Red Hat Developer
6666
:rhel: Red Hat Enterprise Linux
6767
:rhoai-brand-name: Red Hat OpenShift AI
68+
:rhoai-short: RHOAI
6869
:rhoserverless-brand-name: Red Hat OpenShift Serverless
6970
:rhsso-brand-name: Red Hat Single-Sign On
7071
:rhsso: RHSSO
@@ -171,8 +172,17 @@
171172
:plugin-type-name: custom
172173
:plugin-type-name-uppercase: Custom
173174

175+
174176
:scorecard-plugin-book-link: {product-docs-link}/html-single/understand_and_visualize_red_hat_developer_hub_project_health_using_scorecards/index
175177
:scorecard-plugin-book-title: Understand and visualize {product} project health using Scorecards
176178

177179
:model-context-protocol-link: {product-docs-link}/html-single/interacting_with_model_context_protocol_tools_for_red_hat_developer_hub/index
178180
:model-context-protocol-title: Interacting with Model Context Protocol tools for {product}
181+
182+
:openshift-ai-connector-for-rhdh-link: {product-docs-link}/html-single/integrating_rhdh_with_openshift_ai_connector_for_rhdh/index
183+
:openshift-ai-connector-for-rhdh-title: Integrate {product} with {openshift-ai-connector-name} to leverage AI models
184+
185+
:openshift-ai-connector-name: OpenShift AI Connector for {product}
186+
:openshift-ai-connector-name-short: OpenShift AI Connector for {product-very-short}
187+
188+
:rhoai-docs-link: link:https://docs.redhat.com/en/documentation/red_hat_openshift_ai_self-managed/2.25/html-single
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[IMPORTANT]
2+
====
3+
This section describes Developer Preview features in the {openshift-ai-connector-name} plugin. Developer Preview features are not supported by Red Hat in any way and are not functionally complete or production-ready. Do not use Developer Preview features for production or business-critical workloads. Developer Preview features provide early access to functionality in advance of possible inclusion in a Red Hat product offering. Customers can use these features to test functionality and provide feedback during the development process. Developer Preview features might not have any documentation, are subject to change or removal at any time, and have received limited testing. Red Hat might provide ways to submit feedback on Developer Preview features without an associated SLA.
4+
5+
For more information about the support scope of Red Hat Developer Preview features, see https://access.redhat.com/support/offerings/devpreview/[Developer Preview Support Scope].
6+
====
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:_mod-docs-content-type: CONCEPT
2+
3+
[id="con-understand-how-ai-assets-map-to-rhdh-catalog_{context}"]
4+
= Understand how AI assets map to the {product} Catalog
5+
6+
include::{docdir}/artifacts/snip-developer-preview-rhoai.adoc[]
7+
8+
The {openshift-ai-connector-name} ({openshift-ai-connector-name-short}) serves as a crucial link, enabling the discovery and accessibility of AI assets managed within the {rhoai-brand-name} offering directly within your {product-very-short} instance.
9+
10+
For more information on model registry components, see {rhoai-docs-link}/enabling_the_model_registry_component/index#overview-of-model-registries_model-registry-config[Overview of model registries and model catalog].
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="proc-populating-the-api-definition-tab_{context}"]
4+
= Populating the API Definition tab in {product-very-short} API entities
5+
6+
Since {rhoai-short} does not expose the OpenAPI specification by default, the AI platform engineer can take the following steps to provide this valuable information:
7+
8+
.Procedure
9+
10+
. Retrieve OpenAPI JSON: Use a tool like `curl` to fetch the specification directly from the running endpoint of the AI model server. The following command provides the precise endpoint (`/openapi.json`) and shows how to include a `Bearer` token if the model requires authentication for access.
11+
+
12+
[source,bash]
13+
----
14+
curl -k -H "Authorization: Bearer $MODEL_API_KEY" https://$MODEL_ROOT_URL_INCLUDING_PORT/openapi.json | jq > open-api.json
15+
----
16+
17+
. Set Property in {rhoai-short}.
18+
.. In the *{rhoai-short}* dashboard, go to *Model Registry* and select the appropriate *Model Version*.
19+
+
20+
[NOTE]
21+
====
22+
We recommend using *Model Version* instead of *Registered Model* to maintain stability if the API changes between versions.
23+
====
24+
25+
.. In the **Properties** section, set a key/value pair where the key is `API Spec` and the value is the entire JSON content from the `open-api.json` file.
26+
27+
. Propagation: The {openshift-ai-connector-name} periodically polls the {rhoai-short} Model Registry, propagates this JSON, and renders the interactive API documentation in the *Definition* tab of the {product-very-short} API entity.
Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
[id="proc-setting-up-openshift-ai-connector-for-rhdh-with-rhoai_{context}"]
4+
= Setting up {openshift-ai-connector-name} with {rhoai-brand-name}
5+
6+
The installation of the {openshift-ai-connector-name} requires manual updates to {product-very-short}-related Kubernetes resources.
7+
8+
.{rhoai-short} Prerequisites
9+
10+
* To import model cards from the model catalog into TechDocs, you must use {rhoai-short} 2.25.
11+
+
12+
[NOTE]
13+
====
14+
If you upgraded to {rhoai-short} 2.25 from an earlier version, you must manually enable the model catalog dashboard and model registry before you can import model cards.
15+
====
16+
17+
* If you used the model catalog in earlier versions of {rhoai-short}, TechDocs propagation does not work for any models you registered into the model registry while at those earlier versions; only models registered into model registry from a {rhoai-short} 2.25 model catalog have their model cards transferred to {product-very-short} as TechDocs.
18+
19+
* For the rest of the features, version 2.20 or later suffices. Enabling model registry and its associated dashboard allows for a user experience that more directly allows for customizing AI Model metadata.
20+
For best overall experience, {rhoai-short} 2.25 is recommended.
21+
22+
For more details, see {rhoai-docs-link}/enabling_the_model_registry_component/index[Enabling the model registry component].
23+
24+
.Procedure
25+
26+
. Configure {rhoai-short}-related RBAC and credentials.
27+
A Kubernetes `ServiceAccount` and a `service-account-token` Secret are required for the connector to retrieve data from {rhoai-short}. The following resources must be created, replacing namespace names (`ai-rhdh` for {product-very-short}, `rhoai-model-registries` for {rhoai-short}) as needed:
28+
** `ServiceAccount` (`rhdh-rhoai-connector`). For example:
29+
+
30+
[source,yaml]
31+
----
32+
apiVersion: v1
33+
kind: ServiceAccount
34+
metadata:
35+
name: rhdh-rhoai-connector
36+
namespace: ai-rhdh
37+
----
38+
** `ClusterRole` and `ClusterRoleBinding` (`rhdh-rhoai-connector`) to allow access to OCP resources like `routes`, `services`, and `inferenceservices`. For example:
39+
+
40+
[source,yaml]
41+
----
42+
# Example for `ClusterRole`
43+
apiVersion: rbac.authorization.k8s.io/v1
44+
kind: ClusterRole
45+
metadata:
46+
name: rhdh-rhoai-connector
47+
annotations:
48+
argocd.argoproj.io/sync-wave: "0"
49+
rules:
50+
- apiGroups:
51+
- apiextensions.k8s.sio
52+
resources:
53+
- customresourcedefinitions
54+
verbs:
55+
- get
56+
- apiGroups:
57+
- route.openshift.io
58+
resources:
59+
- routes
60+
verbs:
61+
- get
62+
- list
63+
- watch
64+
- apiGroups: [""]
65+
resources:
66+
- serviceaccounts
67+
- services
68+
verbs:
69+
- get
70+
- list
71+
- watch
72+
73+
- apiGroups: ["serving.kserve.io"]
74+
resources: ["inferenceservices"]
75+
verbs: ["get", "list", "watch"]
76+
----
77+
+
78+
[source,yaml]
79+
----
80+
# Example for `ClusterRoleBinding`
81+
apiVersion: rbac.authorization.k8s.io/v1
82+
kind: ClusterRoleBinding
83+
metadata:
84+
name: rhdh-rhoai-connector
85+
roleRef:
86+
apiGroup: rbac.authorization.k8s.io
87+
kind: ClusterRole
88+
name: rhdh-rhoai-connector
89+
subjects:
90+
- kind: ServiceAccount
91+
name: rhdh-rhoai-connector
92+
namespace: ai-rhdh
93+
----
94+
** `Role` and `RoleBinding` to allow ConfigMap updates within the {product-very-short} namespace. For example:
95+
+
96+
[source,yaml]
97+
----
98+
# Example for `Role`
99+
apiVersion: rbac.authorization.k8s.io/v1
100+
kind: Role
101+
metadata:
102+
name: rhdh-rhoai-connector
103+
namespace: ai-rhdh
104+
rules:
105+
- apiGroups: [""]
106+
resources: ["configmaps"]
107+
verbs: ["get", "list", "watch", "create", "update", "patch"]
108+
----
109+
+
110+
[source,yaml]
111+
----
112+
# Example for `RoleBinding`
113+
apiVersion: rbac.authorization.k8s.io/v1
114+
kind: RoleBinding
115+
metadata:
116+
name: rhdh-rhoai-dashboard-permissions
117+
namespace: rhoai-model-registries
118+
roleRef:
119+
apiGroup: rbac.authorization.k8s.io
120+
kind: Role
121+
name: registry-user-modelregistry-public
122+
subjects:
123+
- apiGroup: rbac.authorization.k8s.io
124+
kind: Group
125+
name: system:serviceaccounts:ai-rhdh
126+
----
127+
** `RoleBinding` in the {rhoai-short} namespace to grant the {product-very-short} `ServiceAccount` read permissions to the model registry data (binding to `registry-user-modelregistry-public`).
128+
+
129+
[source,yaml]
130+
----
131+
apiVersion: rbac.authorization.k8s.io/v1
132+
kind: RoleBinding
133+
metadata:
134+
name: rhdh-rhoai-connector
135+
namespace: ai-rhdh
136+
roleRef:
137+
apiGroup: rbac.authorization.k8s.io
138+
kind: Role
139+
name: rhdh-rhoai-connector
140+
subjects:
141+
- kind: ServiceAccount
142+
name: rhdh-rhoai-connector
143+
namespace: ai-rhdh
144+
----
145+
** Secret (`rhdh-rhoai-connector-token`) of type `kubernetes.io/service-account-token` that goes along with the `rhdh-rhoai-connector` `ServiceAccount`.
146+
+
147+
[source,yaml]
148+
----
149+
apiVersion: v1
150+
kind: Secret
151+
metadata:
152+
name: rhdh-rhoai-connector-token
153+
namespace: ai-rhdh
154+
annotations:
155+
kubernetes.io/service-account.name: rhdh-rhoai-connector
156+
type: kubernetes.io/service-account-token
157+
----
158+
159+
. Update your {product-very-short} dynamic plugin configuration.
160+
The {product-very-short} Pod requires two dynamic plugins.
161+
.. In your {product-very-short} dynamic plugins ConfigMap, add the following code:
162+
+
163+
[source,yaml]
164+
----
165+
plugins:
166+
- disabled: false
167+
package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-catalog-backend-module-model-catalog:bs_1.42.5__0.7.0!red-hat-developer-hub-backstage-plugin-catalog-backend-module-model-catalog
168+
- disabled: false
169+
package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-catalog-techdoc-url-reader-backend:bs_1.42.5__0.3.0!red-hat-developer-hub-backstage-plugin-catalog-techdoc-url-reader-backend
170+
----
171+
172+
. Add the `Connector` sidecar containers to the {product-very-short} Pod.
173+
** If {product-very-short} was installed using the Operator, modify your {product-very-short} custom resource (CR) instance.
174+
** If {product-very-short} was installed using the Helm charts, modify the *Deployment* specification.
175+
176+
. The system relies on three sidecar containers ({openshift-ai-connector-name}) running alongside the `backstage-backend` container. Add these sidecar containers to your configuration referencing the `rhdh-rhoai-connector-token` Secret:
177+
** `location`: Provides the REST API for {product-very-short} plugins to fetch model metadata.
178+
** `storage-rest`: Maintains a cache of AI Model metadata in a ConfigMap called `bac-import-model`.
179+
** `rhoai-normalizer`: Acts as a Kubernetes controller and {rhoai-short} client, normalizing {rhoai-short} metadata for the connector. The following code block is an example:
180+
+
181+
[source,yaml]
182+
----
183+
spec:
184+
template:
185+
spec:
186+
containers:
187+
- name: backstage-backend
188+
- env:
189+
- name: NORMALIZER_FORMAT
190+
value: JsonArrayFormat
191+
- name: POD_IP
192+
valueFrom:
193+
fieldRef:
194+
fieldPath: status.podIP
195+
- name: POD_NAMESPACE
196+
valueFrom:
197+
fieldRef:
198+
fieldPath: metadata.namespace
199+
envFrom:
200+
- secretRef:
201+
name: rhdh-rhoai-connector-token
202+
image: quay.io/redhat-ai-dev/model-catalog-location-service@sha256:4f6ab6624a29f627f9f861cfcd5d18177d46aa2c67a81a75a1502c49bc2ff012
203+
204+
imagePullPolicy: Always
205+
name: location
206+
ports:
207+
- containerPort: 9090
208+
name: location
209+
protocol: TCP
210+
volumeMounts:
211+
- mountPath: /opt/app-root/src/dynamic-plugins-root
212+
name: dynamic-plugins-root
213+
workingDir: /opt/app-root/src
214+
- env:
215+
- name: NORMALIZER_FORMAT
216+
value: JsonArrayFormat
217+
- name: STORAGE_TYPE
218+
value: ConfigMap
219+
- name: BRIDGE_URL
220+
value: http://localhost:9090
221+
- name: POD_IP
222+
valueFrom:
223+
fieldRef:
224+
fieldPath: status.podIP
225+
- name: POD_NAMESPACE
226+
valueFrom:
227+
fieldRef:
228+
fieldPath: metadata.namespace
229+
envFrom:
230+
- secretRef:
231+
name: rhdh-rhoai-connector-token
232+
image: quay.io/redhat-ai-dev/model-catalog-storage-rest@sha256:398095e7469e86d84b1196371286363f4b7668aa3e26370b4d78cb8d4ace1dc9
233+
234+
imagePullPolicy: Always
235+
name: storage-rest
236+
volumeMounts:
237+
- mountPath: /opt/app-root/src/dynamic-plugins-root
238+
name: dynamic-plugins-root
239+
workingDir: /opt/app-root/src
240+
- env:
241+
- name: NORMALIZER_FORMAT
242+
value: JsonArrayFormat
243+
- name: POD_IP
244+
valueFrom:
245+
fieldRef:
246+
fieldPath: status.podIP
247+
- name: POD_NAMESPACE
248+
valueFrom:
249+
fieldRef:
250+
fieldPath: metadata.namespace
251+
envFrom:
252+
- secretRef:
253+
name: rhdh-rhoai-connector-token
254+
image: quay.io/redhat-ai-dev/model-catalog-rhoai-normalizer@sha256:fe6c05d57495d6217c4d584940ec552c3727847ff60f39f5d04f94be024576d8
255+
256+
imagePullPolicy: Always
257+
name: rhoai-normalizer
258+
volumeMounts:
259+
- mountPath: /opt/app-root/src/dynamic-plugins-root
260+
name: dynamic-plugins-root
261+
workingDir: /opt/app-root/src
262+
----
263+
264+
. Enable `Connector` in your `{product-very-short}{my-app-config-file}` file.
265+
In your `{backstage} `app-config.extra.yaml` file, configure `Entity Provider` under the `catalog.providers` section:
266+
+
267+
[source,yaml]
268+
----
269+
providers:
270+
modelCatalog:
271+
development:
272+
baseUrl: http://localhost:9090
273+
----
274+
275+
where:
276+
277+
`modelCatalog`:: Specifies the name of the provider.
278+
`development`:: Defines future connector capability beyond a single `baseUrl`.
279+
`baseUrl`:: For Developer Preview, this value is the only one supported. Future releases might support external routes.

0 commit comments

Comments
 (0)