Deploying a Single Instance Development Environment
Overview
The following diagram shows the structure of a single instance development environment:
Prerequisites
Before deploying a single-instance development environment, there are several Jenkins job that must be run first. These jobs build necessary Docker images and push them to the AWS (Amazon Web Services) Elastic Container Registry (ECR).
All of these jobs are run by the InitPipeline job during CloudDeploy initialization. For more information about what the jobs build, see the Building Elastic Path Commerce Docker Images with CloudDeploy section.
Deployment Process
The DeploySingleInstanceDevEnvironment Jenkins job deploys an EC2 instance in a private subnet created by CloudCore. This job is located in the Jenkins job folder CloudOps, in the Jenkins view Deployments.
Confirm prerequisites are met.
Run the DeploySingleInstanceDevEnvironment job. The default values for the parameters are pulled from the config store. For more information on the parameters, see DeploySingleInstanceDevEnvironment.
Monitor the deployment progress in the AWS CloudFormation console. The environment takes approximately 20 minutes to create. It creates several CloudFormation stacks and sub-stacks. When the root CloudFormation stack completes successfully, the stack outputs display useful information such as endpoints to the Elastic Path services and the AWS CloudWatch LogGroup name where logs can be found
$ aws cloudformation describe-stacks --stack-name EP-Single-Dev --query 'Stacks[0].Outputs'
[
{
"OutputKey": "SIApiGatewayEndpoint",
"OutputValue": "https://m1x4oqcyze.execute-api.us-west-2.amazonaws.com/cortex"
},
{
"OutputKey": "SIApiGwCustomEndpoint",
"OutputValue": "https://dev1-cortex-gw.ep-dev.cloudops.example.com/cortex"
},
{
"OutputKey": "SingleInstanceALB",
"OutputValue": "dev1.ep-dev.cloudops.example.com"
},
{
"OutputKey": "SIActiveMqELBDns",
"OutputValue": "dev1-activemq.ep-dev.cloudops.example.com"
},
{
"OutputKey": "SIMysqlELBDns",
"OutputValue": "dev1-mysql.ep-dev.cloudops.example.com"
},
{
"OutputKey": "LogGroup",
"OutputValue": "EP-Single-Instance-Dev-Env-EP-CloudDeploy-master-1-LogGroup-1QSJJU6DV73LC"
},
Note: Endpoints outputted by CloudFormation stacks work only if CloudCore DNS Configuration are set up correctly. If DNS is not configured, one work-around is to reference load-balancer’s unique DNS names to access the Elastic Path services on the single-instance environment. In addition, the API gateway custom endpoint domains will not be enabled unless CloudOps was deployed with an HTTPS Certificate.
Validating Single Instance Deployment
This section outlines how to verify a successful deployment and connection.
These checks are done after running the
DeploySingleInstanceDevEnvironment
Jenkins job and a single instance developer environment is created.
Addresses and credentials used to log in are located at Default Credentials page.
Target Group health check
Check the health of each Target Group as follows:
Open the AWS EC2 Console and click Target Groups.
Confirm the presence of 5 target groups prefixed by
EP-Si-Targe
.As shown in the following screenshot, select the Health checks tab and check the Path to find the app the target group points to.
- Each target group should point to one of the 5 apps:
cm
integration
cortex
batch
search
- Each target group should point to one of the 5 apps:
Go to the Monitoring tab (on the same panel as the Health checks tab) and ensure that the number of instances on the Healthy Hosts graph is correct
ActiveMQ transaction check
The following steps are to verify that Elastic Path Commerce is able to process transactions.
Connect to the ActiveMQ admin tool
Go to the ActiveMQ admin tool.
Click the queues tab, and note the values in the columns Messages Enqueued and Messages Dequeued from the row queue named Consumer.consumerRegistrationEmailHandler.VirtualTopic.ep.customers
Register a new user in Cortex
- In Cortex Studio Authenticate yourself as a public user
- In the Account Registration section, enter the following information as shown in the following screenshot, then click registeraction:
- family-name
- given-name
- password
- username
- In the ActiveMQ admin tool (refer to Figure 3. ActiveMQ email queue), in the columns Messages Enqueued and Messages Dequeued in the row queue named Consumer.consumerRegistrationEmailHandler.VirtualTopic.ep.customers,confirm that values have been incremented
Search check
Searching for promotions and shipping items
Log in to the Commerce Manager as the administrator.
In the Promotions/Shipping tab, click Search. Confirm that the search result contains search result items
Reindexing search for an index
Log in to the Commerce Manager as the administrator.
In the Configuration tab, click Search Indexes.
Click Rebuild Index for any index name. Confirm that the status goes from Rebuild Scheduled to Rebuild in Progress to Complete