aerokube / ggr-ui

The missing /status API for Ggr
https://aerokube.com/ggr-ui/latest/
Apache License 2.0
39 stars 15 forks source link

GGR and Selenoid setup issue - not able to run test on desire selenoid server machine #59

Closed kndani closed 3 years ago

kndani commented 3 years ago

I have some problems with GGR and Selenoid. I tried to set up and followed the documentation and below are the two ways I tried to set up GGR on a Linux machine. We have three servers selenoid1, selenoid2, and selenod3. I am configuring GGR on the selenoid3 server

  1. Setup as per documentation available in the company to configure GGR

Quota file and htpasswd was created as described on the official site, quota file contains host selenoid1 and selenoid2 server, and selenoid3 works as GGR server

Start Selenoid on all three server: docker run -d --name selenoid -p 4444:4444 -e TZ=Etc/GMT+0 -e OVERRIDE_VIDEO_OUTPUT_DIR=/usr/local/selenoid/video/ -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/selenoid/config:/etc/selenoid/:ro -v /usr/local/selenoid/logs:/opt/selenoid/logs -v /usr/local/selenoid/video:/opt/selenoid/video aerokube/selenoid:latest-release -video-output-dir /opt/selenoid/video -timeout 3m0s -limit 8

Start GGR on selenoid3 server: docker run -d --name ggr -p 4445:4444 -v /etc/grid-router:/etc/grid-router:ro aerokube/ggr:latest-release -guests-allowed -guests-quota /etc/grid-router/quota/auto

Start GGR-UI on selenoid3 server: docker run -d --name ggr-ui -p 8888:8888 -v /etc/grid-router/quota/:/etc/grid-router/quota:ro aerokube/ggr-ui:latest-release

Start Selenoid-UI on all three server: docker run -d --name selenoid-ui -p 8081:8080 --link ggr-ui aerokube/selenoid-ui:latest-release --selenoid-uri http://ggr-ui:8888

With the above configuration when I run curl http://auto:password@#{ggr_servername}:4445/status and I get 404 page not found when I run the test it does not connect to GGR and gives a 500 error. I also restarted all the containers again but still, I got the same error

GGR-ui log: 2021/07/02 21:10:32 [INIT] [Loading quota files from /etc/grid-router/quota] 2021/07/02 21:10:32 [INIT] [Listen on :8888] GGR logs: 2021/07/02 22:00:28 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"] 2021/07/02 22:00:28 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"]

  1. As per my understanding based on the official guide on the GGR site

Quota file and htpasswd was created as described on the official site, quota file contains host selenoid1 and selenoid2 server, and selenoid3 works as GGR server

Start Selenoid on all three servers: docker run -d --name selenoid -p 4444:4444 -e TZ=Etc/GMT+0 -e OVERRIDE_VIDEO_OUTPUT_DIR=/usr/local/selenoid/video/ -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/selenoid/config:/etc/selenoid/:ro -v /usr/local/selenoid/logs:/opt/selenoid/logs -v /usr/local/selenoid/video:/opt/selenoid/video aerokube/selenoid:latest-release -video-output-dir /opt/selenoid/video -timeout 3m0s -limit 8

Start GGR on selenoid3 server: docker run -d --name ggr -v /etc/grid-router:/etc/grid-router:ro aerokube/ggr:latest-release -guests-allowed -guests-quota /etc/grid-router/quota/auto

Start GGR-UI on selenoid3 server:docker run -d --name ggr-ui -p 8888:8888 -v /etc/grid-router/quota/:/etc/grid-router/quota:ro aerokube/ggr-ui:latest-release

Start Selenoid-UI on all three server: docker run -d --name selenoid-ui -p 8081:8080 aerokube/selenoid-ui:latest-release --selenoid-uri http://#{ggr_servername}:8888

Logs GGR: 2021/07/02 20:51:55 [STATUS] [Failed to fetch status: Get http://#{selenoid1_name}:4444/status: dial tcp: lookup #{selenoid1} on #{selenoid1_ip}: no such host] [172.17.0.1] 2021/07/02 20:51:56 [SHUTDOWN] [Shutting down in 5m0s] 2021/07/02 21:05:00 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"] 2021/07/02 21:05:00 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"]

Logs complain about Selenoid1 no such details for Selenoid2, I assume Selenoid2 is working and connected successfully.

Logs GGR-UI 2021/07/02 22:54:37 [INIT] [Loading quota files from /etc/grid-router/quota] 2021/07/02 22:54:37 [INIT] [Listen on :8888] With the above configuration when I run curl http://auto:password@#{ggr_servername}:4444/status I get JSON response as expected and I am able to run the test but tests are executing on Selenoid3 server and chrome browser and vnc container start on selenoid3 server, I was expecting that tests will execute on Selenoid1 or Selenoid2 server but that never happens. I am not sure what is wrong with my configuration, is something I am missing?

I appreciate your help!!!

vania-pooh commented 3 years ago

@kndani Ggr is stateless and has no /status API, only /ping.

kndani commented 3 years ago

@vania-pooh other than GGR stateless what is the problem that it runs the test on Selenoid3 server, as in quota file I added only selenoid1 and selenoid2 for running test and selenoid3 is used as ggr server. Am I missing any step?

kndani commented 3 years ago

I ping the GGR on port 4444 and I got the below response based on the step 2 configuration steps as mentioned above: {"uptime":"67h9m9.970585863s","lastReloadTime":"2021-07-02T22:53:40Z","numRequests":112,"version":"1.10.3"}

vania-pooh commented 3 years ago

@kndani please show your quota file for Ggr.

kndani commented 3 years ago

`

</qa:browsers>`

I configure GGR with selenium-server-standalone and that worked fine, it started the test on the given host in quota file, but if I configure with Selenoid that doesn't work, it start the test execution on Selenoid3 server that is GGR server

kndani commented 3 years ago

Okay, so after using the same configuration setting (which I used for Selenium Standalone Server) I started Selenoid with GGR and that's worked as expected.