Selenium Grid node not registering with hub on AWS ECS managed EC2

128 views
Skip to first unread message

Josh Morris

unread,
Aug 16, 2021, 4:31:42 AM8/16/21
to Selenium Users

I have selenium grid running perfectly locally using docker-compose, all nodes register with the hub fine and tests execute great when ran against the hub.

However I am trying now to get this running on a ECS managed EC2. I have tried to replicate the behavior of my local docker-compose file in a task-definition. When running the task and the containers come online, I can see that the browser node is not registering with the hub when viewing the ui/index.html page

I am at a loss on what the problem could be, any help would be greatly appreciated.

I have been building the task-definition with the AWS Console, but here is the JSON equivalent:

{
   "ipcMode":null,
   "executionRoleArn":"arn:aws:iam::xxxxxxxxxxxx:role/Selenium-ECR-Task",
   "containerDefinitions":[
      {
         "dnsSearchDomains":null,
         "environmentFiles":null,
         "logConfiguration":null,
         "entryPoint":null,
         "portMappings":[
            {
               "hostPort":4442,
               "protocol":"tcp",
               "containerPort":4442
            },
            {
               "hostPort":4443,
               "protocol":"tcp",
               "containerPort":4443
            },
            {
               "hostPort":4444,
               "protocol":"tcp",
               "containerPort":4444
            }
         ],
         "command":[
            
         ],
         "linuxParameters":null,
         "cpu":1000,
         "environment":[
            
         ],
         "resourceRequirements":null,
         "ulimits":null,
         "dnsServers":null,
         "mountPoints":[
            
         ],
         "workingDirectory":null,
         "secrets":null,
         "dockerSecurityOptions":null,
         "memory":null,
         "memoryReservation":2096,
         "volumesFrom":[
            
         ],
         "stopTimeout":60,
         "image":"xxxxxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/selenium-hub",
         "startTimeout":30,
         "firelensConfiguration":null,
         "dependsOn":null,
         "disableNetworking":null,
         "interactive":null,
         "healthCheck":{
            "retries":5,
            "command":[
               "CMD-SHELL",
               "curl -f http://localhost:4444 || exit 1"
            ],
            "timeout":60,
            "interval":5,
            "startPeriod":5
         },
         "essential":true,
         "links":null,
         "hostname":"selenium-hub",
         "extraHosts":null,
         "pseudoTerminal":null,
         "user":null,
         "readonlyRootFilesystem":null,
         "dockerLabels":null,
         "systemControls":null,
         "privileged":true,
         "name":"selenium-hub"
      },
      {
         "dnsSearchDomains":null,
         "environmentFiles":null,
         "logConfiguration":null,
         "entryPoint":null,
         "portMappings":[
            {
               "hostPort":6900,
               "protocol":"tcp",
               "containerPort":5900
            }
         ],
         "command":null,
         "linuxParameters":null,
         "cpu":1000,
         "environment":[
            {
               "name":"SE_EVENT_BUS_HOST",
               "value":"selenium-hub"
            },
            {
               "name":"SE_EVENT_BUS_PUBLISH_PORT",
               "value":"4442"
            },
            {
               "name":"SE_EVENT_BUS_SUBSCRIBE_PORT",
               "value":"4443"
            }
         ],
         "resourceRequirements":null,
         "ulimits":null,
         "dnsServers":null,
         "mountPoints":[
            
         ],
         "workingDirectory":null,
         "secrets":null,
         "dockerSecurityOptions":null,
         "memory":2096,
         "memoryReservation":null,
         "volumesFrom":[
            
         ],
         "stopTimeout":30,
         "image":"selenium/standalone-chrome:4.0.0",
         "startTimeout":30,
         "firelensConfiguration":null,
         "dependsOn":[
            {
               "containerName":"selenium-hub",
               "condition":"HEALTHY"
            }
         ],
         "disableNetworking":null,
         "interactive":null,
         "healthCheck":null,
         "essential":true,
         "links":null,
         "hostname":null,
         "extraHosts":null,
         "pseudoTerminal":null,
         "user":null,
         "readonlyRootFilesystem":null,
         "dockerLabels":null,
         "systemControls":null,
         "privileged":null,
         "name":"standalone-chrome"
      }
   ],
   "placementConstraints":[
      
   ],
   "memory":"2096",
   "taskRoleArn":"arn:aws:iam::xxxxxxxxxxxx:role/Selenium-ECR-Task",
   "compatibilities":[
      "EXTERNAL",
      "EC2"
   ],
   "taskDefinitionArn":"arn:aws:ecs:eu-west-1:xxxxxxxxxxxx:task-definition/Selenium-Task-Definition:52",
   "family":"Selenium-Task-Definition",
   "requiresAttributes":[
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"com.amazonaws.ecs.capability.ecr-auth"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"com.amazonaws.ecs.capability.privileged-container"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"com.amazonaws.ecs.capability.docker-remote-api.1.17"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"com.amazonaws.ecs.capability.docker-remote-api.1.21"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"com.amazonaws.ecs.capability.task-iam-role"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"ecs.capability.container-health-check"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"ecs.capability.container-ordering"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"ecs.capability.execution-role-ecr-pull"
      },
      {
         "targetId":null,
         "targetType":null,
         "value":null,
         "name":"com.amazonaws.ecs.capability.docker-remote-api.1.29"
      }
   ],
   "pidMode":null,
   "requiresCompatibilities":[
      "EC2"
   ],
   "networkMode":"bridge",
   "cpu":"2000",
   "revision":52,
   "status":"ACTIVE",
   "inferenceAccelerators":null,
   "proxyConfiguration":null,
   "volumes":[
      
   ]
}



Crowdcube is the trading name of Crowdcube Capital Limited, registered in England and Wales No. 09095835. Registered Office: Fourth Floor, Broadwalk House (South), Southernhay West, Exeter, Devon, EX1 1TS

Crowdcube Capital Limited is authorised and regulated by the Financial Conduct Authority (No. 650205) 

The contents of this email do not constitute legal, financial or tax advice, all recipients are required to obtain their own independent advice.

Reply all
Reply to author
Forward
0 new messages