LogoLogo
  • Documentation
  • PRODUCT REFERENCE
    • Introduction
    • Concepts and Terminology
      • Console
      • Servers (X Agents)
      • Projects
      • Configurations
      • Rules Editor
      • Rules, rule catalogue, protocol rules and rule sets
      • Test Data
      • Trace Data
      • Flight Recorders
      • Case Managers
      • Data Files
      • Content Files
      • Performance Data
      • Extensions
      • Protocols
      • Credential Vault
      • Custom Functions
      • Databases
      • Input Adaptors
      • Users
      • User Roles
      • Access Rules
      • Repositories
      • Audit Log
      • Proxies
    • Architectural Scenarios
      • Command and Control
      • Simplest Form
      • Servlet Filter
      • API Transformation
      • Active Web Proxy
      • Web Application Server
      • Active Proxy With Content
      • Mobile Application Server
      • Asynchronous Multi-Protocol
      • Data Loss Prevention Architecture
    • Getting Started
      • Login
      • Essential Things to do First
      • Keeping the Product Current
      • Common Console Management Tasks
      • Viewing Active Servers
    • Quick Product Introduction
      • Preparing the Browser Proxy
      • Setting up the Proxy in the Browser
      • Verifying the Browser Configuration
      • Understanding the Configuration
      • Understanding input and variables
      • Preparing a new repository
      • Locating the Page to Modify
      • Determining the Actions Required
      • Building the First Rule Set
      • Setting Rule Properties
      • Connecting up the First Rule
      • Getting a Server Result
      • Manipulating the Server Result
      • Returning the Result to the User
      • Creating a Configuration for the Rule Set
      • Selecting the Input Source
      • Deploying the New Configuration
      • Testing the Rules
    • X Agent details
      • Configuration Settings
      • Rule Sets
      • Tips and Techniques for Working with the Rules Editor
      • Web Application Rule Set Patterns
      • Building Rule Sets for Inclusion
      • Notes on Working with SOAP
      • Zero Installation Rules Testing
    • Data Files
    • Content Files
      • Previewing Content Files
      • Editing Content Files
      • Deploying Content Files
    • Test Data
      • Uploading and Downloading Test Data
    • Performance Data
      • Setting the Performance Collection Level
      • Retrieving the Performance Data
      • Viewing Transaction Counts
      • Viewing Transaction Counts and Inline Time
      • Viewing the Complete Performance Report
      • Understanding the URI Performance Information
      • Performance Benchmarks
    • Trace Data
      • Understanding the Trace
    • Tracing the Result of a System Failure
    • Conjoined Performance and Trace data
    • Live Performance Data and Probes
      • Setting Probes
      • Live Performance Impact Considerations
    • Accessing Server Logs
      • Viewing a log
    • Working with Flight Recorders
      • Searching Flight Recorder Information
      • Retrieving Flight Recorder Data
      • Graphing Flight Recorder Data
    • Working with Case Managers
      • Case Manager Definitions
      • Navigating the Case Managers
      • Creating a Case From Rules
      • Creating a Case From the Console
      • Viewing the Queues
      • Picking a Task
      • Case View
      • Completing a Task
      • Task History
      • Searching Tasks
      • Searching Cases
    • Managing Repositories
      • Moving Files Between Repositories
      • Copying Configurations and Rule Sets Together
      • Copying Dependent Rule Sets
      • Backing up
      • Moving Entire Repositories Between Consoles
      • Setting Repository Imports
      • Specifying Repository Rule Group Restrictions
    • Version Control and Restoring Files
    • Using the Portal UI
      • Using the Start Menu
      • Positioning Windows
      • Resizing Windows
      • Maximize, Restore and Minimize
      • Storing and Switching Desktops
    • Enterprise Level Projects
      • Creating a Project
      • Working with Tasks
      • Closing a Task
      • Closing a Project
      • Project Assistants and Work Output
    • Administration Functions
      • Extensions
      • Custom Function Setup
      • Setting up a Database
      • Input Adaptors
      • Credential Vault
      • Log Adaptors
      • Server Definitions
      • Managing Large Clusters
      • Setting up the Flight Recorder in the Console
      • Creating a Case Manager Definition
      • Work Output
      • Project Definition
      • Managing Users
      • Managing User Roles
      • Managing Access Rules
      • Authenticating via LDAP
      • Authenticating via SAML
      • Audit Log
    • Installation and Configuration
      • Installing on macOS
      • Installing on Red Hat Enterprise Linux
      • Installing on Windows - Quick Start
      • System Requirements
      • Server Installation
      • Understanding the Console Deployment Structure
      • Console Server Type Configuration
      • Console Server Configuration
      • Removing Other Unnecessary Components
      • Installing Inline with an Existing Application
      • Installing a Stand-alone Multi-Protocol Feed Server
      • Installing a Stand-alone Built in Forwarding Proxy
      • Creating a Cluster Slave Console Instance
      • Understanding the magic.properties Configuration Settings
      • Port Numbers and how to Change Them
      • Dealing with Internal Failures
      • Linking Multiple Applications Together into a Single Server
      • Monitoring by External Systems
      • Installation Considerations for Portals
      • Docker Configuration Guide
      • AWS User Deployment Guide
      • Google Cloud User Deployment Guide
    • Creating a Stand-alone Built in Forwarding Proxy
      • Installing with Ubuntu and mySQL
    • Setting up a DNS override for Data Loss Prevention
      • Deciding what to Override
      • Installing a DNS Server for the Overrides
      • Setting the Override
      • SSL Considerations
    • Backup and Restore
      • The Server Component
      • The Console Component
    • Third Party Software
      • Open Source Components
      • Closed Source Licensed Components
      • Licenses
  • PROGRAMMER'S GUIDE
    • Composable Agentic Platform Concepts
    • Setting up a Development Environment
    • Creating a Rule
    • The Kapow Extension - Example
    • Java Documentation
  • CONSOLE WIZARDS
    • Create REST with JSON service
    • Create JDBC database definitions
    • Create data set maintenance custom function
  • BEST PRACTICES
    • Naming Conventions
    • Comments & Descriptions
    • Application Configuration
    • Rules & Rule Sets
    • Repositories
    • Data Manipulation
    • Internationalization
    • Debugging
    • Performance Testing
    • Tag Replacement Techniques
    • Best Practices Repository
  • GUIDES
    • Hello, World!
    • TCL Script Writer Reference
    • Windows Automation Reference
    • Browser Certificate Installation Guide
    • Web Development Guide
    • Using the Push Notification Framework
    • Raspberry Pi with PiFace Reference
    • TomorrowX Portal User Guide
    • Examples
      • CSRF attack prevention
      • Two Factor Authentication
      • Frame Busting
      • Google Analytics
      • DNS Multi Protocol
      • Customer Satisfaction Survey
  • CHANGE HISTORY
    • New in Version 8
    • New in Version 7
    • New in Version 6
    • New in Version 5
    • New In Version 3.1
    • New In Version 3.0
  • 🌏TIME ZONES
  • ❓TROUBLESHOOTING
    • DB2 SQL error: SQLCODE: -443
    • Error 404 when trying to access the console
    • java.io.IOException: Too many open files
    • Accidental deploy to console server
  • ⚙️BROWSE COMPONENTS
  • EULSA
