aerokube / ggr

A lightweight load balancer used to create big Selenium clusters
https://aerokube.com/ggr/latest/
Apache License 2.0
314 stars 73 forks source link

ggr docker start issue in windows 10 #304

Closed Revanth2020 closed 4 years ago

Revanth2020 commented 4 years ago

Hi, I am very new to docker with selenoid. I am trying to use selenoid instead of selenium grid. I am trying to configuring ggr(go grid router). Can you please anyone explain about it. also, I have seen some ggr configuration in GitHub. but I am unable to find the exact setup. facing some issues while creating multiple selenoid hubs. can you please anybody help me. GGR setup. for load balancing. using multiple selenoid hubs. and also we tried couple of video also which was given what are the links you shared to me we alredy gone through it. But i am unable to find exact setup.While configuring GGR setup i mean the way of using this feature. its not clear for me. Can you please , if you have any example base setup. its very helpful . Followed steps in power shell windows 10:- 1.Install Docker to host 2.mkdir -p /etc/grid-router/quota

  1. C:\Windows\system32> htpasswd -bc /etc/grid-router/users.htpasswd test test-password Adding password for user test 4.C:\etc\grid-router\quota> docker run -d --name ggr -v /etc/grid-router/:/etc/grid-router:rw --net host aerokube/ggr:l atest-release bc5af4b44631e500c9f5115d27c77192d724b0f14bc3f8b738060b22607b491c logs:- 2020/03/16 07:33:15 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"]

2020/03/16 07:33:15 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file "/etc/grid-router/users.htpasswd" does not exist or is a directory]

can you please help me

aandryashin commented 4 years ago

Hello, all configuration examples are for linux or mac. We do not have experience to run ggr and selenoid on windows platform. In your case most probably there is volume mounting issue because ot filesystem paths. I recommend that you setup ggr and selenoids on linux hosts or vms... Also have a look at another our project that can be run on windows:

https://github.com/aerokube/kubernetes-selenium-desktop

пн, 16 мар. 2020 г., 11:24 Revanth2020 notifications@github.com:

Hi, I am very new to docker with selenoid. I am trying to use selenoid instead of selenium grid. I am trying to configuring ggr(go grid router). Can you please anyone explain about it. also, I have seen some ggr configuration in GitHub. but I am unable to find the exact setup. facing some issues while creating multiple selenoid hubs. can you please anybody help me. GGR setup. for load balancing. using multiple selenoid hubs. and also we tried couple of video also which was given what are the links you shared to me we alredy gone through it. But i am unable to find exact setup.While configuring GGR setup i mean the way of using this feature. its not clear for me. Can you please , if you have any example base setup. its very helpful . Followed steps in power shell windows 10:- 1.Install Docker to host 2.mkdir -p /etc/grid-router/quota

  1. C:\Windows\system32> htpasswd -bc /etc/grid-router/users.htpasswd test test-password Adding password for user test 4.C:\etc\grid-router\quota> docker run -d --name ggr -v /etc/grid-router/:/etc/grid-router:rw --net host aerokube/ggr:l atest-release bc5af4b44631e500c9f5115d27c77192d724b0f14bc3f8b738060b22607b491c logs:- 2020/03/16 07:33:15 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"]

2020/03/16 07:33:15 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file "/etc/grid-router/users.htpasswd" does not exist or is a directory]

can you please help me

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aerokube/ggr/issues/304, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKY23OJR6PUKN5536R2FI3RHXO4VANCNFSM4LL5ODNA .

vania-pooh commented 4 years ago

@Revanth2020 you need to do two changes:

-v /etc/grid-router/:/etc/grid-router => -v /c/etc/grid-router/:/etc/grid-router

# --net host does not work on Windows \ Mac
--net host => -p 4444:4444 
Revanth2020 commented 4 years ago

HI, Thanks it working but i am not able to open the ggr hub showing below error can you please help me regarding it. Logs:- 2020/03/17 14:04:39 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"] GUI:- 404 page not found do i need to do some configuration ?

Revanth2020 commented 4 years ago

Seleniod is run in Port 4445 PS C:\Users\venkata.vadlapudi> .\cm_windows_amd64.exe selenoid start --vnc -p 4445

Using Docker

  • Your Docker API version is 1.40 Selenoid is already downloaded Selenoid is already configured Selenoid is already running

XML file:-

vania-pooh commented 4 years ago

@Revanth2020 Ggr should only respond on /ping.

Revanth2020 commented 4 years ago

