This document shows how to run the Watson Banking Chatbot
application in a container running on Red Hat OpenShift.
You will need a running OpenShift cluster, or OKD cluster. You can provision OpenShift on the IBM Cloud.
-
Using the OpenShift web console, select the
Application Console
view. -
Use the
+Create Project
button to create a new project, then click on your project to open it. -
In the
Overview
tab, click onBrowse Catalog
. -
Choose the
Node.js
app container and clickNext
. -
Give your app a name and add
https://github.com/IBM/watson-banking-chatbot
for the github repo, then clickCreate
.
- Click on the
Resources
tab and chooseConfig Maps
and then click theCreate Config Map
button.- Provide a
Name
for the config map. - Add a key named
PORT
and paste in the8080
underEnter a value...
. - For each of the following key/value pairs, click
Add Item
to add the key, and then paste the value in theEnter a value...
field. The necessary keys to configure will depend on whether you are provisioning services using IBM Cloud Pak for Data or on IBM Cloud.
- Provide a
Click to expand one:
IBM Cloud Pak for Data
Collect the credentials for IBM Cloud Pak for Data provisioned services (Assistant, Discovery and Natural Language Understanding). For each of these services:
- For production use, create a user to use for authentication. From the main navigation menu (☰), select Administer > Manage users and then + New user.
- From the main navigation menu (☰), select My instances.
- On the Provisioned instances tab, find your service instance, and then hover over the last column to find and click the ellipses icon. Choose View details.
- Copy the URL to use as the {SERVICE_NAME}_URL when you configure credentials.
- Optionally, copy the Bearer token to use in development testing only. It is not recommended to use the bearer token except during testing and development because that token does not expire.
- Use the Menu and select Users and + Add user to grant your user access to this service instance. This is the user name (and password) you will use when you configure credentials to allow the Node.js server to authenticate.
The other settings for Assistant and Discovery were collected during the
earlier setup steps detailed in the main README page. See the setup sections for each service to determine where to find DISCOVERY_COLLECTION_ID
and Assistant SKILL_ID
.
For each service (ASSISTANT, DISCOVERY, and NATURAL_LANGUAGE_UNDERSTANDING) the following settings are needed with the service name as a prefix:
-
Set _AUTH_TYPE to cp4d
-
Provide the _URL, _USERNAME and _PASSWORD for the user added to this service instance.
-
For the _AUTH_URL use the base fragment of your URL including the host and port. I.e. https://{cpd_cluster_host}{:port}.
-
If your CPD installation is using a self-signed certificate, you need to disable SSL verification with both _AUTH_DISABLE_SSL and _DISABLE_SSL. Disable SSL only if absolutely necessary, and take steps to enable SSL as soon as possible.
Key Value ASSISTANT_AUTH_TYPE cp4d ASSISTANT_URL https://{cpd_cluster_host}{:port}/assistant/{release}/instances/{instance_id}/api ASSISTANT_AUTH_URL https://{cpd_cluster_host}{:port} ASSISTANT_USERNAME <add_assistant_username> ASSISTANT_PASSWORD <add_assistant_password> ASSISTANT_DISABLE_SSL true or false ASSISTANT_AUTH_DISABLE_SSL true or false SKILL_ID <add_assistant_skill_id> DISCOVERY_AUTH_TYPE cp4d DISCOVERY_URL https://{cpd_cluster_host}{:port}/natural-language-understanding/{release}/instances/{instance_id}/api DISCOVERY_AUTH_URL https://{cpd_cluster_host}{:port} DISCOVERY_USERNAME <add_discovery_username> DISCOVERY_PASSWORD <add_discovery_password> DISCOVERY_DISABLE_SSL true or false DISCOVERY_AUTH_DISABLE_SSL true or false DISCOVERY_COLLECTION_ID <add_discovery_collection_id> NATURAL_LANGUAGE_UNDERSTANDING_AUTH_TYPE cp4d NATURAL_LANGUAGE_UNDERSTANDING_URL https://{cpd_cluster_host}{:port}/discovery/{release}/instances/{instance_id}/api NATURAL_LANGUAGE_UNDERSTANDING_AUTH_URL https://{cpd_cluster_host}{:port} NATURAL_LANGUAGE_UNDERSTANDING_USERNAME <add_nlu_username> NATURAL_LANGUAGE_UNDERSTANDING_PASSWORD <add_nlu_password> NATURAL_LANGUAGE_UNDERSTANDING_DISABLE_SSL true or false NATURAL_LANGUAGE_UNDERSTANDING_AUTH_DISABLE_SSL true or false
IBM Cloud
Collect the credentials for the IBM Cloud services (Assistant, Discovery and Natural Language Understanding). For each of these services:
- From the main navigation menu (☰), select Resource list to find your services under Services.
- Click on each service to find the Manage view where you can collect the API Key and URL to use for each service when you configure credentials.
The other settings for Assistant and Discovery were collected during the
earlier setup steps detailed in the main README page. See the setup sections for each service to determine where to find DISCOVERY_COLLECTION_ID
, DISCOVERY_ENVIRONMENT_ID
and Assistant SKILL_ID
.
For each service (ASSISTANT, DISCOVERY, and NATURAL_LANGUAGE_UNDERSTANDING) the following settings are needed with the service name as a prefix:
-
Set _AUTH_TYPE to iam
-
Provide the _URL and _APIKEY collected when you created the services.
Key Value ASSISTANT_AUTH_TYPE iam ASSISTANT_APIKEY <add_assistant_apikey> ASSISTANT_URL <add_assistant_url> SKILL_ID <add_assistant_skill_id> DISCOVERY_AUTH_TYPE iam DISCOVERY_APIKEY <add_discovery_apikey> DISCOVERY_URL <add_discovery_url> DISCOVERY_ENVIRONMENT_ID <add_discovery_environment_id> DISCOVERY_COLLECTION_ID <add_discovery_collection_id> NATURAL_LANGUAGE_UNDERSTANDING_AUTH_TYPE iam NATURAL_LANGUAGE_UNDERSTANDING_APIKEY <add_nlu_apikey> NATURAL_LANGUAGE_UNDERSTANDING_URL <add_nlu_url>
Create the config map and add it to your application.
-
Hit the
Create
button. -
Click on your new Config Map's name.
-
Click the
Add to Application
button. -
Select your application from the pulldown.
-
Click
Save
. -
Go to the
Applications
tab, chooseDeployments
to view the status of your application.
- From the OpenShift or OKD UI, under
Applications
▷Routes
you will see your app.- Click on the application
Name
. - Under
TLS Settings
, click onEdit
. - Under
Security
, check the box forSecure route
. - Hit
Save
.
- Click on the application
- Under
Applications
▷Routes
you will see your app. Click on theHostname
to see your Watson banking chatbot in action. - Go back to the README.md for instructions on how to use the web app.