Installation with Docker Compose

Learn how to install Gatling Enterprise with Docker Compose

Running Gatling Enterprise with Docker Compose is the recommended solution to get started quickly, as it requires the minimal amount of setup and is the easiest way to upgrade to newer versions. While it is a good start, it is not recommended for production workload. You can reuse every configuration shown here to spawn your own Docker based environment, could it be volumes that needs to be backed up, properties, ports mapping, and so on.

Quick Checklist

  1. Contact support with your Docker Hub username to get access to the Gatling Enterprise Docker image

  2. Prepare a folder to hold the Docker Compose configuration, and inside this folder, make three subfolders:

    • cassandra-data, kept empty
    • frontline-conf prepared with the default frontline.conf and logback.xml
    • frontline-keys, kept empty

You can skip to the Docker Compose configuration section if you already know the details.

Detailed Checklist

Create a folder that will hold the Docker Compose configuration. We will make multiple subfolders inside to hold the required volumes. These volumes are meant to be backed up and reused when upgrading to one version to the next:

  • cassandra-data holds all the data of Gatling Enterprise
  • frontline-conf contains the core configuration of Gatling Enterprise
  • frontline-keys contains secrets that are used to either spawn injectors or get access to private sources used to run tests

You can create all three folders inside the folder of your choice. Later on, we will add the main Docker Compose configuration into this main folder.

Getting Gatling Enterprise’s Docker image

Gatling Enterprise image is hosted as a private image on our organization’s Docker Hub. Please contact our support and provide us with your Docker Hub username so we can grant you access.

Gatling Enterprise will be available under the tag name gatlingcorp/frontline:1.16.6.

You can pull it directly to validate your access:

docker pull gatlingcorp/frontline:1.16.6

Preparing the Cassandra database

We will be using the official Cassandra image under the tag name cassandra:3.

This image will push data into a folder named cassandra-data, that is mapped to the container’s inner folder /var/lib/cassandra.

Cassandra is available on port 9042. It won’t be visible in the configuration as we will put all services in the same network.

Copy Gatling Enterprise default configuration

If not already done, add a folder called frontline-conf into the main Docker Compose folder. It will store the license information and the key used for data encryption.

In this folder, copy the Gatling Enterprise default configuration and name it frontline.conf.

Copy logging configuration

The default log behavior is too verbose from a performance point of view. You will have to put this logback.xml file in the same directory as the previous frontline.conf file.

Inside frontline-conf, add logback.xml:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>%d [%-5level] %logger{15} - %msg%n%rEx</pattern>
    </encoder>
  </appender>

  <logger name="io.gatling.frontline" level="INFO"/>

  <root level="WARN">
    <appender-ref ref="CONSOLE"/>
  </root>
</configuration>

Notice the <logger> line which put the log level of Gatling Enterprise to INFO. When contacting support about anything, it is useful to put this specific log level DEBUG in order to provide us with as much debugging information as possible.

Prepare private keys folder

Finally, we need to prepare a folder called frontline-keys that will hold uploaded private keys. It is required by features like Git cloning and by most cloud providers.

You can leave it empty.

Assembling and using Docker Compose

Put this configuration into a file called docker-compose.yml and after customizing the host folders you configured previously, then run:

docker-compose up -d

Docker compose

For your convenience, here are some docker compose instructions to set up a quick test environment. This is enough to start Gatling Enterprise locally.

Cassandra container:

Based on cassandra image cassandra:3.11, you’ll have to bind a local directory on the volume to store and keep your data. A healthcheck will be started on the container.

Gatling Enterprise container:

Wait until cassandra container healthcheck indicates that all is well. Set the version of Gatling Enterprise you want to deploy, bind a local directory for Gatling Enterprise configuration and keys.

Prerequisite

Create a folder to store the files, add the given docker-compose.yml, then run docker-compose up -d. Once ready, visit Gatling Enterprise at http://localhost:10542!

version: '2.4'
services:
  cassandra:
    container_name: cassandra
    image: cassandra:3.11
    environment:
      - CASSANDRA_CLUSTER_NAME=FrontLine
    volumes:
      - ./cassandra-data:/var/lib/cassandra
      # - <path to your cassandra directory (default empty)>:/var/lib/cassandra
    networks:
      - frontline-network
    healthcheck:
      test: ["CMD-SHELL", "[ $$(nodetool statusgossip) = running ]"]
      interval: 30s
      timeout: 10s
      retries: 10
  frontline:
    container_name: frontline
    image: gatlingcorp/frontline:1.16.6
    ports:
      - 10542:10542
    networks:
      - frontline-network
    environment:
      # FRONTLINE_CASSANDRA_HOST and FRONTLINE_CASSANDRA_PORT are used to update frontline.conf
      - FRONTLINE_CASSANDRA_HOST=cassandra
      # Provides a default pool that can be used for testing. Not recommended for production.
      - FRONTLINE_ENABLE_LOCAL_POOL=true
    volumes:
      - ./frontline-conf:/opt/frontline/conf
      # - <path to your frontline conf directory (default contains frontline.conf)>:/opt/frontline/conf
      - ./frontline-keys:/opt/frontline/keys
      # - <path to your frontline keys directory (default empty)>:/opt/frontline/keys
    depends_on:
      cassandra:
        condition: service_healthy
networks:
  frontline-network:
    driver: bridge

Edit this page on GitHub