Skip to content

Commit

Permalink
Added instructions for UI based instuctions to install Model Registry…
Browse files Browse the repository at this point in the history
… and as well usage patterns of Model Registry. Some portions from the Model Registry introduction is taken as is from Kubeflow Model registry documention. Some document contributions were also made by Matteo Mortari and Alessio Pragliola. Thank you.

Signed-off-by: Ramesh Reddy <[email protected]>
  • Loading branch information
rareddy committed Sep 30, 2024
1 parent f86ba81 commit 3fbc11b
Show file tree
Hide file tree
Showing 15 changed files with 97 additions and 17 deletions.
6 changes: 4 additions & 2 deletions docs/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ A model registry is an important component in the lifecycle of AI/ML models, an
![Model Registry](./images/model-registry.png)


The below are links more documention on Model Registry
The below are links more documentation on Model Registry

1. [Introduction](./introduction.md)
2. [Install Model Registry](./install.md)
3. [How to use Model Registry Python library](./getting-started.md)
3. [Install and using Model Registry using UI](./how-to-use-ui.md)
4. [How to use Model Registry Python library](./getting-started.md)
5. [Deploy a model using UI](./deploy-model.md)


6 changes: 3 additions & 3 deletions docs/deploy-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Once the model is designed and uploaded to a S3 bucket and "registered" in the Model Registry, user can choose to deploy the model for inferencing.

It is expected that you have access to Open Datahub Dashboard. Using the Dashboard, create or use existing "Data Science Project"
It is expected that you have access to Open Data Hub Dashboard. Using the Dashboard, create or use existing "Data Science Project"

![Model Registry](./images/dashboard-home.png)

Expand All @@ -14,14 +14,14 @@ Which pops this window

![Model Registry](./images/dashboard-modelregistry-deploy1.png)

Select the target "project" you want to deploy this model into from the drop down box. Note that Model Registry is not scoped to a single porject, it can scoped to whole cluster, or to more than one project. So it is required that user choose the project where they want to deploy into. Which will bring to this page
Select the target "project" you want to deploy this model into from the drop down box. Note that Model Registry is not scoped to a single project, it can scoped to whole cluster, or to more than one project. So it is required that user choose the project where they want to deploy into. Which will bring to this page

![Model Registry](./images/dashboard-modelregistry-deploy2.png)

On this dialog box please select
* Serving Runtime: Model Runtime server you want to use to run your model
* Model Framework: Select the model framework that model is designed from dropdown list.
* Data Connection: This is one key property user must provide. Since Model Registry only contains metadata information not actual physical model, user need to provide credentails to access the model on S3 bucket. Here if "data connection" is aleady available in the project you can select to reuse, if not user has option to provide the credentils to the S3 bucket to reach to the model.
* Data Connection: This is one key property user must provide. Since Model Registry only contains metadata information not actual physical model, user need to provide credentials to access the model on S3 bucket. Here if "data connection" is already available in the project you can select to reuse, if not user has option to provide the credentials to the S3 bucket to reach to the model.

Once you make all the other selections, click deploy. This should show the "Deployments" tab and status of the deployment.

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Model Registry Python Library Usage

This document introduces Model Registry Python library and some of its methods for registering and viewing models inside the Model Registry, however this should not be considered as full library reference. This is only is only used as a document to how start using the Model Registry. Refer the Python library documention for full library reference.
This document introduces Model Registry Python library and some of its methods for registering and viewing models inside the Model Registry, however this should not be considered as full library reference. This is only is only used as a document to how start using the Model Registry. Refer the Python library documentation for full library reference.

## Prerequisites
It is expected that you have access to Open Datahub Dashboard
It is expected that you have access to Open Data Hub Dashboard
<ol>
<li> You have logged into Dashboard
<li> Created a "Data Science Project"
<li> Configured any Cluster Storage.
<li> Configured Data Connections needed for your project. For creating a data conenction you would require connection details for S3 bucket.
<li> Configured Data Connections needed for your project. For creating a data connection you would require connection details for S3 bucket.
<li> Created Workbench and logged into it.
</ol>

Expand Down
79 changes: 79 additions & 0 deletions docs/how-to-use-ui.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Model Registry UI

This section of the document goes over Model Registry UI and shows various features of the Model Registry.

## Install Model Registry

The instructions here show how to install Model Registry using the UI. The instructions [here](./install.md) show how to install using terminal using `oc` command. You can use either one. Please note that in order to install Model Registry using UI, the installer must be in `odh-admin` user group. Please consult your cluster admin other wise.


