Mainframe modernization: DevOps on AWS with Micro Focus - AWS Prescriptive Guidance

Mainframe modernization: DevOps on AWS with Micro Focus

Created by Kevin Yung (AWS)

Source: IBM z/OS Mainframe

Target: AWS

R Type: N/A

Environment: PoC or pilot

Technologies: DevOps; Infrastructure

AWS services: Amazon EC2; AWS CloudFormation; CodeBuild; CodeCommit; CodeDeploy; Systems Manager; CodePipeline

Summary

Customer challenges

Organizations that run core applications on mainframe hardware usually encounter a few challenges when the hardware needs to scale up to meet the demands of digital innovations. These challenges include the following constraints. 

  • Mainframe development and test environments are unable to scale due to the inflexibility of mainframe hardware components and the high cost of changing.

  • Mainframe development is facing skill shortages, because new developers are not familiar and not interested in the traditional mainframe development tools. Modern technology such as containers, continuous integration/continuous delivery (CI/CD) pipelines, and modern test frameworks are not available in mainframe development.

Pattern outcomes

To address these challenges, Amazon Web Services (AWS) and Micro Focus, an AWS Partner Network (APN) Partner, have collaborated to create this pattern. The solution is designed to help you achieve the following outcomes.

  • Improved developer productivity. Developers can be given new mainframe development instances within minutes.

  • Use of the AWS Cloud to create new mainframe test environments with virtually unlimited capacity.

  • Rapid provisioning of new mainframe CI/CD infrastructure. Provisioning on AWS can be completed within an hour by using AWS CloudFormation and AWS Systems Manager.

  • Native use of AWS DevOps tools for mainframe development, including AWS CodeBuild, AWS CodeCommit, AWS CodePipeline, AWS CodeDeploy, and Amazon Elastic Container Registry (Amazon ECR).

  • Transform traditional waterfall development to agile development in mainframe projects.

Technologies summary

In this pattern, the target stack contains the following components.

Logical components Implementation solutions Description
Source code repositories Micro Focus AccuRev Server, CodeCommit, Amazon ECR Source code management – The solution uses two types of source code. 
  • Mainframe source code, for example COBOL, JCL, etc. 

  • AWS infrastructure templates and automation scripts 

Both types of source code need version control, but they are managed in different SCMs. Source code deployed into mainframe or Micro Focus Enterprise Servers is managed in Micro Focus AccuRev Server. AWS templates and automation scripts are managed in CodeCommit. Amazon ECR is used for the Docker image repositories.
Enterprise developer instances Amazon Elastic Compute Cloud (Amazon EC2), Micro Focus Enterprise Developer for Eclipse Mainframe developers can develop code in Amazon EC2 by using Micro Focus Enterprise Developer for Eclipse. This eliminates the need to rely on mainframe hardware to write and test code. 
Micro Focus license management Micro Focus License Manager For centralized Micro Focus license management and governance, the solution uses Micro Focus License Manager to host the required license.
CI/CD pipelines CodePipeline, CodeBuild, CodeDeploy, Micro Focus Enterprise Developer in a container, Micro Focus Enterprise Test Server in a container, Micro Focus Enterprise Server Mainframe development teams need CI/CD pipelines to perform code compilation, integration tests, and regression tests. In AWS, CodePipeline and CodeBuild can work with Micro Focus Enterprise Developer and Enterprise Test Server in a container natively.

Prerequisites and limitations

Prerequisites 