Powered by GitBook
On this page
  • Introduction
  • Traditional Pipeline
  • Tomorrow Software Integrated Pipeline
  • Deployment Overview
  • Tomorrow Software Configuration – JBoss/WildFly
  • Create the Tomorrow Software Server Definition
  • Pipeline Stage 1 - Extract
  • Pipeline Stage 2 - Configure
  • Pipeline Stage 3 – WAR File
  • Pipeline Stage 4 – Docker Image
  • Validate Docker Image
  • Including a Database Driver
Export as PDF
  1. PRODUCT REFERENCE
  2. Installation and Configuration

Docker Configuration Guide

PreviousInstallation Considerations for PortalsNextAWS User Deployment Guide

Last updated 4 months ago

Introduction

This guide walks through the process of embedding Tomorrow Software into a CI/CD pipeline and creating a containerized deployment. It is assumed that the reader is familiar with the basic steps of deploying configurations within Tomorrow Software and understands the basic concepts of Docker and Jenkins.

The Tomorrow Software console provides a proprietary integrated solution development environment including version management of all repositories (rulesets, configurations, content files etc.) created within the console. As a result, Tomorrow Software will retain the ‘source’ mastering responsibility and the process described below does not implement a traditional source code repository solution for driving CI/CD pipelines.

Traditional Pipeline

