OpenEdge AWS Cloud Templates uses the following three compressed archive files, referred to as the Application Deployment Packages, which provide the application code for the EC2 machines used in the infrastructure:
  • db.tar.gz—This is the archive file used with the database, which is deployed when instantiating the database machines DatabaseSource (db0), DatabaseReplica1 (db1), and DatabaseReplica2 (db2).
  • pas.tar.gz—This is the archive file used with the PAS for OpenEdge application code. This archive is deployed whenever the PAS for OpenEdge machines, named pasoe in the EC2 page, are instantiated in its Auto Scaling Group (ASG). This is configured when you create the infrastructure for the first time and when new machines instances are launched in the ASG.
  • web.tar.gz—This is the archive file used with the Web UI application code. This archive is deployed whenever the Web Server machines, named webserver in the EC2 page, are instantiated in its ASG. This is configured when you create the infrastructure for the first time and when new machines instances are launched in the ASG.

The packages are specified as URLs pointing to an S3 bucket. Using an S3 protects the packages and provides accessibility to the OpenEdge on AWS CloudFormation templates. For automating the process, use the aws s3 command to upload the packages to an S3 bucket. For more information, refer to the AWS documentation.

You can also use the application deployment packages on on-premise machines running Linux. The OpenEdge deployed with AWS CloudFormation Templates uses Amazon Linux 2 machines

Structure of an application deployment package

The folders and files in an application deployment package are user-defined and includes the application code and support files required to deploy the application. The package can also download additional component. The package has the following requirements:
  • Folders and files contained in an app/ folder.
  • app/deploy.sh script to deploy the package on the machine.
The basic structure of an application deployment package consists of the following:
  • app/deploy.sh
  • app/progress.cfg (optional)
  • app/db (optional)
  • app/pas (optional)
  • app/web (optional)

The actual implementation of the app/deploy.sh script and package must be provided by your System Administrator. You can use the OpenEdge Archive functionality to deploy the PAS for OpenEdge components.

The OpenEdge installation in the database and PAS for OpenEdge machines do not include a license file. The deploy.sh script must include the code to install the license file. It is recommend to include a copy of the license file in app/progress.cfg and copy it to the OpenEdge installation on the corresponding machines. An alternate implementation can then download or copy the progress.cfg file from another location.

The package can include a rc.local file with the code to support a restart of the database machines and/or PAS for OpenEdge. Alternatively, you can have a code to create a service, which is the same as the code used to setup the machines on an on-premise environment.

Deploy the application deployment packages

The application deployment packages are deployed automatically by the template code run by CloudFormation. The cloud initialization script for each machine extracts each package into an /install folder on the corresponding machine. Each package is then deployed using the following command:
export OE_ENV=<machine type> # Environment variables used for dynamic configuration /install/app/deploy.sh

The deploy.sh script is user-defined and its implementation is provided by your System Administrator. The System Administrator can also extend the app/deploy.sh script to accept other environment variables that are used to perform custom operations when running the deployment on an on-premise or on a CI/CD pipeline environment.

You can use a single script that is included on each application deployment package or separate one.

The deploy.sh script must meet the following convention:
Environment Variables

The environment variables used as input by the deploy.sh script. These variables are used to determine the type of machine and tailor dynamic configuration.

Variables:
  • OE_ENV—Specifies the type of machine where the package is getting installed. For example, the database, PAS for OpenEdge, or Web Server.
    • db0—EC2 machine running the database broker.
    • db1—EC2 machine used for the first database replication target.
    • db2—EC2 machine used for the second database replication target.
    • pasoe—The PAS for OpenEdge EC2 machine in an ASG.
    • webserver—The Web Server EC2 machine in an ASG.
  • DBHostName—The private IP address of the EC2 machine running the database broker ( db0).
  • DBHostName1—The private IP address of the EC2 machine running the first database replication target (db1).
  • DBHostName2—The private IP address of the EC2 machine running the second database replication target (db2).
  • PASOEURL—The DNSName to the Elastic Load Balancer for the PAS for OpenEdge ASG.
Description

The deploy.sh script uses the OE_ENV variable environment to determine the application code to deploy from the package.

The environment variables are set by the CloudFormation template based on the machine being initialized.
  • For a PAS for OpenEdge machine, the CloudFormation template specifies DBHostName, DBHostName1, and DBHostName2 so that the deploy.sh script can tailor configuration files that point to the database machines.

  • For a Web Server machine, the CloudFormation template specifies PASOEURL so that the deploy.sh script can tailor application code that points to the PAS for OpenEdge machine.

Sample app/deploy.sh script

This section provides general structure of the app/deploy.sh script. Refer to this sample application deployment packages for a runnable application.
#!/bin/bash
#
# set -x
#
export DLC=/psc/dlc
export PATH=$DLC/bin:$PATH
case $OE_ENV in
db0)
cp /install/app/db/rc.local /etc/rc.local
chmod +x /etc/rc.local
cp /install/app/progress.cfg /psc/dlc/
cd /psc/wrk
# Commands to setup the OpenEdge database
# Generally, a backup of the database can be included in the
# app/db folder. Actual implementation provided by DevOps.
;;
db1)
cp /install/app/db/rc.local /etc/rc.local
chmod +x /etc/rc.local
cp /install/app/progress.cfg /psc/dlc/
cd /psc/wrk
# Commands to setup the OpenEdge Replication Target 1
# Generally, a backup of the database can be included in the
# app/db folder. Actual implementation provided by DevOps.
;;
db2)
cp /install/app/db/rc.local /etc/rc.local
chmod +x /etc/rc.local
cp /install/app/progress.cfg /psc/dlc/
cd /psc/wrk
# Commands to setup the OpenEdge Replication Target 2
# Generally, a backup of the database can be included in the
# app/db folder. Actual implementation provided by DevOps.
;;
pasoe)
cp /install/app/pas/rc.local /etc/rc.local
chmod +x /etc/rc.local
cp /install/app/progress.cfg /psc/dlc/
mkdir -p /psc/wrk/
cd /psc/wrk
pasman create -v oepas1
cp /install/app/pas/autoreconnect.pf /psc/wrk/
sed -i "s/DBHostName1/${DBHostName1}/" autoreconnect.pf
sed -i "s/DBHostName2/${DBHostName2}/" autoreconnect.pf
sed -i "s/DBHostName/${DBHostName}/" autoreconnect.pf
# Code to configure the PASOE instance
# Copy openedge.properties, anonymousLoginModel.xml and other
# configuration files.
#
# You can use the OpenEdge Archive functionality here.
export TERM=xterm
/psc/wrk/oepas1/bin/tcman.sh pasoestart
;;
webserver)
cp /install/app/web/*.html /var/www/html
cp /install/app/web/*.js /var/www/html
if [ -f /etc/nginx/sites-available/default ]
then
SRC_CONF_FILE=/install/app/web/default
CONF_FILE=/etc/nginx/sites-available/default
else
SRC_CONF_FILE=/install/app/web/nginx.conf
CONF_FILE=/etc/nginx/nginx.conf
fi
cp $SRC_CONF_FILE $CONF_FILE
if [ -z "$HTTP_PORT" ]
then
sed -i "s|HTTP_PORT|80|" $CONF_FILE
else
sed -i "s|HTTP_PORT|${HTTP_PORT}|" $CONF_FILE
fi
sed -i "s|PASOEURL|${PASOEURL}|" $CONF_FILE
systemctl restart nginx
;;
esac