Synapse QA

Scaling Tests with Docker : Study Notes

Chapter 1: Intro to Docker

Docker

Containers

Images

Why Docker??

With DockerWithout Docker
Docker containers can be summarized as wrapping up a piece of software in a complete file system that contains everything it needs to run – code, runtime, system tools, system libraries, etc.Have to manage each one of those separately
Manage everything in seconds easily with Spin up Restart Tear DownSetting up Selenium Grid is also a manual and tedious task. Running multiple commands Management of version

Chapter 2: Installing Docker on Windows


Installing Docker on Windows

Chapter 3: Setting up Docker

The main components to set up the grid are:

grid components

Steps to setup Docker:

To restart the grid, use the following command:

docker-compose restart

To tear down the grid, use the following command:

docker-compose down

Sample YML file:

Chapter 4: Scaling Tests

Tips for tests before we run those using containers:

Sample tests:

Run the tests:

Chapter 5: Scaling Containers

It is all about scaling the clusters using multiple machines and then putting the grid on those clusters. There is a limit to scale the selenium grid on one machine, as it will run out of resources. Hence multiple machines are required.

Docker Swarm

A collection of Docker engines joined into a cluster is called a Swarm. Each machine in a SWARM is called a Node.

Docker Swarm

SWARM consists of:

Worker Nodes: Worker nodes listen to the task sent by Manager Nodes and then execute them.

Manager Nodes: Manager Nodes also execute tasks alongwith sending tasks to the Worker nodes and maintaining the Desired state of the SWARM

If the desired state has 6 nodes with 3 managers and 3 workers, from which the lead has the Hub and the other nodes have the Firefox containers and if due to some reason any one nodes goes down, then the Docker will detect this and spin up an entirely new node. This is how it makes sure that the Actual state is always matched with Desired State.

Docker Stack

Docker Stack is similar to Docker compose but allows to deploy the services across the SWARM in one command. The same docker-compose.yml file can be used here.

Docker Stack

Starting Docker Stack

Learning Drive-Thru:

Happy Learning 🙌



Exit mobile version