Skip to content

Commit 7c5fd10

Browse files
authored
Merge pull request #7 from smithmicro/bug-6
fix for issue #6
2 parents 5fff2bc + f73d604 commit 7c5fd10

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.vscode
22
logs
3+
*.jmx

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ JMeter Images for Distributed Testing on EC2 Container Service (ECS)
33

44
This application uses two images:
55
* `smithmicro/jmeter` - Contains the JMeter software that is deployed in ECS
6-
* `smithmicro/lucy` - The orcehstration image that can run behind a corporate firewall and manages AWS resources
6+
* `smithmicro/lucy` - The orchestration image that can run behind a corporate firewall and manages AWS resources
77

88
_Warning: Using these Docker images will incur compute and storage costs in AWS. Care is taken to terminate all instances and volumes after JMeter tests complete, but bugs could allow these resources to continue to run. See the issues list for more detail._
99

aws-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ aws ec2 modify-subnet-attribute --subnet-id $SUBNET_ID --map-public-ip-on-launch
7070
SG_ID=$(aws ec2 create-security-group --group-name "JMeter" --description "JMeter Security Group" --vpc-id $VPC_ID --output text | tr -d '\n')
7171
echo "Created Security Group $SG_ID"
7272

73-
JMETER_IP_PERMISSIONS='[{"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 1099, "ToPort": 1099, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 4445, "ToPort": 4445, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 50000, "ToPort": 50000, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 51000, "ToPort": 51000, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}]'
73+
JMETER_IP_PERMISSIONS='[{"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 1099, "ToPort": 1099, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "udp", "FromPort": 4445, "ToPort": 4445, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 50000, "ToPort": 50000, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]},{"IpProtocol": "tcp", "FromPort": 51000, "ToPort": 51000, "IpRanges": [{"CidrIp": "0.0.0.0/0"}]}]'
7474
aws ec2 authorize-security-group-ingress --group-id $SG_ID --ip-permissions "$JMETER_IP_PERMISSIONS"
7575

7676
# tag all created resources

lucy/lucy.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,15 @@ echo "Container instances IDs: $CONTAINER_INSTANCE_IDS"
189189

190190
# Step 6 - Run the Minion task with the requested count
191191
echo "Running task: $MINION_TASK_DEFINITION, instance count: $MINION_COUNT"
192-
MINION_TASK_IDS=$(aws ecs run-task --cluster $MINION_CLUSTER_NAME --task-definition $MINION_TASK_DEFINITION --count $MINION_COUNT \
193-
--query 'tasks[*].[taskArn]' --output text | tr '\n' ' ')
194-
192+
ECS_MAX=10
193+
ECS_REMAINING_COUNT=$MINION_COUNT
194+
while [ $ECS_REMAINING_COUNT -gt 0 ]
195+
do
196+
ECS_REQUEST_COUNT=$(($ECS_REMAINING_COUNT<$ECS_MAX?$ECS_REMAINING_COUNT:$ECS_MAX))
197+
MINION_TASK_IDS=$(aws ecs run-task --cluster $MINION_CLUSTER_NAME --task-definition $MINION_TASK_DEFINITION --count $ECS_REQUEST_COUNT \
198+
--query 'tasks[*].[taskArn]' --output text | tr '\n' ' ')
199+
ECS_REMAINING_COUNT=$((ECS_REMAINING_COUNT-ECS_REQUEST_COUNT))
200+
done
195201
echo "Waiting for tasks to run: $MINION_TASK_IDS"
196202
aws ecs wait tasks-running --cluster $MINION_CLUSTER_NAME --tasks $MINION_TASK_IDS
197203
if [ "$?" = '0' ]; then
@@ -221,7 +227,7 @@ JMX_IN_COMTAINER=/plans/$(basename $INPUT_JMX)
221227
ssh -i $PEM_PATH/$KEY_NAME.pem -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ec2-user@${GRU_HOST} \
222228
"docker run -p 1099:1099 -p 51000:51000 -v /tmp:/plans -v /logs:/logs --env MINION_HOSTS=$MINION_HOSTS smithmicro/jmeter:$JMETER_VERSION $JMX_IN_COMTAINER"
223229

224-
echo "Copying JTL files from Gru"
230+
echo "Copying results from Gru"
225231
scp -r -i $PEM_PATH/$KEY_NAME.pem -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no ec2-user@${GRU_HOST}:/logs/* /logs
226232

227233
# Step 9 - Stop all tesks

0 commit comments

Comments
 (0)