Build pipelines are typically initiated via changes to the source code repository using triggers on check-in or merge requests.

Tomorrow Software Integrated Pipeline

The Tomorrow Software console provides sandpit functionality for local rapid solution development configuration and testing. Locally defined service endpoints are used to interface with the delivery pipeline.

Deployment Overview

A predefined server definition within the Tomorrow Software console is used to stage a release candidate. Whereas the traditional operational model is to push the configuration directly to a remote (production) endpoint, the staged candidate is stored locally on the console server. A command (CLI) function is provided to package the staged release in a format that can be incorporated into a container image.

The process described in this document details the steps to create a JBoss/WildFly container with the running Tomorrow Software configuration based on a server definition called UATServer1. By having “functional environment” named servers the console can manage the specific configuration such as credentials that may differ as candidates are promoted through environments.

Jenkins Plugins Used

Deployment process pseudocode

  1. Pass the Tomorrow Software server name into pipeline as a parameter

  2. Create deployment structure in workspace

  3. Call Tomorrow Software console CLI function to get home location of console.

  4. Copy required configuration files into workspace

  5. Retrieve deployment configuration using console CLI function

  6. Edit Tomorrow Software configuration files with target parameters

  7. Build WAR file

  8. Build Docker image

Tomorrow Software Configuration – JBoss/WildFly

Create the Tomorrow Software Server Definition

The first step is to create a server definition in the Tomorrow Software Console for the target (UATServer1) server.

Once the server has been created, deploy the BaseWebTrial example configuration. This will publish the default configuration files to the file system and provides a known starting point to verify files are correctly included and propagated into the container.

#ls -la
total 20124
drwxrwxr-x.  4 tomorrow tomorrow     4096 Sep 14 20:21 .
drwxr-xr-x. 10 tomorrow tomorrow     4096 Sep 14 20:17 ..
-rw-r--r--.  1 tomorrow tomorrow     4092 Sep 14 20:21 ActiveRules.xml
drwxr-xr-x.  3 tomorrow tomorrow       31 Sep 14 20:21 backups
-rw-r--r--.  1 tomorrow tomorrow     4753 Sep 14 20:21 BasicWebLister.xml
-rw-r--r--.  1 tomorrow tomorrow     4092 Sep 14 20:21 BasicWebTrial.xml
-rw-r--r--.  1 tomorrow tomorrow    33584 Sep 14 20:21 errors.properties
-rw-r--r--.  1 tomorrow tomorrow 20539238 Sep 14 20:21 GeoLiteCity.dat
drwxr-xr-x.  3 tomorrow tomorrow     4096 Sep 14 20:21 resources

Pipeline Stage 1 - Extract

The first pipeline stage prepares the workspace and prepares all files. Two Tomorrow Software console CLI commands are executed, getInstallLocation and getServerHome. The first returns the absolute folder path that the console server is installed; the second command returns a zip-file with the deployed server contents

