Jump to content
  • Deloying TIBCO BusinessWorks? Container Edition on Azure Container Service


    Manoj Chaurasia

    Table of Contents


    Microservices and Cloud actually make a good couple. TIBCO BusinessWorks Container Edition is one of the leading TIBCO platforms to develop microservices. In order to run these, you need a container platform (CloudFoundry or Docker). You could set up your own container platform or?.. get one in the Cloud.  Microsoft is one of the vendors that offer a Docker platform in the Cloud named Azure Container Service.(https://azure.microsoft.com/en-us/services/container-service/).  TIBCO BusinessWorks Container Edition (http://www.tibco.com/assets/bltac2e394e00bd3553/ds-businessworks-container-edition.pdf) can be run on Azure. This document describes how to do this.

    Preparation

    Generate a SSH key pair using Putty Key Generator.

    With an SSH keypair, you can create Virtual Machines on Azure that default to using SSH keys for authentication, eliminating the need for passwords to log in. Use the following steps to generate SSH keypair using Putty on Windows. Alternatively, Linux can be used to generate the SSH keys. See for more information: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-mac-create-ssh-keys/

    1. Download Putty Key Generator: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.

    2. Run the program. Make sure SSH-2 RSA is selected and that 2048 bits keys are used (default values). Click 'Generate'.

       

      Screenshot2022-11-06at11_43_51AM.thumb.png.15bb4ca2c54331a78cef07a132ae81a9.png

    3. Move the mouse until the keys are generated (the progress bar will proceed faster if you move the mouse faster).

    4. Create a password and save the public and private key:

       

      Screenshot2022-11-06at11_44_00AM.thumb.png.c8c041acf00c2806057122898921bd7b.png

    5. Also, save the private key in the OpenSSH format (we will this format when using SSH from Linux to set up an SSH tunnel later on). Click conversion --> export OpenSSH key. Name this key openssh.

      Screenshot2022-11-06at11_44_08AM.thumb.png.8e6f08889044537e1c59f7448f4f52ae.png

    Have available an Azure account.

    1. If you don't have it yet, create a free trial account at Azure (https://azure.microsoft.com/en-us/free/?b=16.33).

    Have available a docker VM.

    Although we will not run any docker containers on this VM, we need the docker client on this VM. In this document, it is assumed docker is installed on CentOS.

    1. If you don't have a CentOS VM available download it from open osboxes.org.

    2. Install docker using the following documentation: https://docs.docker.com/engine/installation/linux/centos/ 

    Create a TIBCO BusinessWorks Container Edition VM.

    In this document, it is assumed TIBCO BusinessWorks Container Edition is installed on CentOS.

    1. If you don't have a CentOS VM available download it from open osboxes.org.

    2. Download TIBCO BusinessWorks Container Edition from eDelivery. If you don't have access to eDelivery[https://edelivery.tibco.com/storefront/eval/tibco-businessworks-container-edition/prod11654.html] (for TIBCO Customers only), you can get a trial version from[http://www.tibco.com/products/businessworks-ce].

    3. Install TIBCO BusinessWorks Container Edition on your Linux VM. See for more information: https://docs.tibco.com/pub/bwce/2.1.0/doc/html/GUID-D4D790E3-04BD-46AB-BD4C-BA7328D332F9.html. The link refers to the TIBCO BusinessWorks Container Edition 2.1 documentation. For other versions see docs.tibco.com. 

    Create a simple Restful TIBCO BusinessWorks 6 application.

    As part of this exercise, we will deploy a TIBCO BusinessWorks application in a docker container. Create a simple (restful) application. Any will do. In this document, I will use the TIBCO BusinessWorks 6 application attached to this blog. It takes two parameters and returns the addition.

    To open the application use the following steps:

    1. Go to the TIBCO BusinessWorks Container Edition VM created in preparation for step D.

    2. Open TIBCO BusinessWorks Container Edition (default location: /opt/tibco/bwce/studio/4.0/eclipse/TIBCOBusinessStudio)

    3. If you get a warning 'Subversion Native Library' is not available, ignore it by clicking 'cancel' 

      Screenshot2022-11-06at11_44_18AM.thumb.png.93eecbe7ddb38651fe9162c2d66a476b.png

    4. Copy the zip file of the TIBCO BusinessWorks Container Edition VM.

       

      Screenshot2022-11-06at11_44_26AM.thumb.png.8441cbf0b373508f17522dc610f232c3.png

    5. Open BusinessStudio and click File -> import

       

      Screenshot2022-11-06at11_45_43AM.thumb.png.f1a45212a67438e9405c3c2f99e4abe2.png

    6. Click General --> Existing Studio Project into Workspace and click next.

       

      Screenshot2022-11-06at11_44_39AM.thumb.png.9ab55643203ed4ad94f942b593e783c5.png

    7. Select the add bw.zip, make sure all modules are selected, and click ' Finish 

       

      Screenshot2022-11-06at11_44_46AM.thumb.png.fff4833ec6daf73045585198c7c1d917.png

    After the project loaded, take a look at the simple add module:

     

    Screenshot2022-11-06at11_44_53AM.thumb.png.93b221137eea58ebfe6d79b2e1256f49.png

     

    Create a Docker environment on Azure

    As part of this section of the description, we will create a minimum instance of an 'Azure Container Service' with Swarm. This environment consists of three VMs:

    A Master VM, an Agent1 VM, and an Agent2 VM. The Agent VMs are used to run a 'Docker Swam cluster'. Every docker image and container will run on both VMs.

    The Master VM is used to run Docker Swarm. Swarm will distribute the docker deployments over both VMs.

    The Master VM has its own public IP address. Apart from that, one public virtual IP address is used for the agents. Both agents have a private IP address. A load balancer is used to distribute incoming traffic from the public virtual address to the private addresses.

    The figure below contains a schematic overview of the basic setup offered by Azure.

     

    Screenshot2022-11-06at11_45_01AM.thumb.png.4ad076d3084788dffc542893dc4e220f.png

     

    In order to create an 'Azure Container Service' with Swarm use the following steps.

    1. Log in to the Azure portal (https://portal.azure.com/) and select

       

      Screenshot2022-11-06at11_45_10AM.thumb.png.2044c0bd14e1ddb600d1965dde72adc0.png

    2. Click on 'create'

       

      Screenshot2022-11-06at11_45_16AM.thumb.png.7f6d954f8c04833385721ea7def5aedb.png

    3. Fill out the form as listed below. Copy the SSH public key from Putty Key Generator.

       

      Screenshot2022-11-06at11_45_23AM.thumb.png.5f2710dd97b81c892a670c713a737502.png

    4. Select 'Swarm' as the orchestration configuration.

       

      Screenshot2022-11-06at11_45_30AM.thumb.png.1e056875588432205dead5e66e6c07cc.png

    5. Select a 2-agent cluster. Use D1 servers for the agents and create the 'master' DNS prefix.

       

      Screenshot2022-11-06at11_45_37AM.thumb.png.c42e6b5aa0b5afa69532673435a0adad.png

    6. Wait for the validation to be finished and click OK

       

      Screenshot2022-11-06at11_45_43AM.thumb.png.9ada4f379e31b53874a922a29406f1ef.png

    7. Check the T&Cs and click purchase.

       

      Screenshot2022-11-06at11_45_50AM.thumb.png.a06cac3ce38b81a79f4711fdd61a0338.png

    8. Wait for the provisioning process to finish.

      Connect to the Azure Container Cluster. The Azure Docker Swarm clusters that are deployed by Azure Container Service expose REST endpoints. These are available via an SSH connection. In the following steps, an SSH tunnel is going to be set up from the Docker client VM to the master VM provisioned in Azure.

    9. Determine the IP address of the master VM.

      Go to the Azure portal and select Virtual machines and select the swarm-master.

       

      Screenshot2022-11-06at11_45_56AM.thumb.png.2f09de4caf23b70eabba3d9f2d25755b.png

    10. Copy the IP address and the DNS name on the clipboard. Save the IP address and DNS name.

       

      Screenshot2022-11-06at11_46_02AM.thumb.png.bab75a12b6ac24aeec7a9a918cfbc985.png

    11. Copy the openssh private key to the docker client VM. IMPORTANT: use the SSH key saved in the openssh format! 

    12. Open a terminal on the docker client VM and run the command:

       ssh -i <openssh filename> -L 2375:localhost:2375 -f -N <userName>@<azure host name> -p 2200

       

      <openssh filename>=the name of the openssh private key
      <username>=the user name entered in the first step of the Azure provisioning process
      <azure host name>=

      the DNS name recorded in the previous step

      Please mind: Microsoft uses 2200 as the SSH port (instead of the standard port 22).

      I used the following command.

       ssh -i ~/ssh/openssh -L 2375:localhost:2375 -f -N azureAdmin@<myhost>.northeurope.cloudapp.azure.com -p 2200

       

      You will be asked to type the password of the private key. Use the password you entered when you created the SSH keys.

      • Remark 1: If anything goes wrong during this step use the following command options to generate a logfile:

         ssh -v -v -v -i <openssh filename> -L 2375:localhost:2375 -f -N <userName>@<azure host name> -p 2200 -E <logfile>

      • Remark 2: After this step a tunnel is created from localhost:2375 to the masstermgmt server on Azure. This tunnel is to be used to run docker commands.

    13. In order to test if the tunnel was setup correctly, startup a browser on your Docker client VM and goto localhost:2375/_ping. It should give back 'Ok'.

       

      Screenshot2022-11-06at11_46_09AM.thumb.png.33bc86af206442640c7c881fc29e7822.png

       

      Alternatively, you can use 'nc -v localhost 2375' from a terminal. It should respond with: Ncat: Connected to::1:2375.

      Now that a tunnel is established we can use the docker client to manage Swarm. 

    14. Test access to docker swarm on Azure by typing: docker -H tcp://localhost:2375 info

    15. In order to avoid having to type the -H option every time, run the following command: export DOCKER_HOST=:2375

    16. Test by using: docker info

      Notice that there are two nodes in our cluster.

      --Expected output--

       Containers: 0  Running: 0  Paused: 0  Stopped: 0 Images: 0 Role: primary Strategy: spread Filters: health, port, dependency, affinity, constraint Nodes: 2  swarm-agent-XXXXXXXXXX: 10.0.0.4:2375   ? Status: Healthy   ? Containers: 0   ? Reserved CPUs: 0 / 1   ? Reserved Memory: 0 B / 3.528 GiB   ? Labels: executiondriver=, kernelversion=3.19.0-65-generic, operatingsystem=Ubuntu 14.04.4 LTS, storagedriver=aufs   ? Error: (none)   ? UpdatedAt: 2016-09-09T11:20:27Z  swarm-agent-XXXXXXXXXX: 10.0.0.5:2375   ? Status: Healthy   ? Containers: 0   ? Reserved CPUs: 0 / 1   ? Reserved Memory: 0 B / 3.528 GiB   ? Labels: executiondriver=, kernelversion=3.19.0-65-generic, operatingsystem=Ubuntu 14.04.4 LTS, storagedriver=aufs   ? Error: (none)   ? UpdatedAt: 2016-09-09T11:20:39Z Plugins:  Volume:  Network: Kernel Version: 3.19.0-65-generic Operating System: linux Architecture: amd64 CPUs: 2 Total Memory: 7.056 GiB Name: 7500f88c0c79 Docker Root Dir: Debug mode (client): false Debug mode (server): false WARNING: No kernel memory limit support

       

      Building a base TIBCO BusinessWorks Container Edition image on Azure

      While the Swarm cluster on Azure is up-and-running and you establish a connection to it, it is time to create a TIBCO BusinessWorks Container Edition base image.

    17. Copy the directory <TIBCO HOME>/bwce/<version>/docker from the TIBCO BusinessWorks Container Edition VM created in preparation for step D to the docker client VM.

      There are various ways to do this. This also depends on the hypervisor used to host both VMs. I used Windows + VM Workstation.

      1. Open the TIBCO BusinessWorks Container Edition VM created in preparation step D and copy the directory <TIBCO HOME>/bwce/<version>/docker to the clipboard (if you used a default installation that is opt/tibco/bwce/2.1/docker).

         

        Screenshot2022-11-06at11_46_18AM.thumb.png.099fc2f95d9794743d190d42d00d668e.png

      2. Past the directory to a temporary directory on the host and copy it again.

      3. Open the Docker client VM and paste the docker directory to a directory of your choice (I used ~/mydocker/tibco).

         

        Screenshot2022-11-06at11_46_25AM.thumb.png.d5ef9e6648f01c6b619961ebe1c2bab3.png

    18. Download bwce_cf.zip from edelivery. Please mind: it must be downloaded separately.  It is included in the TIBCO BusinessWorks Container Edition package. Make sure you select  'container' as the category. If you don't have a TIBCO BusinessWorks license you may download a trial version from: http://www.tibco.com/products/businessworks-ce.

    19. Copy bwce.cf.zip to home/mydocker/tibco/docker/resources/bwce-runtime (on the docker client VM).

    20. Open a terminal on the docker client VM and  run  'docker build -t tibco/bwce:latest .' from the directory home/mydocker/tibco/docker

    21. type 'docker images' to verify that the TIBCO BusinessWorks Container Edition image was created successfully. 

       

      Screenshot2022-11-06at11_46_33AM.thumb.png.c649a9d036d8bb7c76657ec5ee5209db.png

       

      After this step, a base TIBCO BusinessWorks Container Edition image (on ubuntu) is created on Azure.

      Creating an ear file for docker deployment

      Now that the base TIBCO BusinessWorks Container Edition image is available at Azure, it is time to create an EAR file to be deployed.

    22. Open the TIBCO BusinessWorks Container Edition VM and open Business studio. Make sure you have the test application loaded (see preparation set E).

    23. Switch TIBCO BusinessWorks Container Edition to docker (for details see: https://docs.tibco.com/pub/bwce/2.0.0/doc/html/GUID-82095A28-F502-4048-B065-CD187CF48E221.html)

      1. Click Windows-->Preferences

      2. Click BusinessWorks Container Edition -> Container Platform

      3. Select 'Docker'

         

        Screenshot2022-11-06at11_46_41AM.thumb.png.cde8d32af582358fe2447bc2cbdadca0.png

      4. restart studio.

    24. Create an EAR file

      1. Open calculator --> Package Unit --> Overview (double click)

      2. Select 'Export Application for Depoyment'. Name the file calculator_1.0.0.ear.

        Screenshot2022-11-06at11_45_37AM.thumb.png.00f2dea83ab9c29c5955a8a2ea64a14f.png

    25. Copy the ear file to the docker client VM.

      Deploy the EAR file

      The next couple of steps are used to deploy the EAR file on docker on Azure. 

    26. In the directory in which you stored dcalculator_1.0.0.ear create a file name Dockerfile (mind the capital 'D') with the following content:

       FROM tibco/bwce:latest MAINTAINER tibco ADD calculator_1.0.0.ear / EXPOSE 8080

      The Dockerfile is used to build a new image (based on the TIBCO BusinessWorks Container Edition base image) that includes the calculator's ear. For more information on Docker, files see: https://www.digitalocean.com/community/tutorials/docker-explained-using-dockerfiles-to-automate-building-of-images

    27. Build the application image by running the command:  docker build -t add-app .  (don't forget about the '.' at the end) from the directory in which you created Dockerfile.

    28. Run the command 'docker images. You should see the newly created image.

       

      Screenshot2022-11-06at11_46_55AM.thumb.png.f177bffbe3d3d9dfd2bf60fc56ffb7ae.png

    29. Run the command 'docker run -i -p 8080:8080 add-app' to start the container. You should get the following response:

       

      Screenshot2022-11-06at11_47_03AM.thumb.png.af0744de578e8aff892eea42774e1f61.png

       

      Test the implementations

      Now that the containers run successfully, it is time to do a test.

    30. Find out the public virtual IP address of the Swarm agent cluster.

      Open the azure portal and select Load Balancer--> swam-agent-lb-* --> Overview. Find the public IP address and copy it to the clipboard.

       

      Screenshot2022-11-06at11_47_11AM.thumb.png.b1870614f5a303689c5910ccca1714c0.png

    31. Open a browser (on any client connected to the internet) and open the address http://<public virtual agent address>:8080/swagger/ and make a call to the add service.

       

      Screenshot2022-11-06at11_47_18AM.thumb.png.1b247eaa38118acc6e73385c6dc48f87.png

    Reference: 

    add_with_host_bw.zip


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...