immae1 / gatling-docker-on-aws

Distributed Gatling setup using docker on AWS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distributed Gatling testing using Docker on AWS CI

This is the improved setup, for the code for the old setup described in my original blog post see the v1 branch.
Blog describing the new setup is underway.

Prerequisites

Create

  • S3 bucket for Gatling logs

Install

  • aws-cli
  • Docker
  • Maven >= 3.5
  • Java >= 8
  • Node >= 10.3.0

Projects in this repository

gatling-infra

Contains AWS CDK project for creating needed infra for running loadtest on AWS.

See README.md in project.

gatling-monitoring

Dockerfiles for realtime Gatling Monitoring

See README.md in project.

gatling-runner

Mavenized Gatling project containing loadtest code.
Contains Dockerfile to build image to run on AWS.

See README.md in project.

gatling-runner-aws

AWS SDK project for running the loadtest on AWS.

See README.md in project.

How to use

1. Build gatling-runner project

Build the gatling-runner project, so it creates the required jars needed for the Docker image.

2. Build gatling-infra project

Build the gatling-infra project before calling cdk deploy. The cdk tooling will not compile the code.

3. Deploy the infra

Now deploy the infra from the gatling-infra project:
VPC_ID=<id> REPORT_BUCKET=<bucket> cdk deploy GatlingMonitoringEcsStack --profile <profile>
VPC_ID=<id> REPORT_BUCKET=<bucket> cdk deploy GatlingRunnerEcsStack --profile <profile>

4. Run the test

Now run the loadtest on AWS using the gatling-runner-aws project:
AWS_PROFILE=<profile> VPC_ID=<id> REPORT_BUCKET=<bucket> CLUSTER=gatling-cluster TASK_DEFINITION=gatling-runner SIMULATION=nl.codecontrol.gatling.simulations.BasicSimulation CONTAINERS=10 USERS=10 mvn clean compile exec:exec

Important

When making changes to the Gatling code in the gatling-runner project, don't forget to:

  1. build your gatling-runner project using Maven
  2. and re-deploy your GatlingRunnerEcsStack from gatling-infra so AWS CDK will update your Docker image containing the Gatling code

About

Distributed Gatling setup using docker on AWS


Languages

Language:Java 83.9%Language:Shell 8.9%Language:Scala 4.1%Language:Dockerfile 3.1%