### Prerequisites
The following prerequisites are needed for installing Model Registry
<ol>
<li> Access to OpenShift Cluster 4.17 + (recommend)
<li> To install the operators you need "cluster-admin" access
<li> To install Data Science Cluster and Model Registry you need to be `odh-admin` user group. Please if you already in `cluster-admin` role one should already have this role, other wise consult your cluster administrator for requesting access.
<li> Make sure you have enough capacity on the cluster to install a "data science cluster" minimum is with HCP cluster is 2 nodes of m6i, real world use cases might need to be larger than this. Please consult sizing guides for OpenShift AI.
<li> Model registry currently only works MySQL or MariaDB database, if you have an access to external database collect the credentials for it. You need `user-id`, `password`, `host`, `port`, `database-name`
</ol>

### Installation

Log "cluster-admin" install the following operators in cluster scope. Please follow the order of their install as, Authorino Operator, Red Hat Serverless Operator, Red Hat Service Mesh operator, and then Open Data Hub Operator.

![Model Registry](./images/dashboard-operators.png)

For installing the "Data Science Cluster", install "DSCi" and "DSC" custom resources, and make sure in DSC custom resource has below to install Model Registry operator

```
modelregistry:
managementState: Managed
```

when DSC cluster shows in "ready" state. Goto "route" for dashboard setting in "opendatahub" namespace and log into it. Typically there is applications tool bar button in toolbar area you can find the "Open Data Hub Dashboard" link.

Once logged into Dashboard, click on "Settings -> Model Registry", on the screen choose to "Create Model Registry" which should present with the following document

![Model Registry](./images/dashboard-modelregistry-create.png)

Give the name to Model Registry accordingly representing the business function it represents. Please note that you can install multiple Model Registries in a given cluster with varying degrees of access. For example, you can have Model Registry that public across your whole organization, another one could be across your business unit, or could be just for your team. The access is determined by controlling users in the unique user-group that is created as part of Model Registry installation.

![Model Registry](./images/dashboard-modelregistry-create2.png)

Provide all the database configuration and click "create", once the status shown as "Ready", you can click on kebab menu and select "manage access" where you can manage the user-group that is mentioned above. Please note that to add users to user group, you need to log into OpenShift console and use User Management screens. Otherwise you can add individual users to "add-user" section to grant access to individual access to the registry created. Please note currently all the access control is based on Kubernetes Authn/AuthZ, there is no options to include third party authentication or authorization systems. Once the access is defined, installation of Model Registry is complete.

### Catalog of Models in Model Registry

Client on left navigation item "Model Registry" on the Dashboard, to take you to screen that shows the catalog of models that are registered in Model Registry. If no models are registered it will show an empty list. If there are registered models you can click to see details of the models

![Model Registry](./images/dashboard-modelregistry-catalog1.png)


### Register a Model

There are two different ways of registring model in the Model Registry. One using the button in this screen "Register Model" which should pop the following screen. Follow the entries on the screen to register the model. Please note that, Model Registry currently does not actually store the model but it will capture the location of the model where it is stored in a S3 store. First get hold of the model from hugging face or other places, save it into S3 bucket, and provide the details of S3 bucket and its credentials into Register dialog box under "Data Connection" section. Once registered the model will show under model catalog screen.

![Model Registry](./images/dashboard-modelregistry-catalog1.png)

it will bring this screen for registering a model

![Model Registry](./images/dashboard-modelregistry-registermodel.png)

Another way register the model is using [Python library](./getting-started.md). Note that when you register a model first time, it creates a model record and another record for a initial version that is defined. If you ever need to deploy a another iteration of the model after re-training try to add a new version of the model under the same original model record. So, a model record can contain any number of versions underneath. Each version is individually managed. The below screen shows when model is drilled down to version level.

![Model Registry](./images/dashboard-modelregistry-model-versions.png)

and you can click on given model version and see the metadata registered at model version level.

![Model Registry](./images/dashboard-modelregistry-model-versions-details.png)

### Deploy Model

A model version can be deployed using "deploy" action from top right. Please follow directions in [here](./deploy-model.md) for deploying a model.

### Archive Model

In Model Registry a model can not be deleted but it can be archived to remove from UI to reduce clutter when the number models deployed are very large. The user can choose to archive individual model versions or they can choose to archive the entire model.

![Model Registry](./images/dashboard-modelregistry-model-versions-archive.png)

