You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 28, 2022. It is now read-only.
-[Load testing a basic HTTP endpoint](https://github.com/aws-samples/distributed-load-testing-using-aws-fargate/tree/master/examples/http)
32
-
-[Load testing an Elasticsearch cluster behind a VPC](https://github.com/aws-samples/distributed-load-testing-using-aws-fargate/tree/master/examples/elasticsearch)
33
-
24
+
- An AWS Account
25
+
-[Git Credentials for AWS CodeCommit](https://docs.aws.amazon.com/codecommit/latest/userguide/setting-up-gc.html)
34
26
35
27
## Getting Started
36
28
37
29
### 1. Launch Solution
38
30
39
31
In this step you will launch the `Master` CloudFormation stack that will create a Fargate Cluster, an ECR Docker registry, an IAM
40
-
Execution Role, a Task Definition, a CloudWatch Log Group, a Security Group and a new VPC with Public Subnets.
32
+
Execution Role, a Task Definition, a CloudWatch Log Group, a Security Group, a new VPC, a CodeCommit repository, a CodePipeline
33
+
and 2 CodeBuild projects with their associated IAM Roles.
41
34
42
35
Region Name | Region Code | Launch
43
36
------|-----|-----
44
-
US East (N. Virginia) | us-east-1 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
45
-
US East (Ohio) | us-east-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
46
-
US West (Oregon) | us-west-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
47
-
48
-
You will notice that the CloudFormation stack will expand itself into 2 additional nested stacks: The master stack takes
49
-
care of creating global resources like an ECR Registry and the IAM Execution Role. One nested stack takes care of
50
-
creating the network (VPC) and the other creates the Fargate cluster.
51
-
52
-
Once the three stacks have completed deployment, you need to make a note of the Output values in the master stack
53
-
(see the following Screenshot) as you will need these values later. Go to the Outputs section of the
54
-
master stack and save the DockerRegistryName and DockerRegistryURL values somewhere in your notes.
37
+
US East (N. Virginia) | us-east-1 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=DistributedLoadTesting&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
38
+
US East (Ohio) | us-east-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=DistributedLoadTesting&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
39
+
US West (Oregon) | us-west-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=DistributedLoadTesting&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/master.yaml)
Switch to the latest release so you have an stable code base.
53
+
Switch to the latest release so you have a stable code base.
65
54
66
55
```bash
67
-
git checkout tags/v0.2-beta
56
+
git checkout tags/v1.0-beta
68
57
```
69
58
70
59
### 3. Modify the load test scenario
@@ -83,75 +72,32 @@ scenarios:
83
72
aws-website-test:
84
73
requests:
85
74
- http://aws.amazon.com
86
-
```
87
-
88
-
### 4. Build and push the docker image
89
-
90
-
Once you have completed your test scenario, you need to package it in a Docker image and push it to your ECR Docker registry.
91
-
To do this, you first need to authenticate against ECR. The following command assumes you have the [AWS CLI installed and configured](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html).
If the docker container ran as expected, you can proceed to push the image to the registry. Unfortunately the Docker
117
-
image for Taurus is quite heavy (~900 MB), so make sure you have good internet connectivity as this push can take a
118
-
little while.
96
+
Finally, push the project to the repository. Note that after you push this, the deployment pipeline will be triggered
97
+
automatically and therefore the load tests will be run on the Fargate cluster.
119
98
120
99
```bash
121
-
docker push {DockerRegistryURL}:latest
122
-
```
123
-
124
-
### 4. Run the tests in Fargate
125
-
126
-
Finally, edit the `bin/runner.py` python file to add the list of regions with its CloudFormation stack names that
127
-
you launched on the previous step. This python file will read the CloudFormation outputs and based on those parameters
128
-
will schedule the execution of the Fargate tasks.
129
-
130
-
Before running the python script, install boto3 by creating a virtual environment. Creating a virtual
131
-
environment is optional, but recommended. If you don't have virtualenv installed, you can install it with pip.
132
-
133
-
```bash
134
-
pip install virtualenv
135
-
```
136
-
137
-
Create the virtual environment inside the `bin/` directory and activate it.
138
-
139
-
```bash
140
-
cd bin/
141
-
virtualenv env
142
-
source env/bin/activate
143
-
```
144
-
145
-
Once inside the virtual environment, install boto3 by running:
146
-
147
-
```bash
148
-
pip install -r requirements.txt
149
-
```
150
-
151
-
And finally, when you are ready to run the Distributed Load Test, run the script.
152
-
153
-
```bash
154
-
python runner.py
100
+
git push -u origin master
155
101
```
156
102
157
103
### 5. Monitor the test execution in CloudWatch
@@ -198,4 +144,21 @@ Additional Region | Region Code | Launch
198
144
US East (N. Virginia) | us-east-1 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/additional-region.yaml)
199
145
US East (Ohio) | us-east-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/additional-region.yaml)
200
146
US West (Oregon) | us-west-2 | [](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=WildRydes-Cloud9&templateURL=https://s3-us-west-2.amazonaws.com/load-testing-using-aws-fargate/artifacts/templates/additional-region.yaml)
201
-
147
+
148
+
149
+
## Run Locally
150
+
151
+
Build the image by issuing the following command in the root directory of this project.
152
+
153
+
```bash
154
+
docker build -t load-tests-using-fargate .
155
+
```
156
+
157
+
Then run the docker container locally.
158
+
159
+
```bash
160
+
docker run -it load-tests-using-fargate taurus.yml
161
+
```
162
+
163
+
If the docker ran as expected, you can push the changes to your AWS CodeCommit repository and let the pipeline
0 commit comments