Integrate Docker in your IBM Operational Decision Manager environment
Widely used in many aspects of the development process, such as developing, testing, and deployment, containers are a lightweight approach to virtualization. Docker, an open platform for container-based virtualization on Linux, is a popular solution for container technology. You might wonder, "Can we use Docker when developing applications with IBM ODM?" For example, you might want to use Docker to quickly set up a clean Rule Execution Server for testing. The answer is yes – if you install and configure IBM ODM inside a Docker container.
IBM ODM includes three main components: rules, events, and insights. You can configure the rules component (Rule Execution Server and Decision Center) inside a Docker container that hosts a supported third-party application server. In fact, Docker Hub (the public registry for Docker images) includes a Docker image for the WebSphere Liberty server, which is a supported application server for IBM ODM. You can build a Docker image of the rules component, based on the Docker image that is available for the WebSphere Liberty server.
This tutorial shows the detailed steps to build an image that you can use as a starting point to use Docker in your IBM ODM application development process.
At the time of writing, the most recent version of the Docker Engine was 1.8.1 and the most recent version of IBM ODM was 8.7.1. All steps were tested with these versions on an Ubuntu 14.04 virtual machine.
Install Docker on Ubuntu
Because the Docker landscape is changing rapidly, use the Installation on Ubuntu online Docker documentation for the most up-to-date instructions to install Docker on the Ubuntu operating system.
Prepare the required files
According to the Configuring on Liberty profile 126.96.36.199 IBM ODM documentation, complete the following steps to configure Rule Execution Server and Decision Center on WebSphere Liberty:
- Prepare the database, including the database driver and initial data.
(The steps differ depending on your database. With the examples in
this tutorial, you can use the
derby.jarfile as the database driver and the
data.tar.gzfile as the database, both available in the code_sample.zip file in the Download section.)
- Copy the related web archive (WAR) file to
- Update the server configuration file
Complete the steps before you build a Docker image for Rule Execution Server and Decision Center that are configured on a WebSphere Liberty server.
Required WAR files
To configure the Rule Execution Server and Decision Center on WebSphere Liberty, you need the following files:
res.warfile that contains the Rule Execution Server console
DecisionService.warfile that contains hosted transparent decision services
teamserver.warfile that contains the Enterprise console
decisioncenter.warfile that contains the Business console
DecisionRunner.warfile for the testing and simulation features
On the server where you installed IBM ODM V8.7.1 with the JBoss, Tomcat, Oracle WebLogic, or WebSphere Liberty Profile option, find the required WAR files in the following locations:
This tutorial uses Derby as the database for Rule Execution Server and
Decision Center. An example Derby database driver (the
derby.jar file) is available in the code_sample.zip file in the Download section.
If no initial database is provided, when you access the Rule Execution
Server console or the Decision Center console for the first time, the
Installation Setting wizard opens for you to initialize the database. To
bypass this task when you work through the tutorial, download the initial
Derby database, which includes a sample rule project in Decision Center
data.tar.gz file). See the code_sample.zip file in the Download section.
The server.xml file
server.xml file is the server configuration file in
WebSphere Liberty. For Rule Execution Server and Decision Center, include
the following configurations in the
- The required feature
- The address and port number that the WebSphere Libert server listens to
- The data source
- The users and groups for the web application
- The web application information
The following topics in the IBM Operational Decision Manager documentation
on IBM Knowledge Center show example configurations to put in the
- Deploying the Rule Execution Server management WAR
- Deploying the hosted transparent decision service
- Creating users and groups
- Declaring new groups
- Deploying the Decision Center WAR files
- Deploying the testing and simulation archives
server.xml file that includes all the necessary
configurations is available in the code_sample.zip
file in the Download section.
To build an image with Docker, you need to prepare a Dockerfile that includes all the instructions that are needed to build the image. A Dockerfile is a text document that contains all the commands you can call on the command line to assemble an image. A sample Dockerfile is available in the code_sample.zip file in the Download section.
The content the sample Dockerfile looks like the following example:
# ODM 8.7.1 on liberty 188.8.131.52 with derby database # # VERSION 1.0 FROM websphere-liberty:8.5.5 MAINTAINER Ming Li <firstname.lastname@example.org> # accept license by default ENV LICENSE=accept # Deploy database driver for derby COPY derby.jar /opt/ibm/wlp/usr/shared/resources/derby/ # Init derby database ADD data.tar.gz opt/ibm/wlp/usr/shared/resources/ # Deploy the war files for RES and DC COPY apps /opt/ibm/wlp/usr/servers/defaultServer/apps/ # Update server configuration COPY server.xml /opt/ibm/wlp/usr/servers/defaultServer/
Build the Docker image
After all the required files are ready, you can build the Docker image for the Rule Execution Server and Decision Center.
Prepare the build folder
When you build a Docker image, Docker transfers all the files from the directory where you run the commands to the Docker server. Therefore, you need to create a folder that includes only the necessary files for building the image.
Complete the following steps:
- Create an empty folder for building the image (for example, name it
- Create a
build/appssubfolder to hold all the WAR files.
- Copy the 6 WAR files that you have collected in previous steps to the
- Copy the sample files that you downloaded
The folder structure of the
build folder then looks like the
example in Figure 1:
Figure 1. Build folder structure example
Build the image
build folder is ready, you can build the Docker
image. First, pull the
websphere-liberty image from DockerHub
with the following command:
docker pull websphere-liberty:8.5.5
Then, change current directory to the
build folder, and build
the image with the following command:
docker build –t odm871 .
Follow the example in Figure 2.
Figure 2. Example commands to build the Docker image
Look for a
Successfully built xxxxxx message. Then, run the
A new odm871 image is created, as shown in Figure 3.
Figure 3. Example Docker image list
Verify the Docker image
Now verify that the Rule Execution Server and the Decision Center in IBM ODM V8.7.1 are configured correctly and run properly in the Docker container.
First, use the following command to start a container from the odm871 image:
docker run –p 9080:9080 –p 9443:9443 odm871
From the logs in Figure 4, you can see that the server is started successfully.
Figure 4. Example logs when you run IBM ODM in a Docker container
Then, complete the following steps to verify the Rule Execution Server from a web browser:
- Open the Rule Execution Server console in your browser by entering
http://server_address:9080/resroot URL on the host server and logging in to the console (user name:
After you log in, the Rule Execution Server console opens.
If you used the initial database that is provided in the code sample, there is no need to run the Installation Settings wizard to initialize the database for the Rule Execution Server again. (However, as you walk through these steps in your own environment you will notice that after you log in to the Rule Execution Server, the Installation Settings wizard window opens if the database is not initialized.)
- From the Diagnostics tab, click Run Diagnostics. As
shown in Figure 5, you see that all the diagnostic tests passed. The
tests for Local XU connectivity and XU MBean
connectivity are in warning states. The warnings are
normalbecause there is no JNDI name to use with the Java™ SE
execution unit (XU).
Figure 5. Rule Execution Server diagnostic results
Complete the following steps to verify the Decision Center from a web browser:
- Open the Decision Center Enterprise console in your browser by
http://server_address:9080/teamserverroot URL on the host server. Then, log in to the console (user name: rtsAdmin, password: rtsAdmin).
You see a Decision Center like the example in Figure 6.
Figure 6. Decision Center Enterprise console
- On the configure tab, click
Diagnostics. As shown in Figure 7, you see that
all the diagnostic tests passed.
Figure 7. Decision Center diagnostic results
- Open the Decision Center Business console in your browser by entering
http://server_address:9080/decisioncenterroot URL on the host server. Then, log in to the Decision Center Business console (user name: rtsAdmin, password: rtsAdmin).
You see a window like the example in Figure 8.
Figure 8. Decision Center Business console
The tutorial showed how to build a Docker image that installed the Rule Execution Server and the Decision Center for IBM ODM V8.7.1 on a WebSphere Liberty server. You learned how to run the Rule Execution Server and the Decision Center in a container from the Docker image.
The examples in this tutorial are a starting point to use Docker in an IBM ODM application development process. You can use a similar image to set up a clean Rule Execution Server server for testing or development. Or, you can build your own customized Docker images based on it.
You can apply the techniques that you learned in this tutorial to build your own Docker image for Rule Execution Server and Decision Center on another application server (such as Tomcat or JBoss) or with another supported database (such as DB2 or Oracle).
The author would like to thank Jian Feng Cai, Guang Ying Yuan, and Tim Poultney for their reviews, contributions, and comments.
- Configuring Rule Execution Server on the Liberty profile (IBM ODM documentation on IBM Knowledge Center)
- Configuring Decision Center on the Liberty profile (IBM ODM documentation on IBM Knowledge Center)
- Docker Docs online documentation
- Installation on Ubuntu topic in Docker online documentation
- Dockerfile reference topics in Docker online documentation