Name Description
py3270 py3270 is a Python interface to x3270, an IBM 3270 terminal emulator. It provides an API to a x3270 or s3270 subprocess.
x3270 x3270 is an IBM 3270 terminal emulator for the X Window System and Windows.  This can be used by developer for unit testing locally.
Robot-Framework-Mainframe-3270-Library Mainframe3270 is a library for Robot Framework based on py3270 project.
Micro Focus Verastream Micro Focus Verastream is an integration platform that enables testing mainframe assets the way that mobile apps, web applications, and SOA web services are tested.
Micro Focus Unified Functional Testing (UFT) installer and license Micro Focus Unified Functional Testing is software that provides functional and regression test automation for software applications and environments.
Micro Focus Enterprise Server installer and license Enterprise Server provides the runtime environment for mainframe applications.
Micro Focus Enterprise Test Server installer and license Micro Focus Enterprise Test Server is an IBM mainframe application test environment
Micro Focus AccuRev installer and license for Server, and Micro Focus AccuRev installer and license for Windows and Linux operating systems AccuRev provides source code management (SCM). The AccuRev system is designed for use by a team of people who are developing a set of files.
Micro Focus Enterprise Developer for Eclipse installer, patch and license Enterprise Developer provide mainframe developer a platform to develop and maintain the core mainframe online and batch applications.

Limitations 

  • Building a Windows Docker image is not supported in CodeBuild. This reported issue needs support from Windows Kernel/HCS and Docker teams. The work-around is to create a Docker image build runbook by using Systems Manager. This pattern uses the work-around to build Micro Focus Enterpise Developer for Eclipse and Micro Focus Enterprise Test Server Container images. 

  • Virtual private cloud (VPC) connectivity from CodeBuild is not supported in Windows yet, so the pattern does not use Micro Focus License Manager to manage licenses in Micro Focus Enterprise Developer and Micro Focus Enterprise Test Server containers.

Product versions

  • Micro Focus Enterprise Developer 5.5 or later

  • Micro Focus Enterprise Test Server 5.5 or later

  • Micro Focus Enterprise Server 5.5 or later

  • Micro Focus AccuRev 7.x or later

  • Windows Docker base image for Micro Focus Enterprise Developer and Enterprise Test Server: microsoft/dotnet-framework-4.7.2-runtime

  • Linux Docker base image for AccuRev client: amazonlinux:2

Architecture

Mainframe environment

In conventional mainframe development, the developers need to use mainframe hardware to develop and test programs. They face capacity limitations, for example restricted million instructions per second (MIPS) for the dev/test environment, and they must rely on the tools that are available on the mainframe computers.

In many organizations, mainframe development follows the waterfall development methodology, with teams relying on long cycles to release changes. These release cycles are usually longer than digital product development.   

The following diagram shows multiple mainframe projects sharing mainframe hardware for their development. In mainframe hardware, it is expensive to scale out a development and test environment for more projects.

  

AWS architecture  

This pattern extends mainframe development to the AWS Cloud. First, it uses Micro Focus AccuRev SCM to host the mainframe source code on AWS. Then it makes Micro Focus Enterprise Developer and Micro Focus Enterprise Test Server available for building and testing the mainframe code on AWS. 

The following sections describe the pattern's three major components.

1. SCM

In AWS, the pattern uses Micro Focus AccuRev to create a set of SCM workspaces and version control for the mainframe source code. Its stream-based architecture enables parallel mainframe development for multiple teams. To merge a change, AccuRev uses the promote concept. To add that change to other workspaces, AccuRev uses the update concept.

At the project level, each team can create one or more streams in AccuRev to track project level changes. These are called project streams. These project streams are inherited from the same parent stream. The parent stream is used to merge the changes from different project streams.

Each project stream can promote code to AccuRev, and a promote post trigger is set up to initiate the AWS CI/CD pipeline. The successful build for a project stream change can be promoted to its parent stream for more regression tests.  

Usually, the parent stream is called the system integration stream. When there is a promotion from a project stream to a system integration stream, a post promotion trigger initiates another CI/CD pipeline to run regression tests.

In addition to mainframe code, this pattern includes AWS CloudFormation templates, Systems Manager Automation documents, and scripts. Following infrastructure-as-code best practices, they are version-controlled in AWS CodeCommit. 

If you need to synchronize mainframe code back to a mainframe environment for deployment, Micro Focus provides the Enterprise Sync solution, which synchronizes code from the AccuRev SCM back to the mainframe SCM.

2. Developer and test environments

In a large organization, scaling more than a hundred or even more than a thousand mainframe developers is challenging. To address this constraint, the pattern uses Amazon EC2 Windows instances for development. On the instances, Micro Focus Enterprise Developer for Eclipse tools are installed. The developer can perform all mainframe code test and debugging locally on the instance. 