stage('Extract from Console') {
steps {
echo 'Stage1 – Prepare and Extract from Console'
script {
def dockerDir = "${env.WORKSPACE}/docker"
def scriptServer="http://localhost/console/ScriptRunner"
def usr = "admin"
def pwd = "admin"
sh "rm -rf ${dockerDir}"
sh "mkdir ${dockerDir}"
sh "mkdir ${dockerDir}/configuration"
sh "mkdir ${dockerDir}/jars"
sh "mkdir ${dockerDir}/war"
def getInstallHomeCmd = "puts \" [getInstallLocation ]\" "
response = httpRequest httpMode: 'POST',
contentType: 'APPLICATION_FORM',
url: "${scriptServer}",
requestBody: "user=${usr}&password=${pwd}&script=${getInstallHomeCmd}"
def consoleHomeValue = response.content
sh "cp ${consoleHomeValue}/BaseApp/appname/WEB-INF/web.xml ${dockerDir}/configuration"
sh "cp ${consoleHomeValue}/BaseApp/appname/WEB-INF/classes/magic.properties ${dockerDir}/configuration"
sh "cp ${consoleHomeValue}/BaseApp/appname/WEB-INF/lib/magic-10.0.jar ${dockerDir}/jars"
sh "cp ${consoleHomeValue}/BaseApp/appname/WEB-INF/lib/magic-10.0.jar ${dockerDir}/jars"
sh "cp ${consoleHomeValue}/server/lib/jdbc/derby/derby.jar ${dockerDir}/jars"
def deployZip = "${env.WORKSPACE}/${params.SERVER}.zip"
def tempDeployZip = "${consoleHomeValue}/server/temp/${params.SERVER}.zip"
def getServerHomeCmd = "set tmp \"[getServerHome ${params.SERVER} ${tempDeployZip} ]\" "
response = httpRequest httpMode: 'POST',
contentType: 'APPLICATION_FORM',
url: "${scriptServer}",
requestBody: "user=${usr}&password=${pwd}&script=${getServerHomeCmd}"
sh "mv ${tempDeployZip} ${deployZip} "
unzip zipFile: "${deployZip}", dir: "${dockerDir}/Tomorrow", quiet: true
}
}

Pipeline Stage 2 - Configure

Stage 2 involves updating the magic.properties file to set the target home directory, autostart and the admin port details.

stage('Update Config Files') {
steps {
echo 'Stage2 - Update Config Files'
script {
sh "sed -i \"s|homeDir=.*\$|homeDir=//Tomorrow//${params.SERVER}//|g\" ${env.WORKSPACE}/docker/configuration/magic.properties"
sh "sed -i \"s|autoStart=.*\$|autoStart=true|g\" ${env.WORKSPACE}/docker/configuration/magic.properties"
sh "sed -i \"s|port=.*\$|port=9990|g\" ${env.WORKSPACE}/docker/configuration/magic.properties"
}
}
}

Pipeline Stage 3 – WAR File

The third stage involves wrapping the config and jar files into a WAR file for deployment into the web-application server. Ant is used to build the WAR and it is driven by an XML file generated from within the pipeline script.

stage('Build WAR File') {
steps {
echo 'Stage3 - Build WAR File'
script {
def wL1 = "<?xml version=\"1.0\" ?><project name=\"InlineFilter\" default=\"war\"><target name=\"war\" >"
def wL2 = "<war destfile=\"./TomorrowInlineFilter.war\" webxml=\"../configuration/web.xml\">"
def wL3 = "<lib dir=\"../jars\"><include name=\"magic-10.0.jar\"/></lib>"
def wL4 = "<lib dir=\"../jars\"><include name=\"derby.jar\"/></lib>"
def wL5 = "<classes dir=\"../configuration\"><include name=\"magic.properties\"/></classes>"
def wL6 = "</war></target></project>"
writeFile file: "./docker/war/InlineFilterBuild.xml", text: "${wL1}${wL2}${wL3}${wL4}${wL5}${wL6}"
def antVersion = 'Ant1.9.4'
withEnv( ["ANT_HOME=${tool antVersion}"] ) {
sh "$ANT_HOME/bin/ant -buildfile ./docker/war/InlineFilterBuild.xml"
}
}
}
}

Pipeline Stage 4 – Docker Image

The fourth stage in this pipeline example creates a Docker image from the configured files using the repository tag tomorrow/jboss. The Dockerfile used to construct the image is dynamically generated from the Jenkins pipeline script.

stage('Build Docker Image') {
steps {
echo 'Stage3 - Build WAR File'
script {
def dL1 = "FROM jboss/wildfly"
def dL2 = "ADD ./war/TomorrowInlineFilter.war /opt/jboss/wildfly/standalone/deployments/"
def dL3 = "RUN /opt/jboss/wildfly/bin/add-user.sh admin abc123ABC## --silent"
def dL4 = "USER root"
def dL5 = "RUN mkdir /Tomorrow"
def dL6 = "RUN chmod 777 /Tomorrow"
def dL7 = "ADD ./Tomorrow /Tomorrow"
writeFile file: "./docker/dockerfile", text: "${dL1}\r\n${dL2}\r\n${dL3}\r\n${dL4}\r\n${dL5}\r\n${dL6}\r\n${dL7}"
}
sh 'docker build -t tomorrow/jboss ./docker/'
}
}

Validate Docker Image

Following successful pipeline execution. The image tomorrow/jboss is available.

#docker image list
REPOSITORY    TAG       IMAGEID        CREATED             SIZE
tomorrow/jboss     latest    b1491713e153   21 minutes ago      826MB

Verify the image runs correctly with the Tomorrow Software WAR file installed

#docker run tomorrow/jboss
=========================================================================
  JBoss Bootstrap Environment
  JBOSS_HOME: /opt/jboss/wildfly
  JAVA: /usr/lib/jvm/java/bin/java
  JAVA_OPTS:  -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true  --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=jdk.unsupported/sun.misc=ALL-UNNAMED --add-exports=jdk.unsupported/sun.reflect=ALL-UNNAMED --add-modules=java.se
=========================================================================
01:27:28,176 INFO  [org.jboss.modules] (main) JBoss Modules version 1.9.0.Final
…
01:27:35,592 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 74) WFLYCLINF0002: Started client-mappings cache from ejb container
01:27:35,756 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 75) WFLYUT0021: Registered web context: '/TomorrowInlineFilter' for server 'default-server'
01:27:35,868 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 43) WFLYSRV0010: Deployed "TomorrowInlineFilter.war" (runtime-name : "TomorrowInlineFilter.war")
01:27:35,946 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server

