Closed namilkimfree closed 3 years ago
Execution with Standalone roles success don't have exception.
Do Node dockers and hubs need to be located on the same machine?
docker run --rm --name selenium-docker -p 4444:4444 \ -v NodeDocker/config.toml:/opt/bin/config.toml \ -v /assets:/opt/selenium/assets \ selenium/standalone-docker:4.0.0-rc-2-prerelease-20210916
They can be on different machines. But the exception says that the file was not found, do you have the configuration file on the other VM as well? Also, the config file path used to start Standalone and Node are different.
@diemol
Other virtual machines also have config files.
/NodeDocker/config.toml file and /assets folder
3 virtual machine servers Docker installation complete /Node Docker/config.toml file and /assets folder
Exists.
have /opt/bin/config.toml and /opt/selenium/aseets in other vm. 172.30.1.31(selenium-hub) 172.30.1.60(selenium-node-docker) 172.30.1.58(server to run dynamically)
@diemol Also i didn't use the [server] section of the config.toml file, use to the local url.
The sending registration event occurs. but It is not registered in Selenium hub.
[docker]
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
# start a container with the given image.
configs = [
"selenium/standalone-chrome:4.0.0-rc-2-prerelease-20210923", "{\"browserName\": \"chrome\"}"
]
url = "http://172.17.0.1:2375"
# Docker imagee used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20210923"
# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
#[server]
#host = <ip-from-node-machine>
#port = <port-from-node-machine>
#[server]
#host = "172.30.1.58"
#port = "2375
node-docker log
selenium hub log
@namilkimfree Any luck?
I just added this text in the README. It boils down to the configuration, here is what I did on my machines:
Machine 1, 192.168.1.12
docker run --rm -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.0.0-20211102
Machine 2, 192.168.1.18
TOML config
[docker]
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
# start a container with the given image.
configs = [
"selenium/standalone-chrome:4.0.0-20211102", '{"browserName": "chrome"}'
]
# Use the appropiate url for your Docker daemon
url = "http://host.docker.internal:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20211102"
# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
[server]
host = "192.168.1.18"
port = "5555"
Command
docker run -p 5555:5555 -e SE_EVENT_BUS_HOST=192.168.1.12 \
-e SE_EVENT_BUS_PUBLISH_PORT=4442 \
-e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 \
-v ${PWD}/config.toml:/opt/bin/config.toml \
-v ${PWD}/assets:/opt/selenium/assets \
selenium/node-docker:4.0.0-20211102
and then I get this logs:
2021-11-03 13:35:21,980 INFO Included extra file "/etc/supervisor/conf.d/selenium-grid-node-docker.conf" during parsing
2021-11-03 13:35:21,982 INFO supervisord started with pid 8
2021-11-03 13:35:22,984 INFO spawned: 'selenium-grid-node-docker' with pid 10
Starting Selenium Grid Node Docker...
2021-11-03 13:35:22,987 INFO success: selenium-grid-node-docker entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
13:35:23.260 INFO [LoggingOptions.configureLogEncoding] - Using the system default encoding
13:35:23.265 INFO [OpenTelemetryTracer.createTracer] - Using OpenTelemetry for tracing
13:35:23.327 INFO [UnboundZmqEventBus.<init>] - Connecting to tcp://192.168.1.12:4442 and tcp://192.168.1.12:4443
13:35:23.359 INFO [UnboundZmqEventBus.<init>] - Sockets created
13:35:24.362 INFO [UnboundZmqEventBus.<init>] - Event bus ready
13:35:24.448 INFO [NodeServer.createHandlers] - Reporting self as: http://192.168.1.18:5555
13:35:24.461 INFO [NodeOptions.getSessionFactories] - Detected 12 available processors
13:35:24.833 INFO [V141Docker.isContainerPresent] - Checking if container is present: 3d4644485698
13:35:24.856 INFO [Docker.getImage] - Obtaining image: selenium/standalone-chrome:4.0.0-20211102
13:35:24.859 INFO [V141Docker.getImage] - Listing local images: Reference{domain='docker.io', name='selenium/standalone-chrome', tag='4.0.0-20211102', digest='null'}
13:35:24.883 INFO [Docker.getImage] - Obtaining image: selenium/video:ffmpeg-4.3.1-20211102
13:35:24.884 INFO [V141Docker.getImage] - Listing local images: Reference{domain='docker.io', name='selenium/video', tag='ffmpeg-4.3.1-20211102', digest='null'}
13:35:24.896 INFO [Docker.getImage] - Obtaining image: selenium/video:ffmpeg-4.3.1-20211102
13:35:24.896 INFO [V141Docker.getImage] - Listing local images: Reference{domain='docker.io', name='selenium/video', tag='ffmpeg-4.3.1-20211102', digest='null'}
13:35:24.911 INFO [Docker.getImage] - Obtaining image: selenium/standalone-chrome:4.0.0-20211102
13:35:24.911 INFO [V141Docker.getImage] - Listing local images: Reference{domain='docker.io', name='selenium/standalone-chrome', tag='4.0.0-20211102', digest='null'}
13:35:24.927 INFO [DockerOptions.lambda$getDockerSessionFactories$1] - Mapping Capabilities {browserName: chrome} to docker image selenium/standalone-chrome:4.0.0-20211102 12 times
13:35:24.940 INFO [Node.<init>] - Binding additional locator mechanisms: name, relative, id
13:35:24.984 INFO [NodeServer$1.start] - Starting registration process for node id 5bb4eca3-113d-4ba9-93a3-e709b1b4a6ca
13:35:24.985 INFO [NodeServer.execute] - Started Selenium node 4.0.0 (revision 3a21814679): http://192.168.1.18:5555
13:35:24.992 INFO [NodeServer$1.lambda$start$1] - Sending registration event...
13:35:25.198 INFO [NodeServer.lambda$createHandlers$2] - Node has been added
Please check the added text to the README and the example provided above. Also, keep in mind that if you are mounting volumes in Linux, you might bump into this.
@diemol thank you .
I tried your guide, The result is success.
thank you best regard
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
🐛 Bug Report
To Reproduce
(172.30.1.31) -> selenium-hub
(172.30.1.60)
(172.30.1.58)
Expected behavior
NODE-DOCKER should run normally.
Test script reproducing this issue (when applicable)
docker run -d -p 4442-4444:4442-4444 --name selenium-hub selenium/hub:4.0.0-rc-2-prerelease-20210916
docker run -e SE_EVENT_BUS_HOST=172.30.1.31 -e SE_EVENT_BUS_PUBLISH_PORT=4442 -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -v /NodeDocker/config.toml:/opt/bin/config.toml -v /assets:/opt/selenium/assets selenium/node-docker:4.0.0-rc-2-prerelease-20210916
Environment
OS: Ubuntu 20.04.2 LTS (64 bit) Docker-Selenium image version: selenium/node-docker:4.0.0-rc-2-prerelease-20210916 --> Docker version: Docker version 20.10.2, build 20.10.2-0ubuntu1~20.04.3
Docker-Compose version (if applicable): Exact Docker command to start the containers (if using docker-compose, provide the docker-compose file as well):