AWS Systems Manager State Manager and Automation documents are used to automate the developer instance provisioning. The average time to create a developer instance is within 15 minutes. The following software and configurations are prepared.

  • AccuRev Windows client for checking out and committing source code into AccuRev

  • Micro Focus Enterprise Developers for Eclipse tool, for writing, testing, and debugging mainframe code locally

  • Open source testing frameworks Python behavior-driven development (BDD) test framework Behave, py3270, and the x3270 emulator for creating scripts to test applications

  • A Docker developer tool for building the Enterprise Test Server Docker image and testing the application in the Enterprise Test Server Docker container 

In the development cycle, developers use the EC2 instance to develop and test mainframe code locally. When the local changes are tested successfully, developers promote the change into the AccuRev server.  

3. CI/CD pipelines

In the pattern, CI/CD pipelines are used for integration tests and regression tests before deployment to the production environment. 

As explained in the SCM section, AccuRev uses two types of streams: a project stream and an integration stream. Each stream is hooked up with CI/CD pipelines. To perform the integration between the AccuRev server and AWS CodePipeline, the pattern uses AccuRev post promotion script to create an event to initiate CI/CD.

For example, when a developer promotes a change to a project stream in AccuRev, it initiates a post promotion script to run in AccuRev Server. Then the script uploads the metadata of the change into an Amazon Simple Storage Service (Amazon S3) bucket to create an Amazon S3 event. This event will initiate a CodePipeline configured pipeline to run. 

The same event-initiating mechanism is used for the integration stream and its associated pipelines. 

In the CI/CD pipeline, CodePipeline uses CodeBuild with the Micro Focus AccuRev Linux client container to check out the latest code from the AccuRev streams. Then the pipeline starts CodeBuild to use the Micro Focus Enterprise Developer Windows container to compile the source code, and to use the Micro Focus Enterprise Test Server Windows container in CodeBuild to test mainframe applications.

The CI/CD pipelines are built using AWS CloudFormation templates, and the blueprint will be used for new projects. By using the templates, it takes less than an hour for a project to create a new CI/CD pipeline in AWS.

To scale your mainframe test capability on AWS, the pattern builds out the Micro Focus DevOps test suite, Micro Focus Verastream and Micro Focus UFT server. By using the modern DevOps tools, you can run as many tests on AWS as you need.

An example mainframe development environment with Micro Focus on AWS is shown in the following diagram.

 

Target technology stack 

This section provides a closer look at the architecture of each component in the pattern.

1. Source code repository – AccuRev SCM 

Micro Focus AccuRev SCM is set up to manage mainframe source code versions. For high availability, AccuRev supports primary and replica modes. Operators can fail over to the replica when performing maintenance on the primary node. 

To speed up the response of the CI/CD pipeline, the pattern uses Amazon CloudWatch Events to detect source code changes and initiate the start of the pipeline.

  1. The CodePipeline is set up to use an Amazon S3 source.

  2. A CloudWatch Events rule is set up to capture S3 events from a source S3 bucket.

  3. The CloudWatch Events rule sets a target to the pipeline.

  4. AccuRev SCM is configured to run a post promotion script locally after promotion is complete.

  5. AccuRev SCM generates an XML file that contains the metadata of the promotion, and the script uploads the XML file to the source S3 bucket.

  6. After the upload, the source S3 bucket sends events to match the CloudWatch Events rule, and the CloudWatch Events rule initiates the CodePipeline to run. 

When the pipeline runs, it kicks off a CodeBuild project to use an AccuRev Linux client container to check out the latest mainframe code from an associated AccuRev stream.   

The following diagram shows an AccuRev Server setup.

2. Enterprise Developer template 

The pattern uses Amazon EC2 templates to simplify creation of the developer instance. By using State Manager, it can apply software and license settings to EC2 instances consistently.

The Amazon EC2 template builds in its VPC context settings and default instance settings, and it follows enterprise tagging requirements. By using a template, a team can create their own new development instances. 

