From 8ba74743122e58f4f1e89fcfdba16ba91ec5d028 Mon Sep 17 00:00:00 2001 From: Luis Correia Date: Mon, 26 Apr 2021 16:32:34 +0100 Subject: [PATCH] Improve documentation on starting up grid (#1268) * add Swarm full grid setup * Remove /wd/hub endpoint reference --- README.md | 4 +- docker-compose-v3-full-grid-swarm.yml | 62 +++++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 docker-compose-v3-full-grid-swarm.yml diff --git a/README.md b/README.md index a3be77f3a..7a6f773d9 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,14 @@ $ docker run -d -p 4444:4444 -p 7900:7900 --shm-size 2g selenium/standalone-fire $ docker run -d -p 4444:4444 -p 7900:7900 -v /dev/shm:/dev/shm selenium/standalone-firefox:4.0.0-beta-3-prerelease-20210422 ``` -2. Point your WebDriver tests to http://localhost:4444/wd/hub +2. Point your WebDriver tests to http://localhost:4444 * 3. That's it! 4. (Optional) To see what is happening inside the container, head to http://localhost:7900 (password is `secret`). +* Grid 3 used "/wd/hub", while it should also work, it is no longer required + More details about visualising the container activity, check the [Debugging](#debugging) section. :point_up: When executing `docker run` for an image that contains a browser please either mount diff --git a/docker-compose-v3-full-grid-swarm.yml b/docker-compose-v3-full-grid-swarm.yml new file mode 100644 index 000000000..45ab249cf --- /dev/null +++ b/docker-compose-v3-full-grid-swarm.yml @@ -0,0 +1,62 @@ +# To start Docker in Swarm mode, you need to run `docker swarm init` +# To deploy the Grid, `docker stack deploy -c docker-compose-v3-swarm.yml grid` +# Stop with `docker stack rm grid` +# Stop swarm mode `docker swarm leave --force` + +version: '3.7' + +services: + chrome: + image: selenium/node-chrome:4.0.0-beta-3-prerelease-20210422 + volumes: + - /dev/shm:/dev/shm + environment: + - SE_EVENT_BUS_HOST=selenium-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + deploy: + replicas: 1 + entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' + + edge: + image: selenium/node-edge:4.0.0-beta-3-prerelease-20210422 + volumes: + - /dev/shm:/dev/shm + environment: + - SE_EVENT_BUS_HOST=selenium-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + deploy: + replicas: 1 + entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' + + firefox: + image: selenium/node-firefox:4.0.0-beta-3-prerelease-20210422 + volumes: + - /dev/shm:/dev/shm + environment: + - SE_EVENT_BUS_HOST=selenium-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + deploy: + replicas: 1 + entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' + + opera: + image: selenium/node-opera:4.0.0-beta-3-prerelease-20210422 + volumes: + - /dev/shm:/dev/shm + environment: + - SE_EVENT_BUS_HOST=selenium-hub + - SE_EVENT_BUS_PUBLISH_PORT=4442 + - SE_EVENT_BUS_SUBSCRIBE_PORT=4443 + deploy: + replicas: 1 + entrypoint: bash -c 'SE_OPTS="--host $$HOSTNAME" /opt/bin/entry_point.sh' + + selenium-hub: + image: selenium/hub:4.0.0-beta-3-prerelease-20210422 + ports: + - "4442:4442" + - "4443:4443" + - "4444:4444"