Step 6: Packaging our application
Now that the application code is working, we’re ready to package it as a container image, and have it running directly into OpenShift as a service you will be able to call from any other application.
Note: the application code is available in the same repo we’ve been using before, but in the app
branch. It is the same content as we had in our notebooks, except that instead of passing an image name to the prediction function, we will be able to directly upload any image!
Building the application inside OpenShift
- Open your OpenShift UI and switch to the developer view from the menu on the top left:
- Make sure you are in the right project that was assigned to you:
- From the
+Add
menu, click on theFrom Git
tile:
- In the
Git Repo URL
field, enter:https://github.com/rh-aiservices-bu/licence-plate-workshop.git
- Don’t miss this step! Click on
Show advanced Git options
, and in theGit reference
field, entermain
(this is the branch to use in our github project):
- By default, OpenShift will want to use the builder image called Python 3.9 (UBI8). You will want to edit the Import Strategy:
- The image to choose in the dropdown list is 3.8-ubi7
- If you continue to scroll down, you will see that everything is automatically selected to create a deployment of your application, and to create a Route through which you will be able to access it. Everything is ready, so you can click on
Create
:
- You will see that a build is going on:
- The automated building process will take a few minutes. Some Alerts may appear if OpenShift tries to deploy while the build is still running, but that’s OK. Then OpenShift will deploy the application (rollout), and in the topolody view you should obtain something like this:
- Just click on the application line to open a detail panel on the right:
- If you scroll down on the detail panel, you will see the route that was created for your application. This is the URL you will use to send images:
Once you’re finished, you can come back here and head to the next section.
Navigation
- Red Hat OpenShift Data Science Workshop - Licence plate recognition
- Step 1: Starting a Jupyter environment
- Step 2: The Jupyter environment
- Step 3: Notebooks
- Step 4: Licence plate recognition
- Step 5: Packaging the model as an API
- Step 6: Packaging our application<– you are here
- Step 7: Testing the application
- Conclusion