When a developer instance starts, by associating with tags, Systems Manager uses State Manager to apply automation. The automation includes the following general steps.

  1. Install Micro Focus Enterprise Developer software and install patches.

  2. Install the Micro Focus AccuRev client for Windows.

  3. Install the pre-configured script for developers to join the AccuRev stream. Initialize Eclipse workspaces.

  4. Install development tools, including x3270, py3270, and Docker.

  5. Configure license settings to point to a Micro Focus License Manager load balancer.

The following diagram shows an Enterprise developer instance created by the Amazon EC2 template, with software and configuration applied to the instance by State Manager. Enterprise developer instances connect to Micro Focus License Manager to activate their license.

 

3.  CI/CD pipelines

As explained in AWS architecture section, in the pattern, there are project-level CI/CD pipelines and system integration pipelines. Each mainframe project team creates a pipeline or multiple CI/CD pipelines for building the programs that they are developing in a project. These project CI/CD pipelines check out source code from an associated AccuRev stream. 

In a project team, developers promote their code in the associated AccuRev stream. Then the promotion initiates the project pipeline to build the code and run and integration tests. 

Each project CI/CD pipeline uses CodeBuild projects with the Micro Focus Enterprise Developer tool Amazon ECR image and Micro Focus Enterprise Test Server tool Amazon ECR image. 

CodePipeline and CodeBuild are used to create the CI/CDs pipelines. Because CodeBuild and CodePipeline have no upfront fees or commitments, you pay only for what you use. Compared to mainframe hardware, the AWS solution greatly reduces hardware provisioning lead time and lowers the cost of your testing environment.

In modern development, multiple test methodologies are used. For example, test-driven development (TDD), BDD, and Robot Framework. With this pattern, developers can use these modern tools for mainframe testing. For example, by using x3270, py3270 and the Behave python test tool, you can define an online application's behavior. You can also use build mainframe 3270 robot framework in these CI/CD pipelines.

The following diagram shows the team stream CI/CD pipeline. 

The following diagrams shows the project CI/CD test reports produced by CodePipeline in Mainframe3270 Robot Framework and Behave.

 

Test Report - Mainframe3270 Robot Framework  

Test Report - Py3270 and Behave BDD

After project level tests are passed successfully, the tested code is manually promoted to the integration stream in AccuRev SCM. You can automate this step after the teams have a confidence on the tests coverage of their project pipeline.

When code is promoted, the system integration CI/CD pipeline checks out the merged code and performs regression tests. The merged code is promoted from all parallel project streams.

Depending on how fine grain the test environment are required, customers can have more system integration CI/CD pipelines in different environment, for example UAT, Pre-Production. 

In the pattern, the tools used in the system integration pipeline are Micro Focus Enterprise Test Server, Micro Focus UFT Server, and Micro Focus Verastream. All these tools can be deployed into the Docker container and used with CodeBuild.

After successfully testing of the mainframe programs, the artifact is stored, with version control, in an S3 bucket. 

The following diagram shows a system integration CI/CD pipeline.

 

After the artifact has been successfully tested in the system integration CI/CD pipelines, it can be promoted for production deployment. 

If you need to deploy source code back to the mainframe, Micro Focus offers the Enterprise Sync solution to synchronize source code from AccuRev back to Mainframe Endeavour.

The following diagram shows a production CI/CD pipeline deploying the artifact into Micro Focus Enterprise Servers. In this example, CodeDeploy orchestrates the deployment of the tested mainframe artifact into Micro Focus Enterprise Server.

In addition to the architecture walkthough of the CI/CD pipeline, you can also read the AWS DevOps blog post Automate thousands of mainframe tests on AWS with the Micro Focus Enterprise Suite for more information on testing mainframe applications in CodeBuild and CodePipeline. Refer to the blog post for the best practices and details of doing mainframe tests on AWS.

Tools

Tools

AWS automation tools

Micro Focus tools

Other tools

Epics

Task Description Skills required
Deploy a primary AccuRev SCM server by using AWS CloudFormation.

AWS CloudFormation
Create the AccuRev Administrator user.

