From 5ea81463be9e188ebdfbf0ea49a41ed01d7d82c6 Mon Sep 17 00:00:00 2001 From: Yannick Schmetz Date: Tue, 30 Aug 2022 13:39:10 +0200 Subject: [PATCH 1/3] Allow SE_NODE_STEREOTYPE env var to set the stereotype --- NodeBase/generate_config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NodeBase/generate_config b/NodeBase/generate_config index 6e8d75b21c..49bf5ff91f 100755 --- a/NodeBase/generate_config +++ b/NodeBase/generate_config @@ -59,7 +59,12 @@ elif [[ "${SE_NODE_BROWSER_NAME}" == "MicrosoftEdge" ]]; then SE_NODE_BROWSER_VERSION=$(short_version $(microsoft-edge --version | awk '{print $3}')) fi +if [[ -z "$SE_NODE_STEREOTYPE" ]]; then SE_NODE_STEREOTYPE="{\"browserName\": \"${SE_NODE_BROWSER_NAME}\", \"browserVersion\": \"${SE_NODE_BROWSER_VERSION}\", \"platformName\": \"Linux\"}" +else +SE_NODE_STEREOTYPE="$SE_NODE_STEREOTYPE" +fi + echo "[[node.driver-configuration]]" >> "$FILENAME" echo "display-name = \"${SE_NODE_BROWSER_NAME}\"" >> "$FILENAME" echo "stereotype = '${SE_NODE_STEREOTYPE}'" >> "$FILENAME" From 1f05417cfbff67fa07c1ac42dbe037240ea05552 Mon Sep 17 00:00:00 2001 From: Yannick Schmetz Date: Tue, 30 Aug 2022 13:51:23 +0200 Subject: [PATCH 2/3] Adds SE_NODE_STEREOTYPE to Readme --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index b6658e2123..4caa78e2b8 100644 --- a/README.md +++ b/README.md @@ -779,6 +779,9 @@ In both cases, it is necessary to tell the Node where the Event Bus is, so it ca the purpose of the `SE_EVENT_BUS_HOST`, `SE_EVENT_BUS_PUBLISH_PORT` and `SE_EVENT_BUS_SUBSCRIBE_PORT` environment variables. +In some cases, for example if you want to tag a node, it might be necessary to supply a custom stereotype to the node config. The environement variable `SE_NODE_STEREOTYPE` +sets the stereotype entry in the node's `config.toml`. An example config.toml file can be found here: [Setting custom capabilities for matching specific Nodes](https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes). + Here is an example with the default values of these environment variables: ```bash From 000c055f4c4b516812bc36f005e663b09884295c Mon Sep 17 00:00:00 2001 From: Yannick Schmetz Date: Tue, 30 Aug 2022 16:56:07 +0200 Subject: [PATCH 3/3] Adds example with default value for SE_NODE_STEREOTYPE --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4caa78e2b8..7ec35cb606 100644 --- a/README.md +++ b/README.md @@ -783,10 +783,12 @@ In some cases, for example if you want to tag a node, it might be necessary to s sets the stereotype entry in the node's `config.toml`. An example config.toml file can be found here: [Setting custom capabilities for matching specific Nodes](https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes). Here is an example with the default values of these environment variables: - ```bash -$ docker run -d -e SE_EVENT_BUS_HOST= -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ - -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 --shm-size="2g" selenium/node-chrome:4.4.0-20220812 +$ docker run -d \ + -e SE_EVENT_BUS_HOST= \ + -e SE_EVENT_BUS_PUBLISH_PORT=4442 \ + -e SE_EVENT_BUS_SUBSCRIBE_PORT=4443 -e SE_NODE_STEREOTYPE="{\"browserName\":\"${SE_NODE_BROWSER_NAME}\",\"browserVersion\":\"${SE_NODE_BROWSER_VERSION}\",\"platformName\": \"Linux\"}" \ + --shm-size="2g" selenium/node-chrome:4.4.0-20220812 ``` ### Setting Screen Resolution