As a newbie to docker-selenium, yml and docker compose, can someone please advise me how to correctly set the max hub sessions and node essions/instances in docker compose? I'm currently using this yml:-
version: '2'
services:
chrome:
image: selenium/node-chrome:3.10.0-argon
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
environment:
- NODE_MAX_INSTANCES=10
- NODE_MAX_SESSION=10
- HUB_HOST=hub
hub:
image: selenium/hub:3.10.0-argon
ports:
- "4444:4444"
environment:
- GRID_MAX_SESSION=10
, which is a slight modification on the vanilla example from docker-selenium readme I would expect to be able to set the number of sessions and instances correctly in hub and node docker instances.
However, when I inspect the containers, the default settings have been used:-
"NODE_MAX_INSTANCES=1",
"NODE_MAX_SESSION=1",
on the node and :-
"GRID_MAX_SESSION=5",
on the hub. How can I fix this? I don't really want to have to spin up a hub for every 5 chromedriver instances I want to run. I should be able to squeeze in a few chromedriver instances per node, and have maybe 50+ instances per hub.
The Compose file is a YAML file defining services, networks and volumes. The default path for a Compose file is ./docker-compose.yml .
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application's services. Then, with a single command, you create and start all the services from your configuration.
yml is a config file for Docker Compose. It allows to deploy, combine, and configure multiple docker containers at the same time. The Docker "rule" is to outsource every single process to its own Docker container.
Docker Compose is a tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file to define the services and with a single command, can spin everything up or tear it all down.
The docker-compose needs a YAML file. Put all the configuration code in the YAML file such as Image name, container name, host port and container, environment variables, etc. The YAML file format will be a little bit different from the Docker commands in the command line.
Docker Compose is a tool that was developed to help define and share multi-container applications. With Compose, we can create a YAML file to define the services and with a single command, can spin everything up or tear it all down.
In a docker-compose.yml file, services represent the containers that will be created in the application. When you create a new Divio project using one of our quickstart repositories or one of defined project types, it will include a docker-compose.yml file ready for local use, with the services already defined.
You can name the x- properties anything you want as long as it’s valid YAML syntax. These x- properties are called “Extension fields” in Docker Compose’s documentation. The basic idea is the extension field just acts as a “place” to define the YAML anchor.
figured this out with help from the docker-selenium community. The correct yml should be:-
version: '2'
services:
chrome:
image: selenium/node-chrome:3.10.0-argon
volumes:
- /dev/shm:/dev/shm
depends_on:
- hub
environment:
NODE_MAX_INSTANCES: 10
NODE_MAX_SESSION: 10
HUB_HOST: hub
hub:
image: selenium/hub:3.10.0-argon
ports:
- "4444:4444"
environment:
GRID_MAX_SESSION: 10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With