Log in to AccuRev SCM Server, and run the CLI command to create an Administrator user.

AccuRev SCM Server Administrator
Create AccuRev streams.

Create AccuRev streams that inherit from upper streams in sequence: Production, System Integration, Team streams.

AccuRev SCM Administrator
Create the developer AccuRev login accounts.

Use AccuRev SCM CLI commands to create AccuRev users login accounts for mainframe developers.

AccuRev SCM Administrator
Task Description Skills required
Deploy the Amazon EC2 launch template by using AWS CloudFormation.

Use AWS CloudFormation to deploy an Amazon EC2 launch template for Micro Focus Enterprise Developer instances. The template includes a Systems Manager Automation document for the Micro Focus Enterprise Developer instance.

AWS CloudFormation
Create the Enterprise Developer instance from the Amazon EC2 template.

AWS Console Login and Mainframe Developer Skills
Task Description Skills required
Create the Micro Focus Enterprise Developer tool Docker image.

Use the Docker command and the Micro Focus Enterprise Developer tool Dockerfile to create the Docker image.

Docker
Create the Docker repository in Amazon ECR.

On the Amazon ECR console, create the repository for the Micro Focus Enterprise Developer Docker image.

Amazon ECR
Push the Micro Focus Enterprise Developer tool Docker image to Amazon ECR.

Run the Docker push command to push the Enterprise Developer tool Docker image to save it in the Docker repository in Amazon ECR.

Docker
Task Description Skills required
Create the Micro Focus Enterprise Test Server Docker image.

Use the Docker command and the Micro Focus Enterprise Test Server Dockerfile to create the Docker image.

Docker
Create the Docker repository in Amazon ECR.

On the Amazon ECR console, create the Amazon ECR repository for the Micro Focus Enterprise Test Server Docker image.

Amazon ECR
Push the Micro Focus Enterprise Test Server Docker image to Amazon ECR.

Run the Docker push command to push and save the Enterprise Test Server Docker image in Amazon ECR.

Docker
Task Description Skills required
Create the AWS CodeCommit repository.

On the CodeCommit console, create a Git-based repository for infrastructure and AWS CloudFormation code.

AWS CodeCommit
Upload the AWS CloudFormation template and the automation code into the CodeCommit repository.

Run the Git push command to upload AWS CloudFormation template and automation code into the repository.

Git
Deploy the team stream CI/CD pipeline via CloudFormation.

Use the prepared AWS CloudFormation template to deploy a team stream CI/CD pipeline.

AWS CloudFormation
Task Description Skills required
Create the Micro Focus UFT Docker image.

Use the Docker command and the Micro Focus UFT Dockerfile to create the Micro Focus Docker image.

Docker
Create the Docker repository in Amazon ECR for the Micro Focus UFT image.

On the Amazon ECR console, create the Docker repository for the Micro Focus UFT image.

Amazon ECR
Push the Micro Focus UFT Docker image to Amazon ECR.

Run the Docker push command to push and save the Enterprise Test Server Docker image in Amazon ECR.

Docker
Create the Micro Focus Verastream Docker image.

Use the Docker command and the Micro Focus Verastream Dockerfile to create the Docker image.

Docker
Create the Docker repository in Amazon ECR for the Micro Focus Verastream image.

On the Amazon ECR console, create the Docker repository for the Micro Focus Verastream image.

Amazon ECR
Deploy the system integration CI/CD pipeline via CloudFormation.

Use the prepared AWS CloudFormation template to deploy a system integration CI/CD pipeline.

AWS CloudFormation
Task Description Skills required
Deploy Micro Focus Enterprise Server by using the AWS Quick Start.

To deploy Micro Focus Enterprise Server by using AWS CloudFormation, launch the Micro Focus Enterprise Server on AWS Quick Start.

AWS CloudFormation
Deploy a production deployment CI/CD pipeline.

On the AWS CloudFormation console, use the AWS CloudFormation template to deploy a production deployment CI/CD pipeline.

AWS CloudFormation

References

AWS Marketplace

AWS Quick Start