aerokube / ggr

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

Setting a custom default version in quota file like `latest` or `0` #351

Closed m-alzaeem closed 2 years ago

m-alzaeem commented 2 years ago

Hi,

I have 5 Selenoid nodes running using CM, and a separate node running GGR. Everything work fine, but I need to make the default version in the quota file a custom value, since I don't want to keep changing it when CM on each Selenoid node pulls the latest browser version. So I tried to write a script to automate this process which execute every week and rerun CM and pull the latest browsers docker images, then change the default version to 0 in the browsers.json file, then rerun CM using the custom browsers.json file. After that I change the default version in the GGR quota file to also be 0, but when I run curl --data '{"capabilities": {"alwaysMatch": {"browserName": "firefox"}}}' http://test:test-password@localhost:4444/wd/hub/session I get: {"status":13,"value":{"message":"cannot create session firefox-0 on any hosts after 1 attempt(s), last host error was: Requested environment is not available"}}

here is my GGR quota file:

<qa:browsers xmlns:qa="urn:config.gridrouter.qatools.ru">
<browser name="firefox" defaultVersion="0">
    <version number="0">
        <region name="1">
            <host name="10.10.1.136" port="4444" count="1"/>
        </region>
    </version>
</browser>
</qa:browsers>

here one of my Selenoid nodes browsers.json file:

{"firefox":{"default":"0","versions":{"0":{"image":"selenoid/firefox:94.0","port":"4444","path":"/wd/hub"}}}}

It seems like GGR uses the default version in the quota file to match it with the image version in the Selenoid browsers.json file, not sure if that's the case.

So my goal is to only set the GGR quota file once so I don't have to change it every time that CM pulls a new browser version

thanks!

vania-pooh commented 2 years ago

@m-alzaeem latest will not work with Firefox because internally Geckodriver is comparing version from capabilities to browser version installed. If they don't match - an error is thrown.

stale[bot] commented 2 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.