The slides are created with GitPitch and can be previewed here. If you don't want to use the publicly available container you can spawn your own GitPitch instance with this Docker Container. The repository includes a script which starts the container with the minimal required configuration.
Note that the script uses the tinier GitPitch container which does not include PDF export support!
Jericho is Gatling in Docker containers. Why it is called Jericho? You know...everything needs a name and Jericho sounds cool, doesn't it?
Jericho is designed to scale out by running multiple containers. It consists of 3 parts:
- Jericho Attacker
- Jericho Reporter
- and a reports viewer (in the docker-compose file implemented by the default nginx container)
The repository contains a demo application as test case for the Jericho. It's a clone of the Internet Chuck Norris Database (ICNDB).
The easiest way to start the ICNDB is starting the docker-compose.yml file. It defines the required PostgreSQL database service and configures both services through environment variables.
The ICNDB clone is also available as Docker image.
The Dockerfile for the attacker image is located under JerichoGatling/2.3.0-attacker/. The folder contains the script attack.sh which controls the attack node.
When the attack node is started, the attack.sh script is started and starts a Gatling process with a few parameters. The following options are set:
- -nr to disable the generation of an HTML report on the attack node
- on to rename the output directory to the hostname (id) of the container
- -m to suppress required inputs
The -m-Switch requires that in the folder /opt/gatling/user-files/simulations is just one simulation file!
If you're running Jericho within Docker-Compose you can just mount your simulation file to the folder /opt/gatling/user-files/simulations and thats it!
If you want to run Jericho within Docker Swarm the easiest way to get a simulation file into all attack nodes is to create a config file (docker config create <name> <path/to/file>
) and mount the configuration afterwards into the attack nodes.
That can be accomplished like in the given docker-compose-attacker-stack.yml:
configs:
- source: RandomJokeSimulation
target: /opt/gatling/user-files/simulations/RandomJokeSimulation.scala
remember to declare the config variable in the global scope of the file:
configs:
RandomJokeSimulation:
external: true
Jericho needs some shared volumes:
- One volume shared between the attack nodes and the reporter to get the gatling simulation logs to the reporter
- One volume shared between the reporter node and the report viewer to get the generated HTML report into a web root folder
The volume shared between attack nodes and reporter (let's call it gatling-logs) has to be mounted to the folder /opt/gatling/shared-results on all attack nodes and to the folder /opt/gatling/results on the reporter node. There's a special folder shared-results because the log files have to be renamed before they're getting shared to avoid filename conflicts resulting in loosing results from one node.
The volume shared between the reporter node and the report viewer has to be mounted to the folder /opt/gatling/html-out on the reporter node and to the folder /usr/share/nginx/html if you're using nginx as web server.
If you want to run Jericho within Docker-Compose you'll have no problems by just declaring the volumes in the global scope of your Docker-Compose file:
volumes:
gatling-logs:
gatling-results:
Because the containers are running on the same host, the "in memory" volumes are shared across all containers.
If you want to run Jericho within Docker Swarm you have 2 options:
- run all containers on the same node (e.g. placement constraints on a node id or a master node if you have just one)
- create volumes which are shared across all hosts (in the sample Stack config this is accomplished by declaring NFS volumes)