Binary file added docs/images/dashboard-modelregistry-catalog1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/dashboard-modelregistry-catalog2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/dashboard-modelregistry-create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/dashboard-modelregistry-create2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/dashboard-operators.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This document outlines the instructions to install the Model Registry using "Ope
## Prerequisites
The following prerequisites are needed for the Operator to work correctly.
<ol>
<li> Access to OpenShift Cluster 4.17 + (recommened)
<li> Access to OpenShift Cluster 4.17 + (recommend)
<li> To install the operators you need "cluster-admin" access
<li> Make sure you have enough capacity on the cluster to install a "data science cluster" minimum is with HCP cluster is 2 nodes of m6i
<li> Model registry currently only works MySQL or MariaDB database, if you have an access to external database collect the credentials for it. You need `user-id`, `password`, `host`, `port`, `database-name`
Expand Down Expand Up @@ -69,7 +69,7 @@ verify subscription "Succeeded" in install
oc get csv servicemeshoperator.v2.6.1 -n openshift-operators -o json | jq '.status.phase'
```

<li> Search and install Serverless Operator (this did not work from commandline last time, I used OpenShift console instead.)
<li> Search and install Serverless Operator (this did not work from command line last time, I used OpenShift console instead.)

```
oc apply -f - <<EOF
Expand Down Expand Up @@ -117,12 +117,11 @@ verify subscription "Succeeded" in install
oc get csv opendatahub-operator.v2.18.2 -n openshift-operators -o json | jq '.status.phase'
```

<li> If you are using local storage mechanisams for S3 bucket, try installing "minio" operator and configure its access (TDB..)
<li>
<li> If you are using local storage mechanisms for S3 bucket, try installing "minio" operator and configure its access (TDB..)
</ol>

## Install "Data Science Cluster"
Once all the operators all installed and no errors reported, then proceed to installing a "Data Science Cluster". You can navigate "Open data Hub" operator install from left navigation under "Operators --> Installed Operators" and click on "Open Data Hub Operator" and switch to the tab "DSC" and create DSC and make sure edit the YAML set the modelregistry to `managed` state like shown below
Once all the operators all installed and no errors reported, then proceed to installing a "Data Science Cluster". You can navigate "Open data Hub" operator install from left navigation under "Operators --> Installed Operators" and click on "Open Data Hub Operator" and switch to the tab "DSC" and create DSC and make sure edit the YAML set the `modelregistry` to `managed` state like shown below

```
modelregistry:
Expand Down Expand Up @@ -221,7 +220,7 @@ oc get dsc default-dsc -o json | jq '.status.phase'

## Install Database (skip if you using existing database)

Model Registry currently requires MySQL database 8.0.3 or above to function correctly. If you have a database already available you can skip this section all toghether. For "Development" or "NON-PRODUCTION" scenarios you can use following script to install MySQL database.
Model Registry currently requires MySQL database 8.0.3 or above to function correctly. If you have a database already available you can skip this section all together. For "Development" or "NON-PRODUCTION" scenarios you can use following script to install MySQL database.

Create `namespace` where you want to host the database
```
Expand Down Expand Up @@ -493,7 +492,7 @@ ODH Dashboard is UI component for all AI/ML operations that user can use for han
echo "https://$(oc get routes -n opendatahub -l app=odh-dashboard -o json | jq '.items[].status.ingress[].host | select(contains("odh-dashboard"))')" | tr -d '"'
```

Copy the above URL to your web-browser and login using credentials used above or user credentails you may have received from your ODH administrator. Once you are logged into the Dashboard find "Model Registry" on left navigation to see the available models, please note intially this list may be empty.
Copy the above URL to your web-browser and login using credentials used above or user credentials you may have received from your ODH administrator. Once you are logged into the Dashboard find "Model Registry" on left navigation to see the available models, please note initially this list may be empty.

Now, there are a couple different ways you can "register" model using Python code or directly using the Dashboard UI into Model Registy. For these instuctions please follow to [python libarary usage](./getting-started.md)
Now, there are a couple different ways you can "register" model using Python code or directly using the Dashboard UI into Model Registry. For these instructions please follow to [python library usage](./getting-started.md)

2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ Users need to evalaute which information they would like to track and customize
* Notes/Comments: Any additional notes or explanations provided by the model developer or reviewer.


The above provided as some guidence on what kind of information can be saved and looked up in a Model Registry, however users need evaluate their needs and come up what metadata they want to track with their models. Model Registry does force beyond some general model information.
The above provided as some guidance on what kind of information can be saved and looked up in a Model Registry, however users need evaluate their needs and come up what metadata they want to track with their models. Model Registry does force beyond some general model information.

0 comments on commit 3fbc11b

Please sign in to comment.