A final sanity check to ensure that the deployed BasicWebTrial configuration is correctly deployed in the /Tomorrow folder of the image and matches the original software folder investigated.

#docker exec -i 12ad580d409c ls -la /Tomorrow
total 20120
drwxrwxrwx.  3 root root     4096 Sep 15 01:00 .
drwxr-xr-x. 17 root root     4096 Sep 15 01:27 ..
-rw-rw-r--.  1 root root     4092 Sep 15 01:00 ActiveRules.xml
-rw-rw-r--.  1 root root     4753 Sep 15 01:00 BasicWebLister.xml
-rw-rw-r--.  1 root root     4092 Sep 15 01:00 BasicWebTrial.xml
-rw-rw-r--.  1 root root 20539238 Sep 15 01:00 GeoLiteCity.dat
-rw-rw-r--.  1 root root    33584 Sep 15 01:00 errors.properties
drwxrwxr-x.  3 root root       19 Sep 15 01:00 resources
#cat HOME/UATServer1/ActiveRules.xml | grep ^version
version="2019-09-14 20:21:34.197"
#docker exec -i 12ad580d409c cat /Tomorrow/ActiveRules.xml | grep ^version
version="2019-09-14 20:21:34.197"

Including a Database Driver

Where a configuration needs to connect to an external database, the JDBC driver file will need to be included into the Pipeline Stage-3 (WAR File) and a shell command to move the file from the configuration base directory to the staging folder.

The following example shows the updates required to include a Postgres JDBC driver as part of the build process.

Include the EDB driver as a Data File into the configuration as per below.

As part of the extract from console function the JDBC jar file needs to be included and copied to the target jars directory and then added to the WAR file create task.

// move the JDBC driver out of the way
sh "mv ${dockerDir}/Tomorrow/edb-jdbc18.jar ${dockerDir}/jars"

def wL1 = "<?xml version=\"1.0\" ?><project name=\"InlineFilter\"
…
def wL4_jdbc = "<lib dir=\"../jars\"><include name=\"edb-jdbc18.jar\"/></lib>"
…
writeFile file: "./docker/war/InlineFilterBuild.xml", text: "${wL1}${wL2}${wL3}${wL4}${wL4_jdbc}${wL5}${wL6}"

– calls the Tomorrow Software console CLI interface

– creates the Tomorrow Software WAR file

HTTP Request
Ant
pipeline
pipeline
Tomorrow Console Server
Create new X Agent Server
Data files folder