HI , thanks for the command i able to create session from seleniod but not able to create from ggr code:- DesiredCapabilities dcap = DesiredCapabilities.chrome(); ChromeOptions options = new ChromeOptions(); dcap.setCapability(ChromeOptions.CAPABILITY, options); dcap.setCapability("enableVNC", true); String driverPath = "D:\Grid-3.8.1\chromedriver"; System.setProperty("webdriver.chrome.driver", driverPath); RemoteWebDriver driver=new RemoteWebDriver(new URL("http://test:test-password@localhost:4444/wd/hub"), dcap);

        driver.get("http://www.javacodegeeks.com/");
        WebElement element = driver.findElement(By.name("s"));
        element.sendKeys("selenuim");
        element.submit();
        driver.quit();

xml:-

Logs:- 2020/03/18 06:42:06 [3] [0.00s] [SESSION_NOT_CREATED] [test] [172.17.0.1] [chrome-80.0] [-] [-] [-] [-]

2020/03/18 06:42:55 [4] [0.00s] [SESSION_ATTEMPTED] [test] [172.17.0.1] [chrome-80.0] [localhost:4445] [-] [1] [-]

2020/03/18 06:42:55 [4] [0.01s] [SESSION_FAILED] [test] [172.17.0.1] [chrome-80.0] [localhost:4445] [-] [1] []

2020/03/18 06:42:55 [4] [0.01s] [SESSION_NOT_CREATED] [test] [172.17.0.1] [chrome-80.0] [-] [-] [-] [-]

Can you please help me in this

Revanth2020 commented 4 years ago

`

`

vania-pooh commented 4 years ago

@Revanth2020 this is because of localhost. In Docker localhost inside container is not the same a localhost outside of it, so when you specify localhost in XML file Ggr is not able to access port 4445 on this host just because nothing is listening there inside container. This will only work with --net host mode, but this feature only works under Linux. Possible solution: use host machine IP address instead of localhost or start both selenoid and ggr in custom Docker network (with --network <name> flag) and then use container name (selenoid) instead of localhost in XML file.

Revanth2020 commented 4 years ago

HI , Thanks but if i try to open GGR in different port its not pinging docker run -d --name ggr -v /c/etc/grid-router/:/etc/grid-router -p 5555:5555 aerokube/ ggr:latest-release

Showing as This page isn’t working do i need to do any new setting docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9c897b76e797 aerokube/ggr:latest-release "/usr/bin/ggr -liste…" 5 minutes ago Up 5 minutes 4444/tcp, 0.0.0.0:5555->5555/tcp ggr 48e7f467c1dc aerokube/selenoid-ui:1.10.0 "/selenoid-ui --sele…" 5 minutes ago Up 5 minutes (healthy) 0.0.0.0:8080->8080/tcp selenoid-ui b12cea262cb6 aerokube/selenoid:1.10.0 "/usr/bin/selenoid -…" 5 minutes ago Up 5 minutes 0.0.0.0:4444->4444/tcp selenoid

vania-pooh commented 4 years ago

@Revanth2020 Ggr is always running on port 4444 inside container, so -p 5555:5555 makes no sense.

Livira commented 4 years ago

Will join the thread if no objections, otherwise will create a separate issue. Also playing around with ggr + selenoid as POC so using my Windows 10 machine.

1) created the docker network docker network create selenoid

2) started selenoid docker run -d --name selenoid --network selenoid -p 4445:4444 -v //var/run/docker.sock:/var/run/docker.sock -v /c/config:/etc/selenoid/:ro aerokube/selenoid:latest-release logs: 2020/03/18 11:31:45 [-] [INIT] [Loading configuration files...] 2020/03/18 11:31:45 [-] [INIT] [Loaded configuration from /etc/selenoid/browsers.json] 2020/03/18 11:31:45 [-] [INIT] [Video Dir: /opt/selenoid/video] 2020/03/18 11:31:45 [-] [INIT] [Your Docker API version is 1.40] 2020/03/18 11:31:45 [-] [INIT] [Timezone: UTC] 2020/03/18 11:31:45 [-] [INIT] [Listening on :4444]

3) started ggr docker run -d --name ggr --network selenoid -p 4444:4444 -v /c/grid-router/:/etc/grid-router:ro aerokube/ggr:latest-release logs: 2020/03/18 11:31:57 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"] 2020/03/18 11:31:57 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"] 2020/03/18 11:32:32 [0] [0.00s] [UNSUPPORTED_BROWSER] [test] [172.18.0.1] [chrome] [-] [-] [-] [-] 2020/03/18 11:32:32 [1] [0.00s] [UNSUPPORTED_BROWSER] [test] [172.18.0.1] [chrome] [-] [-] [-] [-] 2020/03/18 11:32:33 [2] [0.00s] [UNSUPPORTED_BROWSER] [test] [172.18.0.1] [chrome] [-] [-] [-] [-] 2020/03/18 11:32:33 [3] [0.00s] [UNSUPPORTED_BROWSER] [test] [172.18.0.1] [chrome] [-] [-] [-] [-]

