Skip to content

Commit

Permalink
fixes for issues #21, #22, #23
Browse files Browse the repository at this point in the history
  • Loading branch information
rsriniva committed Feb 19, 2024
1 parent 548e929 commit 1a7c446
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/ROOT/pages/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This course is the *fourth* in a series of *five* courses about Red Hat OpenShif
4. Deploying Machine Learning Models with Red Hat OpenShift AI (_This course_)
5. https://redhatquickcourses.github.io/rhods-pipelines[Automation using Data Science Pipelines]
NOTE: After you have completed all the courses in the learning path, you can attempt the https://github.com/RedHatQuickCourses/rhods-qc-apps/tree/main/7.hands-on-lab["Hit the RHODS"] exercise, that tests your understanding of the concepts taught in all the courses.
NOTE: After you have completed all the courses in the learning path, you can attempt the https://github.com/RedHatQuickCourses/rhods-qc-apps/tree/main/7.hands-on-lab["Workshop final lab"] exercise, that tests your understanding of the concepts taught in all the courses.

== Authors

Expand Down
25 changes: 20 additions & 5 deletions modules/chapter1/pages/section1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -260,28 +260,43 @@ $ podman tag purchase-predictor:1.0 quay.io/user_name/purchase-predictor:1.0
$ podman push quay.io/user_name/purchase-predictor:1.0
----
+
[NOTE]
====
If you are running macOS ARM versions, then run:
podman build --platform linux/amd64 -t purchase-predictor:1.0 .
====
+
After you push the image, open quay.io in your browser and make the image public.

. Deploy the model image to **OpenShift**
. Deploy the model image to **OpenShift**. Get the OCP_CLUSTER_URL value from your RHDP page for this classroom.
+
[source,console]
----
$ oc login api.cluster.example.com:6443
$ oc login <OCP_CLUSTER_URL>:6443
$ oc new-project model-deploy
$ oc new-app --name purchase-predictor quay.io/user_name/purchase-predictor:1.0
$ oc expose service purchase-predictor
----

. Get the route for the deployed application
+
[source,console]
----
$ ROUTE_NAME=$(oc get route purchase-predictor -o jsonpath='{.spec.host}')
----

Now we can use the Flask application with some commands such as:
[source,console]
----
$ curl http://purchase-predictor-model-deploy.apps.cluster.example.com/health
$ curl http://$ROUTE_NAME/health
ok
$ curl http://purchase-predictor-model-deploy.apps.cluster.example.com/info
$ curl http://$ROUTE_NAME/info
{"name":"Time to purchase amount predictor","version":"v1.0.0"}
$ curl -d '{"time":4}' -H "Content-Type: application/json" \
> -X POST \
> http://purchase-predictor-model-deploy.apps.cluster.example.com/predict
> http://$ROUTE_NAME/predict
{"prediction":34,"status":200}
----

Expand Down

0 comments on commit 1a7c446

Please sign in to comment.