This guide will help you to set up the Where is Teddy? Demo
-
Order an OpenShift Cluster using the TAP catalog item.
-
Tick the checkbox to enable RHOAI.
-
From the command line, login to OpenShift as a cluster administrator.
Use the data from the email you receive as part of the confirmation of the successful deployment of your environment.
-
Install the Authorino operator.
oc apply -f ./setup/rhoai-config/subscription-authorino.yaml
-
Wait a few moments until the operator is fully installed.
-
Restart the data science operator pod.
oc delete po -l name=rhods-operator -n redhat-ods-operator
-
Wait a few moments and check that the authorino pods are running correctly in the new
redhat-ods-applications-auth-provider
project.If this is not working you won't be able to expose your model serving route externally from the console and will need to edit the service manually.
-
Create the workspace
image-generation
.oc apply -f ./setup/image-gen/ds-project.yaml
-
Wait for project to be created.
-
Setup and configure Minio to enable the S3 storage.
oc apply -n image-generation -f ./setup/image-gen/setup-s3.yaml
-
Wait for all the jobs to finish.
-
Create the serving runtime for the model serving.
oc apply -n image-generation -f ./templates/serving-runtime.yaml
-
Create the storage for the workbench
workbench-storage
.oc apply -n image-generation -f ./setup/image-gen/pvc.yaml
Currently there is an issue with the storage provider in the GPU worker nodes that prevent the workbench to start, creating the persistent volume claim with gp3-csi solves the issue.
-
Go to OpenShift AI (from the OpenShift console view, click on the applications menu in the top right, then select Red Hat OpenShift AI).
-
Then Go to Data Science Projects. Select the "Image Generation" project.
-
In the overview tab, click on Create workbench.
-
From there, fill in the form with the following information:
Name
workbench
Image selection PyTorch
Version selection 2024.1
Container size Medium
Accelerator NVIDIA GPU
Use existing persistent storage
workbench-storage
Use existing data connection
My Storage
-
Click on Create workbench.
-
Wait a few minutes until the status in the page is Running.
It is a big image to pull, it might take up to 10 minutes to get started.
-
Open the newly created workbench by clicking Open.
-
In the new Jupyter notebook click on the Git tab and then the Clone a Repository button. Type in the following URI
https://github.com/cfchase/text-to-image-demo.git
. Finally click Clone.
-
Run through the first 2 notebooks of the demo:
- 1_experimentation.ipynb
- 2_fine_tuning.ipynb
-
Go back to the OpenShift AI console.
-
Register the serving runtime in Openshift AI by clicking on Settings then Serving Runtimes menu and finally the Add serving runtime button.
-
Select
Single Model Serving Platform
. -
Select the API Protocol
REST
. -
In the Add Serving Runtime click from scratch and past the contents
/templates/serving-runtime.yaml
file. -
Click the Create button.
-
Select your working project. Click on the Models tab. Then click the Deploy Model button.
-
From there, fill in the form with the following information:
Model name
redhat-dog
Serving runtime Diffusers Runtime
Model framework pytorch - 1
Model server size Custom (1CPU / 1 Gi)
Accelerator NVIDIA GPU
Model route Check Make deployment models available through an external route
Token authentication Leave it unchecked
Model location Existing data connection
Name My Storage
Path
models/notebook-output/redhat-dog/
-
Click the Deploy button.
-
Wait a few minutes for the inference server to deploy. The status should turn green and the inference point should show in.
-
Go to Red Hat Developer Hub. In the Catalog view, click "Create", "Register Existing Component" and add template from the following url:
https://github.com/redhat-developer-demos/where-is-teddy/blob/main/scaffolder-templates/wheres-teddy/template.yaml
-
Register the API entity from the following url:
https://github.com/redhat-developer-demos/where-is-teddy/blob/main/genai-photo-generator-api/catalog-info.yaml
-
Create a new component using the software template from Developer Hub