4) test.xml file

<qa:browsers xmlns:qa="urn:config.gridrouter.qatools.ru">
<browser name="chrome" defaultVersion="80.0">
    <version number="80.0">
        <region name="1">
            <host name="selenoid" port="4445" count="1"/>
        </region>
    </version>
</browser>
</qa:browsers>

5) browsers.json

{
    "chrome": {
        "default": "80.0",
        "versions": {
            "79.0": {
                "image": "selenoid/vnc_chrome:79.0",
                "port": "4445",
                "path": "/"
            },
            "80.0": {
                "image": "selenoid/vnc_chrome:80.0",
                "port": "4445",
                "path": "/",
        "shmSize" : 2147483648
            }
        }
    }
}

When I run the test I'm having org.openqa.selenium.WebDriverException: un supported browser: chrome (WARNING: The server did not provide any stacktrace information) and logs in ggr is above (UNSUPPORTED_BROWSER) When I ping http://test:test-password@localhost:4444/ping { "uptime": "1m45.364861461s", "lastReloadTime": "2020-03-18T11:19:00Z", "numRequests": 4, "numSessions": 0, "version": "1.6.6" }

6) docker ps -a


CONTAINER ID        IMAGE                              COMMAND                  CREATED             STATUS                    PORTS                                            NAMES
d4764ab86f85        aerokube/ggr:latest-release        "/usr/bin/ggr -liste…"   24 hours ago        Up 19 minutes             0.0.0.0:4444->4444/tcp                           ggr
ef9b19e25b8e        aerokube/selenoid:latest-release   "/usr/bin/selenoid -…"   24 hours ago        Up 19 minutes             0.0.0.0:4445->4444/tcp                           selenoid
4a7b203a5ab5        dockergrafanainfluxkit_grafana     "/app/entrypoint.sh"     12 days ago         Exited (255) 7 days ago   0.0.0.0:3000->3000/tcp                           dockergrafanainfluxkit_grafana_1
2d14d4ff1956        dockergrafanainfluxkit_influxdb    "/app/entrypoint.sh"     12 days ago         Exited (255) 7 days ago   0.0.0.0:2003->2003/tcp, 0.0.0.0:8086->8086/tcp   dockergrafanainfluxkit_influxdb_1```

I've already pulled seneoid/vnc_chrome image and ran out of the ideas where to look further. Guys, will appreciate your help very much!
Thank you)

PS: if run the test against the selenoid - it's working fine, the issue is somewhere with the ggr integration
vania-pooh commented 4 years ago

@Livira your setup seems to be correct. This error usually means that Ggr is not able to find browser version in XML configuration file. This could be either because configuration file is not loaded at all or because browser name from test does not match to the name in XML file. I would check first version. Just restart Ggr with -verbose flag:

docker run -d --name ggr --network selenoid -p 4444:4444 -v /c/grid-router/:/etc/grid-router:ro aerokube/ggr:latest-release -verbose

You should then see Ggr printing your XML file to logs. If it does not - check that your XML file is in /c/grid-router/quota directory because Ggr is seaching for files there:

2020/03/18 11:31:57 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"]
Livira commented 4 years ago

Added verbose flag, interesting formatting, json view from xml file

2020/03/18 17:07:52 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Users file is "/etc/grid-router/users.htpasswd"] 2020/03/18 17:07:52 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loading configuration files from "/etc/grid-router/quota"] 2020/03/18 17:07:52 [-] [-] [INIT] [-] [-] [-] [-] [-] [-] [Loaded configuration from "/etc/grid-router/quota/text.xml"] {{urn:config.gridrouter.qatools.ru browsers} [{chrome 80.0 [{80.0 [{1 [{selenoid 4444 1 1 <nil>}]}]}]}]} 2020/03/18 17:09:37 [0] [0.01s] [UNSUPPORTED_BROWSER] [test] [172.17.0.1] [chrome] [-] [-] [-] [-] 2020/03/18 17:09:37 [1] [0.01s] [UNSUPPORTED_BROWSER] [test] [172.17.0.1] [chrome] [-] [-] [-] [-] 2020/03/18 17:09:37 [2] [0.00s] [UNSUPPORTED_BROWSER] [test] [172.17.0.1] [chrome] [-] [-] [-] [-] 2020/03/18 17:09:37 [3] [0.00s] [UNSUPPORTED_BROWSER] [test] [172.17.0.1] [chrome] [-] [-] [-] [-]

Sorry for switching to another topic, I've rearranged the setup by reusing docker-compose file I found on github and things seem working, I see logs in ggr container, I can see selenoid-ui and vnc, the only missing part is that I see NO VIDEOS YET :'( when hit http://localhost:8081/#/videos. The tab 'videos' which was present with only selenoid setup is no longer displayed. Did I miss smth in my docker-compose file? Should I include the video-recorder separately?

version: '3'
services:
  selenoid:
    image: aerokube/selenoid:latest-release
    network_mode: bridge
    ports:
      - "4445:4444"
    volumes:
      - "/c/config:/etc/selenoid/"
      - "//var/run/docker.sock:/var/run/docker.sock"
      - "/c/config/video:/opt/selenoid/video"
      - "/c/config/logs:/opt/selenoid/logs"
    environment:
      - OVERRIDE_VIDEO_OUTPUT_DIR=/c/config/video
    command: ["-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video", "-log-output-dir", "/opt/selenoid/logs"]

  selenoid-ui:
    restart: always
    network_mode: bridge
    image: aerokube/selenoid-ui:latest
    ports:
      - "8081:8081"
    links:
      - ggr-ui
    depends_on:
      - ggr-ui
    command: ["-listen", ":8081", "--selenoid-uri", "http://ggr-ui:8888"]

  ggr:
    restart: always
    network_mode: bridge
    image: aerokube/ggr:latest-release
    ports:
      - "4444:4444"
    links:
      - selenoid
    depends_on:
      - selenoid
    volumes:
      - "/c/config/grid-router/:/etc/grid-router:ro"

  ggr-ui:
    restart: always
    network_mode: bridge
    image: aerokube/ggr-ui:latest
    ports:
      - "8888:8888"
    depends_on:
      - selenoid
    links:
      - selenoid
    volumes:
      - "/c/config/grid-router/:/etc/grid-router:ro"
vania-pooh commented 4 years ago

@Livira https://github.com/aerokube/ggr-ui/issues/46

Livira commented 4 years ago

@vania-pooh , many thanks for your support and answers! looking forward for this feature!

Revanth2020 commented 4 years ago

HI

Hi, if i use above docker compose how should i connect the ggr in script and what name should i give in xml and how to open selenoid ui,ggr ui in browser can you please tell me i am new to GGR selenoid

.

Revanth2020 commented 4 years ago

cannot able to create more number of session showing 2020/04/03 23:01:37 [6] [CREATING_CONTAINER] [selenoid/firefox:73.0] 2020/04/03 23:01:39 [5] [STARTING_CONTAINER] [selenoid/firefox:73.0] [1f3a4f2cf6de1f76d37db0486fdb087098d55310ddf2b9afe992ae92ac78498d] 2020/04/03 23:01:39 [3] [STARTING_CONTAINER] [selenoid/firefox:73.0] [7d5e21728ed315f24495a558d54ca8b533f1e48891a94dd4a58f23d5c8245718] 2020/04/03 23:01:39 [4] [STARTING_CONTAINER] [selenoid/firefox:73.0] [874ea8918140583efdbc0e9d71122378e6cf01485c3b7b0c7db6facd5dd3c5b0] 2020/04/03 23:01:39 [6] [STARTING_CONTAINER] [selenoid/firefox:73.0] [dd2cab1859b1e94cbd2d5a3bd421bd1b8ff1a9cd820601dae4607fd72062d923] 2020/04/03 23:01:43 [6] [CONTAINER_STARTED] [selenoid/firefox:73.0] [dd2cab1859b1e94cbd2d5a3bd421bd1b8ff1a9cd820601dae4607fd72062d923] [3.19s] 2020/04/03 23:01:43 [5] [CONTAINER_STARTED] [selenoid/firefox:73.0] [1f3a4f2cf6de1f76d37db0486fdb087098d55310ddf2b9afe992ae92ac78498d] [4.01s] 2020/04/03 23:01:45 [3] [CONTAINER_STARTED] [selenoid/firefox:73.0] [7d5e21728ed315f24495a558d54ca8b533f1e48891a94dd4a58f23d5c8245718] [5.36s] 2020/04/03 23:01:45 [4] [CONTAINER_STARTED] [selenoid/firefox:73.0] [874ea8918140583efdbc0e9d71122378e6cf01485c3b7b0c7db6facd5dd3c5b0] [5.42s] 2020/04/03 23:01:48 [3] [SERVICE_STARTED] [selenoid/firefox:73.0] [7d5e21728ed315f24495a558d54ca8b533f1e48891a94dd4a58f23d5c8245718] [3.57s] 2020/04/03 23:01:48 [3] [PROXY_TO] [7d5e21728ed315f24495a558d54ca8b533f1e48891a94dd4a58f23d5c8245718] [http://127.0.0.1:32864/wd/hub] 2020/04/03 23:01:49 [3] [SESSION_ATTEMPTED] [http://127.0.0.1:32864/wd/hub] [1] 2020/04/03 23:01:48 [6] [SERVICE_STARTED] [selenoid/firefox:73.0] [dd2cab1859b1e94cbd2d5a3bd421bd1b8ff1a9cd820601dae4607fd72062d923] [5.74s] 2020/04/03 23:01:48 [5] [SERVICE_STARTED] [selenoid/firefox:73.0] [1f3a4f2cf6de1f76d37db0486fdb087098d55310ddf2b9afe992ae92ac78498d] [4.92s] 2020/04/03 23:01:48 [4] [SERVICE_STARTED] [selenoid/firefox:73.0] [874ea8918140583efdbc0e9d71122378e6cf01485c3b7b0c7db6facd5dd3c5b0] [3.53s] 2020/04/03 23:01:49 [6] [PROXY_TO] [dd2cab1859b1e94cbd2d5a3bd421bd1b8ff1a9cd820601dae4607fd72062d923] [http://127.0.0.1:32849/wd/hub] 2020/04/03 23:01:49 [5] [PROXY_TO] [1f3a4f2cf6de1f76d37db0486fdb087098d55310ddf2b9afe992ae92ac78498d] [http://127.0.0.1:32854/wd/hub] 2020/04/03 23:01:49 [4] [PROXY_TO] [874ea8918140583efdbc0e9d71122378e6cf01485c3b7b0c7db6facd5dd3c5b0] [http://127.0.0.1:32859/wd/hub] 2020/04/03 23:01:49 [6] [SESSION_ATTEMPTED] [http://127.0.0.1:32849/wd/hub] [1] 2020/04/03 23:01:49 [5] [SESSION_ATTEMPTED] [http://127.0.0.1:32854/wd/hub] [1] 2020/04/03 23:01:49 [4] [SESSION_ATTEMPTED] [http://127.0.0.1:32859/wd/hub] [1] 2020/04/03 23:02:23 [3] [SESSION_FAILED] [http://127.0.0.1:32864/wd/hub] [500 Internal Server Error] 2020/04/03 23:02:23 [3] [REMOVING_CONTAINER] [7d5e21728ed315f24495a558d54ca8b533f1e48891a94dd4a58f23d5c8245718] 2020/04/03 23:02:23 [4] [SESSION_FAILED] [http://127.0.0.1:32859/wd/hub] [500 Internal Server Error] 2020/04/03 23:02:23 [4] [REMOVING_CONTAINER] [874ea8918140583efdbc0e9d71122378e6cf01485c3b7b0c7db6facd5dd3c5b0] 2020/04/03 23:02:23 [5] [SESSION_FAILED] [http://127.0.0.1:32854/wd/hub] [500 Internal Server Error] 2020/04/03 23:02:23 [5] [REMOVING_CONTAINER] [1f3a4f2cf6de1f76d37db0486fdb087098d55310ddf2b9afe992ae92ac78498d] 2020/04/03 23:02:23 [6] [SESSION_FAILED] [http://127.0.0.1:32849/wd/hub] [500 Internal Server Error] 2020/04/03 23:02:23 [6] [REMOVING_CONTAINER] [dd2cab1859b1e94cbd2d5a3bd421bd1b8ff1a9cd820601dae4607fd72062d923] 2020/04/03 23:02:37 [3] [CONTAINER_REMOVED] [7d5e21728ed315f24495a558d54ca8b533f1e48891a94dd4a58f23d5c8245718] 2020/04/03 23:02:37 [6] [CONTAINER_REMOVED] [dd2cab1859b1e94cbd2d5a3bd421bd1b8ff1a9cd820601dae4607fd72062d923] 2020/04/03 23:02:37 [4] [CONTAINER_REMOVED] [874ea8918140583efdbc0e9d71122378e6cf01485c3b7b0c7db6facd5dd3c5b0] 2020/04/03 23:02:37 [5] [CONTAINER_REMOVED] [1f3a4f2cf6de1f76d37db0486fdb087098d55310ddf2b9afe992ae92ac78498d]

Revanth2020 commented 4 years ago

i am able to create only one session connecting from ggr server to another machine

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.