Contents


Integrate Docker in your IBM Operational Decision Manager environment

Comments

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 8.5.5.4 IBM ODM documentation, complete the following steps to configure Rule Execution Server and Decision Center on WebSphere Liberty:

  1. 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.jar file as the database driver and the data.tar.gz file as the database, both available in the code_sample.zip file in the Download section.)
  2. Copy the related web archive (WAR) file to Liberty_profile_directory/usr/servers/server_name/apps.
  3. Update the server configuration file at

    Liberty_profile_directory/usr/servers/server_name/server.xml.

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:

  • The res.war file that contains the Rule Execution Server console
  • The DecisionService.war file that contains hosted transparent decision services
  • The teamserver.war file that contains the Enterprise console
  • The decisioncenter.war file that contains the Business console
  • The testing.war and DecisionRunner.war file 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:

  • installation_directory/executionserver/applicationservers/WLP855/res.war
  • installation_directory/executionserver/applicationservers/WLP855/DecisionService.war
  • installation_directory/teamserver/applicationservers/WLP855/teamserver.war
  • installation_directory/teamserver/applicationservers/WLP855/decisioncenter.war
  • installation_directory/executionserver/applicationservers/WLP855/testing.war
  • installation_directory/executionserver/applicationservers/WLP855/DecisionRunner.war

Database files

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 (the data.tar.gz file). See the code_sample.zip file in the Download section.

The server.xml file

The server.xml file is the server configuration file in WebSphere Liberty. For Rule Execution Server and Decision Center, include the following configurations in the server.xml file:

  • 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 server.xml file:

A sample server.xml file that includes all the necessary configurations is available in the code_sample.zip file in the Download section.

The Dockerfile

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 8.5.5.5 with derby database
#
# VERSION               1.0
FROM websphere-liberty:8.5.5
MAINTAINER Ming Li <lmming@cn.ibm.com>

# 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:

  1. Create an empty folder for building the image (for example, name it build).
  2. Create a build/apps subfolder to hold all the WAR files.
  3. Copy the 6 WAR files that you have collected in previous steps to the build/apps subfolder.
  4. Copy the sample files that you downloaded derby.jar, data.tar.gz, Dockerfile and server.xml to the build folder.

The folder structure of the build folder then looks like the example in Figure 1:

Figure 1. Build folder structure example
Screen                     capture of build folder structure example

Build the image

When the 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
Screen                     capture commands to build the Docker image
Screen capture commands to build the Docker image

Look for a Successfully built xxxxxx message. Then, run the following command:

	docker images

A new odm871 image is created, as shown in Figure 3.

Figure 3. Example Docker image list
Screen capture                     of example Docker image list
Screen capture of 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
Screen                     capture of example logs when running IBM ODM in a Docker                     container
Screen capture of example logs when running IBM ODM in a Docker container

Then, complete the following steps to verify the Rule Execution Server from a web browser:

  1. Open the Rule Execution Server console in your browser by entering res with the http://server_address:9080/res root URL on the host server and logging in to the console (user name: resAdmin, password: resAdmin).

    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.)

  2. 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
    Screen                     capture of example results in the Rule Execution Server
    Screen capture of example results in the Rule Execution Server

Complete the following steps to verify the Decision Center from a web browser:

  1. Open the Decision Center Enterprise console in your browser by entering teamserver with the http://server_address:9080/teamserver root 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
    Screen                     capture of the Decision Center Enterprise console
    Screen capture of the Decision Center Enterprise console
  2. 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
    Screen                     capture of example results in the Decision Center
    Screen capture of example results in the Decision Center
  3. Open the Decision Center Business console in your browser by entering decisioncenter with the http://server_address:9080/decisioncenter root 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
    Screen                     capture of Decision Center Business                     console
    Screen capture of Decision Center Business console

Conclusion

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).

Acknowledgements

The author would like to thank Jian Feng Cai, Guang Ying Yuan, and Tim Poultney for their reviews, contributions, and comments.


Downloadable resources


Related topics


Comments

Sign in or register to add and subscribe to comments.

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Middleware
ArticleID=1022724
ArticleTitle=Integrate Docker in your IBM Operational Decision Manager environment
publish-date=12092015