BE and Docker

Dockerize BE application

Hey folks! In the article that follows, we'll be seeing how a TIBCO BusinessEvents application image can be run on Docker.

What is TIBCO BusinessEvents?
BusinessEvents (BE) by TIBCO is a tool in the CEP (Complex Event Processing) domain and it allows to take appropriate actions using business rules.

Now let's see how we can dockerize a BE application. Below are the steps you need to follow:


1. Install Vagrant.

2. Install VirtualBox by Oracle.

3. Create a folder and place vagrant file inside it. Edit IP in the vagrant file provided to you in format 192.XX.XX.XX. Make sure each octet value is less than 255.

4. Download and unzip the be_docker_base.zip to your computer.

5. Give execute permissions to the shell and perl scripts in the be_docker_base directory
     chmod +x *.sh *.pl

8. Download and unzip the be_app.zip and give execute permissions to the shell and perl scripts in the directory "be_app".

9. Prepare a BE Application: For this, you can either take a sample BE application or prepare a dummy BE application on your own. Replace hard coded values in HTTP Shared Resource with Global Variables. Build the ear file.

10. Copy the cdd and the ear file of your BE project to folder "be_app".

11. Before proceeding further, follow below steps:
  1. Run Vagrant Up:
  • Open a new Command prompt.
  • Go to the folder path where vagrant file is stored.
  • Type: ‘vagrant up’ and hit enter(The vagrant machine will boot up)
  • Type: ‘vagrant ssh’ and hit enter(You will enter or ssh into the vagrant machine)
  1. Install Docker on vagrant machine and build product image:
    1. $ sudo yum install docker -y      (Install Docker)
    2. $ sudo systemctl start docker     (Start Docker Service)
    3. $ sudo systemctl status docker   (Check Docker Service Status)
    4. $ sudo systemctl enable docker  (Enable Docker Service On Startup)
    5. $ sudo docker run hello-world  (Hello From Docker! This message shows docker is installed correctly)
    6. $ sudo groupadd docker – Creating group docker
    7. $ sudo usermod -a -G docker $USER – providing permissions to docker
    8. $ sudo chmod 777 /var/run/docker.sock 
    9. $ ./build_product_image.sh 5.3.0 v01 – Building product image
    10. $ docker images   - To ensure that it is created

12. Building application image:
Used FraudDetectionCache application from BE examples. To prepare this application replace hard coded values in the HTTP Shared Resource with Global Variables. In this case, use HTTP_SERVER_HOST and HTTP_SERVER_PORT for the server host and ports respectively with default values localhost and 8109 respectively. Re-build the EAR file and copy it to "be_app" Folder.

  1. Rsync vagrant folder
  2. Provide permissions to execute perl and shell scripts in the directory
  3. Verify perl is already installed. To verify check /usr/bin/perl directory exists, if not then execute command $ sudo yum install perl
  4. From be_app folder execute below command:

./generate_dockerfile.pl "com.tibco.be:5.3.0-v01" "FraudDetection" fdcache@myorg.com

This will create dockerfile for the project.

  e. Now execute command ./build_app_image fdcache v01. This will build application image.
  f. Create a docker bridge network. This will be used for docker instance communication.
docker network create simple-bridge




That's all! Thanks a lot for reading.
Aditya

Comments