Learn more >
by Steve Martinelli, Scott D'Angelo Updated September 6, 2019 - Published August 29, 2019
Before we talk about how to use Watson APIs on OpenShift, let’s quickly define what they are.
Watson APIs: A set of artificial intelligence (AI) services that are available on IBM Cloud that have a REST API and SDKs for many popular languages. Watson Assistant and Watson Discovery are part of this set to name a few.
OpenShift: Red Hat OpenShift is a hybrid-cloud, enterprise Kubernetes application platform. IBM Cloud now offers it as a hosted solution or an on-premises platform as a service (PaaS): Red Hat OpenShift on IBM Cloud. It is built around containers, orchestrated and managed by Kubernetes, on a foundation of Red Hat Enterprise Linux. You can read more about the History of Kubernetes, OpenShift, and IBM in a blog post by Anton McConville and Olaph Wagoner.
Now, let’s talk about how to combine the two. In our opinion, there are really two ways to use Watson APIs in an OpenShift environment.
Let’s dig into the first option.
Source-to-Image is a framework for building reproducible container images from source code. S2I produces ready-to-run images by injecting source code into a container image and letting the container prepare that source code for execution. S2I comes with OpenShift but it is also available as a stand-alone tool. Take a look at how simple it is to use S2I through an OpenShift console.
Say you have a Node.js app, and you’d like to deploy it in a container running on OpenShift. Here’s what you do. (Our examples in this section use Red Hat OpenShift on IBM Cloud.)
From the OpenShift catalog, select a runtime (for example, Node.js or Python) and point to a repository.
Add configuration for the application, such as any Watson services API keys, as a Config Map.
Associate that Config Map with your app.
And you’re done! The containerized app will be deployed and now can use any existing Watson Service available through a REST API call.
We’ve already added OpenShift Source-to-Image instructions for some of our most popular Watson code patterns.
We also created a quick video example that demonstrates how to use the approach mentioned above.
Cloud Pak for Data can be deployed on OpenShift and includes a lot of AI and data products from IBM. These products include, but are not limited to, Watson Studio, Watson Machine Learning, Db2 Warehouse, and Watson Assistant.
Using our previous example, say that you have a Node.js app running on-premises and behind a firewall. In just a few minutes, you can update the application to call Watson APIs that are running on your Cloud Pak for Data.
(Prerequisite) Install Cloud Pak for Data, on-premises, preferably on OpenShift.
Install the Watson API kit add-on, the Watson Assistant add-on, and the Watson Discovery add-on. The Watson API kit includes Watson Knowledge Studio, Watson Natural Language Understanding, Watson Speech to Text, and Watson Text to Speech.
Launch the Watson API service that you want to use and generate a new API Key.
Update the application to use the new API key and REST endpoint.
We’re still in the process of updating our content to work with Watson APIs on OpenShift, so here are a couple of references instead:
Thanks for reading our blog! Start the journey to containerizing your Watson applications by following our Sample using Watson Assistant or Sample using Watson Discovery. Or, if you’re interested in learning more about Cloud Pak for Data, check out this Overview of Cloud Pak for Data video.
Artificial intelligenceIBM Cloud Pak for Data+
Back to top