Skip to content

Commit

Permalink
Merge pull request #367 from vania-pooh/master
Browse files Browse the repository at this point in the history
Better docs
  • Loading branch information
vania-pooh committed May 30, 2022
2 parents c00a21c + 57717f3 commit e83d8e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ci/docker-push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

docker build -t $GITHUB_REPOSITORY .
docker build --pull -t $GITHUB_REPOSITORY .
docker tag $GITHUB_REPOSITORY $GITHUB_REPOSITORY:$1
mkdir -p watch
cp ggr-watch watch/ggr
Expand Down
20 changes: 10 additions & 10 deletions docs/quota-files.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Creating Quota Files

. Quota files define available browsers for each user. All quota files should be placed to the same directory.
. Quota files define available browsers for each user. All quota files should be placed to the same directory.
. For user ```username``` quota file should be named ```username.xml```.
. Each quota file contains the following XML:
+
Expand All @@ -21,7 +21,7 @@
</version>
<version number="60.0">
...
</version>
</version>
</browser>
<browser name="chrome" defaultVersion="67.0">
...
Expand All @@ -32,11 +32,11 @@
+
Here we define a list of browser names, their versions and default version for each browser. Each version has one or more regions (in cloud term, i.e. data centers). Every region contains one or more hosts. Each host defined in XML should have Selenium listening on specified port. The XML namespace is needed to be fully compatible with http://github.com/seleniumkit/gridrouter[original] Java GridRouter implementation.
+
NOTE: A frequent question being asked is the meaning of `count` attribute because the name for historical questions is a bit confusing. You can have hosts with different number of CPU and memory allowing to run different number of browsers simultaneously. So `count` is the relative host weight allowing to adjust the load to every host depending on its capacity. For example if your quota contains two hosts with `count = 1` and `count = 3` then new session requests will be distributed as `1:3` between these hosts. The easiest way to deliver uniform load distribution is to set `count` equal to total number of browsers available on the host. This is what we always recommend to do by default.
. Browser name is matched against `browserName` capability. Values are compared as strings and should be exactly equal. When testing mobile applications (e.g. with http://github.com/appium/appium[Appium]) `browserName` capability makes no sense and can be replaced by `deviceName` capability. Ggr will try to match both against browser name specified in XML.
NOTE: A frequent question being asked is the meaning of `count` attribute because the name for historical questions is a bit confusing. You can have hosts with different number of CPU and memory allowing to run different number of browsers simultaneously. So `count` is the relative host weight allowing to adjust the load to every host depending on its capacity. For example if your quota contains two hosts with `count = 1` and `count = 3` then new session requests will be distributed as `1:3` between these hosts. The easiest way to deliver uniform load distribution is to set `count` equal to total number of browsers available on the host. This is what we always recommend to do by default.

. Browser name is matched against `browserName` capability. Values are compared as strings and should be exactly equal. When testing mobile applications (e.g. with http://github.com/appium/appium[Appium]) `browserName` capability makes no sense and can be replaced by `deviceName` or `appium:deviceName` capability. Ggr will try to match both against browser name specified in XML.
. Version `number` is matched against `version` or `browserVersion` capability by prefix. For example both `61` and `61.0` in version capability (i.e. in your code) will match version number `61.0`.
. Similarly version `platform` attribute is matched against `platform` or `platformName` capability by prefix. When platform from capabilities equals to `ANY` - default platform will be chosen.
. Similarly version `platform` attribute is matched against `platform` or `platformName` capability by prefix. When platform from capabilities equals to `ANY` - default platform will be chosen.
. Sometimes you may need to have the same browser name and version on different platforms, e.g. Firefox on both Linux and Windows. To achieve this you need to add `defaultPlatform` and `platform` attributes to quota file as follows:
+
.Adding platform information to quota file
Expand All @@ -49,7 +49,7 @@ NOTE: A frequent question being asked is the meaning of `count` attribute becaus
</version>
<version number="61.0" platform="WINDOWS">
...
</version>
</version>
</browser>
...
</qa:browsers>
Expand All @@ -65,14 +65,14 @@ ws://ggr-host.example.com:4444/vnc/<session-id>
----
Browser VNC clients like https://github.com/novnc/noVNC[noVNC] work with such URLs out of the box. By default having an XML host entry like this...
[source,xml]
----
----
<host name="host1.example.com" port="4444" count="1"/>
----

...Ggr proxies all traffic from `host1.example.com:5900`. You can customize this by adding an optional `vnc` attribute to a host:

[source,xml]
----
----
<host name="host1.example.com" port="4444" count="1" vnc="vnc://host1.example.com:6900"/>
----

Expand Down Expand Up @@ -121,5 +121,5 @@ With these flags specified any browsers declared in `test.xml` file will be acce
You may want to show lists of available browsers in the user interface. To fetch this information from Ggr just use the following request:

$ curl -s http://test:test-password@example.com:4444/quota

This request returns quota file contents as JSON for specified user.

0 comments on commit e83d8e5

Please sign in to comment.