|
| 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 have Model Cards from the Model Catalog imported as Tech Docs, you must use {rhoai-short} version 2.25 or later, and the Model Catalog dashboard and a Model Registry need to be enabled (they are both off by default). |
| 11 | +* If you employed Model Catalog at earlier versions of {rhoai-short}, Tech Doc 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 2.25 (or later) Model Catalog have their Model Cards transferred to {product-very-short} as TechDocs. |
| 12 | +* 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. |
| 13 | + |
| 14 | +//connect with Lindsey to update the above prereqs |
| 15 | + |
| 16 | +.Procedure |
| 17 | + |
| 18 | +. Configure {rhoai-short}-related RBAC and credentials. |
| 19 | +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 {rhoa``}) as needed: |
| 20 | +** `ServiceAccount` (`rhdh-rhoai-bridge`) |
| 21 | +** `ClusterRole` and `ClusterRoleBinding` (`rhdh-rhoai-bridge`) to allow access to OCP resources like `routes`, `services`, and `inferenceservices`. |
| 22 | +** `Role` and `RoleBinding` to allow ConfigMap updates within the {product-very-short} namespace. |
| 23 | +** `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`). |
| 24 | +** Secret (`rhdh-rhoai-bridge-token`) of type `kubernetes.io/service-account-token` that goes along with the `rhdh-rhoai-bridge` `ServiceAccount`. |
| 25 | + |
| 26 | +. Update your {product-very-short} dynamic plugin configuration. |
| 27 | +The {product-very-short} Pod requires two dynamic plugins. |
| 28 | +.. In your {product-very-short} dynamic plugins ConfigMap, add the following code: |
| 29 | ++ |
| 30 | +[source,yaml] |
| 31 | +---- |
| 32 | +plugins: |
| 33 | + - disabled: false |
| 34 | + 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 |
| 35 | + - disabled: false |
| 36 | + 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 |
| 37 | +---- |
| 38 | + |
| 39 | +. Add Connector sidecar containers to the {product-very-short} Pod. |
| 40 | +The system relies on three sidecar containers (Model Catalog Bridge) running alongside the `backstage-backend` container. These sidecar containers must be added to your {product-very-short} deployment specification, referencing the `rhdh-rhoai-bridge-token` Secret: |
| 41 | +** `location`: Provides the REST API for RHDH plugins to fetch model metadata. |
| 42 | +** `storage-rest`: Maintains a cache of AI Model metadata in a ConfigMap called `bac-import-model`. |
| 43 | +** `rhoai-normalizer`: Acts as a Kubernetes controller and RHOAI client, normalizing RHOAI metadata for the connector. The following code block is an example: |
| 44 | ++ |
| 45 | +[source,yaml] |
| 46 | +---- |
| 47 | +spec: |
| 48 | + template: |
| 49 | + spec: |
| 50 | + containers: |
| 51 | + - name: backstage-backend |
| 52 | + - env: |
| 53 | + - name: NORMALIZER_FORMAT |
| 54 | + value: JsonArrayFormat |
| 55 | + - name: POD_IP |
| 56 | + valueFrom: |
| 57 | + fieldRef: |
| 58 | + fieldPath: status.podIP |
| 59 | + - name: POD_NAMESPACE |
| 60 | + valueFrom: |
| 61 | + fieldRef: |
| 62 | + fieldPath: metadata.namespace |
| 63 | + envFrom: |
| 64 | + - secretRef: |
| 65 | + name: rhdh-rhoai-bridge-token |
| 66 | + image: quay.io/redhat-ai-dev/model-catalog-location-service@sha256:4f6ab6624a29f627f9f861cfcd5d18177d46aa2c67a81a75a1502c49bc2ff012 |
| 67 | +
|
| 68 | + imagePullPolicy: Always |
| 69 | + name: location |
| 70 | + ports: |
| 71 | + - containerPort: 9090 |
| 72 | + name: location |
| 73 | + protocol: TCP |
| 74 | + volumeMounts: |
| 75 | + - mountPath: /opt/app-root/src/dynamic-plugins-root |
| 76 | + name: dynamic-plugins-root |
| 77 | + workingDir: /opt/app-root/src |
| 78 | + - env: |
| 79 | + - name: NORMALIZER_FORMAT |
| 80 | + value: JsonArrayFormat |
| 81 | + - name: STORAGE_TYPE |
| 82 | + value: ConfigMap |
| 83 | + - name: BRIDGE_URL |
| 84 | + value: http://localhost:9090 |
| 85 | + - name: POD_IP |
| 86 | + valueFrom: |
| 87 | + fieldRef: |
| 88 | + fieldPath: status.podIP |
| 89 | + - name: POD_NAMESPACE |
| 90 | + valueFrom: |
| 91 | + fieldRef: |
| 92 | + fieldPath: metadata.namespace |
| 93 | + envFrom: |
| 94 | + - secretRef: |
| 95 | + name: rhdh-rhoai-bridge-token |
| 96 | + image: quay.io/redhat-ai-dev/model-catalog-storage-rest@sha256:398095e7469e86d84b1196371286363f4b7668aa3e26370b4d78cb8d4ace1dc9 |
| 97 | +
|
| 98 | + imagePullPolicy: Always |
| 99 | + name: storage-rest |
| 100 | + volumeMounts: |
| 101 | + - mountPath: /opt/app-root/src/dynamic-plugins-root |
| 102 | + name: dynamic-plugins-root |
| 103 | + workingDir: /opt/app-root/src |
| 104 | + - env: |
| 105 | + - name: NORMALIZER_FORMAT |
| 106 | + value: JsonArrayFormat |
| 107 | + - name: POD_IP |
| 108 | + valueFrom: |
| 109 | + fieldRef: |
| 110 | + fieldPath: status.podIP |
| 111 | + - name: POD_NAMESPACE |
| 112 | + valueFrom: |
| 113 | + fieldRef: |
| 114 | + fieldPath: metadata.namespace |
| 115 | + envFrom: |
| 116 | + - secretRef: |
| 117 | + name: rhdh-rhoai-bridge-token |
| 118 | + image: quay.io/redhat-ai-dev/model-catalog-rhoai-normalizer@sha256:fe6c05d57495d6217c4d584940ec552c3727847ff60f39f5d04f94be024576d8 |
| 119 | +
|
| 120 | + imagePullPolicy: Always |
| 121 | + name: rhoai-normalizer |
| 122 | + volumeMounts: |
| 123 | + - mountPath: /opt/app-root/src/dynamic-plugins-root |
| 124 | + name: dynamic-plugins-root |
| 125 | + workingDir: /opt/app-root/src |
| 126 | +---- |
| 127 | + |
| 128 | +. Enable `Connector` in your `{product-very-short}{my-app-config-file}` file. |
| 129 | +In your `{backstage} `app-config.extra.yaml` file, configure `Entity Provider` under the `catalog.providers` section: |
| 130 | ++ |
| 131 | +[source,yaml] |
| 132 | +---- |
| 133 | +providers: |
| 134 | + modelCatalog: |
| 135 | + development: |
| 136 | + baseUrl: http://localhost:9090 |
| 137 | +---- |
| 138 | + |
| 139 | +where: |
| 140 | + |
| 141 | +`modelCatalog`:: Specifies the name of the provider. |
| 142 | +`development`:: Defines future connector capability beyond a single `baseUrl`. |
| 143 | +`baseUrl`:: For Developer Preview, this value is the only one supported. Future releases might support external routes. |
0 commit comments