Selenium grid deployment by CloudFormation+Ansible

Overview

Selenium

  • Safari
  • Opera
  • Chrome
  • Firefox
  • IE

CloudFormation

Deployment diagram

Deployment steps

CloudFormation Actions:

  • create instances (EC2 with proper role, security groups)
  • upload ansible playbooks to the EC2 from S3
  • update instances
  • deploy software using ansible
/usr/bin/ansible-playbook -i /opt/ansible/hosts /opt/ansible/docker.yml
  • create AWS ALB
  • create target groups and assign to the EC2
  • create Route53 record
selenium.example.com:4444
selenium.example.com:4445 - Firefox Selenium Node
selenium.example.com:5900 - VNC port (default password is 'secret')

Ansible provisioning actions:

  • aws-asg-lb-status (checks Autoscaling group)
  • docker-config (configure docker service: enables socket, adds private docker registry)
  • portainer (deploys https://www.portainer.io/ — WEB UI for docker cluster, creates docker swarm cluster)
  • selenium (deploys Selenuim Cluster)
  • selenium-debug (deploys Selenuim Node with VNC access)
  • docker-node-config (adds node to the Docker Cluster if it is new node)

Selenium cluster schema

WebDriver driver = new RemoteWebDriver(new URL(“http://selenium.example.com:4444/wd/hub"), capabilities);

Summary

URLs:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store