1

I was trying to use Amazon EC2 Container Serivce(ECS) to host my selenium hub/nodes to do browser testing. My setup is below

docker-compse.yml

hub:
  image: selenium/hub
  ports:
    - "4444:4444"

firefox:
  image: selenium/node-firefox
  links:
    - hub

chrome:
  image: selenium/node-chrome
  links:
    - hub

then I used ecs-cli compose service up to launch the service running those containers. So far it works.

But when I point my tests to the hub (xxxx.com:4444) the hub recieved my test request, and distributed the test to the chrome container, the chrome container got the test and tried to create a new session. Then it said only local connections are allowed and killed all containers.

Here's the log

[ec2-user@ip-172-xx-xx-xx ~]$ docker logs --follow 87162744e132
19:37:35.509 INFO - Launching a Selenium Grid node
19:37:36.783 INFO - Java: Oracle Corporation 25.45-b02
19:37:36.788 INFO - OS: Linux 3.14.48-33.39.amzn1.x86_64 amd64
19:37:36.818 INFO - v2.48.0, with Core v2.48.0. Built from revision d80083d
19:37:37.006 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
19:37:37.009 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
19:37:37.015 INFO - Driver class not found: com.opera.core.systems.OperaDriver
19:37:37.015 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
19:37:37.207 INFO - Selenium Grid node is up and ready to register to the hub
19:37:37.313 INFO - Starting auto registration thread. Will try to register every 5000 ms.
19:37:37.316 INFO - Registering the node to the hub: http://172.17.0.96:4444/grid/register
19:37:37.358 INFO - The node is registered to the hub and ready to use
19:37:35.509 INFO - Launching a Selenium Grid node
19:37:36.783 INFO - Java: Oracle Corporation 25.45-b02
19:37:36.788 INFO - OS: Linux 3.14.48-33.39.amzn1.x86_64 amd64
19:37:36.818 INFO - v2.48.0, with Core v2.48.0. Built from revision d80083d
19:37:37.006 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform LINUX
19:37:37.009 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform LINUX
19:37:37.015 INFO - Driver class not found: com.opera.core.systems.OperaDriver
19:37:37.015 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
19:37:37.207 INFO - Selenium Grid node is up and ready to register to the hub
19:37:37.313 INFO - Starting auto registration thread. Will try to register every 5000 ms.
19:37:37.316 INFO - Registering the node to the hub: http://172.17.0.96:4444/grid/register
19:37:37.358 INFO - The node is registered to the hub and ready to use
09:37:33.497 INFO - Executing: [new session: Capabilities [{rotatable=false, nativeEvents=false, browserName=chrome, takesScreenshot=false, javascriptEnabled=true, version=, platform=LINUX, cssSelectorsEnabled=true}]])
09:37:33.553 INFO - Creating a new session for Capabilities [{rotatable=false, nativeEvents=false, browserName=chrome, takesScreenshot=false, javascriptEnabled=true, version=, platform=LINUX, cssSelectorsEnabled=true}]
Starting ChromeDriver 2.20.353124 (035346203162d32c80f1dce587c8154a1efa0c3b) on port 17388
Only local connections are allowed.
Killed

has anyone encountered this issue? and does anyone know what was wrong? Thanks

InfinityPlus1
  • 91
  • 1
  • 12
  • Did you manage to get the containerized Selenium Grid running with ECS? I'm asking because I try to do the same. Maybe, you can provide some useful links / tutorials? Thanks, Robert. – Rob Lu Mar 04 '16 at 10:11
  • 1
    I didn't manage to run all the containers on ECS but ended up only running the selenium hub as a container service on ECS. And with jenkins, when each slave was initiated, I used a custom bash script that runs automatically when starting up, and that bash script starts several selenium node containers and connect those containers to the hub. So when job are sent to the hub it got distributed to other nodes using its own load balance strategy – InfinityPlus1 Mar 05 '16 at 23:17
  • Thanks for your reply. That seems to be a valid approach for me as well. But my original intention was to use the load balancing of ECS to deploy the node containers in my EC2 cluster. – Rob Lu Mar 07 '16 at 14:44
  • I'm currently stuck at making the node containers connect to a hub on another machine. According to https://github.com/SeleniumHQ/docker-selenium I need to link the node containers to the hub container. That works for me only if both containers are on one machine. How did you do that? – Rob Lu Mar 07 '16 at 14:49
  • 1
    This post (http://stackoverflow.com/questions/32074836/selenium-grid-with-docker-containers-on-different-hosts) solved the multiple host issue, but I remembered when I tried to set it up with ECS, it didn't quite work. That's why I switched to the approach above. – InfinityPlus1 Mar 08 '16 at 19:24

0 Answers0