Skip to content

Commit

Permalink
[ci] Update tag 4.29.0-20250222 in docs and files
Browse files Browse the repository at this point in the history
[skip test]
  • Loading branch information
selenium-ci committed Feb 23, 2025
1 parent 88dc13e commit dc3f59d
Show file tree
Hide file tree
Showing 31 changed files with 397 additions and 350 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ body:
attributes:
label: Docker Selenium version (image tag)
description: What version of Docker Selenium are you using?
placeholder: 4.28.1-20250202? Please use the full tag, avoid "latest"
placeholder: 4.29.0-20250222? Please use the full tag, avoid "latest"
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-chrome-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
description: 'Build date in format YYYYMMDD. Must provide if reusing base image'
required: false
type: string
default: '20250202'
default: '20250222'
browser-name:
description: 'Browser name to build. E.g: chrome'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-edge-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
description: 'Build date in format YYYYMMDD. Must provide if reusing base image'
required: false
type: string
default: '20250202'
default: '20250222'
browser-name:
description: 'Browser name to build. E.g: edge'
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-firefox-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
description: 'Build date in format YYYYMMDD. Must provide if reusing base image'
required: false
type: string
default: '20250202'
default: '20250222'
browser-name:
description: 'Browser name to build. E.g: firefox'
required: true
Expand Down
12 changes: 6 additions & 6 deletions .keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The stable implementation will be merged to the upstream KEDA repository frequen
Replace the image registry and tag of these KEDA components with the patched image tag:

```bash
docker pull selenium/keda:2.16.1-selenium-grid-20250202
docker pull selenium/keda-metrics-apiserver:2.16.1-selenium-grid-20250202
docker pull selenium/keda-admission-webhooks:2.16.1-selenium-grid-20250202
docker pull selenium/keda:2.16.1-selenium-grid-20250222
docker pull selenium/keda-metrics-apiserver:2.16.1-selenium-grid-20250222
docker pull selenium/keda-admission-webhooks:2.16.1-selenium-grid-20250222
```

Besides that, you also can use image tag `latest` or `nightly`.
Expand All @@ -27,15 +27,15 @@ If you are deploying KEDA core using their official Helm [chart](https://github.
keda:
registry: selenium
repository: keda
tag: "2.16.1-selenium-grid-20250202"
tag: "2.16.1-selenium-grid-20250222"
metricsApiServer:
registry: selenium
repository: keda-metrics-apiserver
tag: "2.16.1-selenium-grid-20250202"
tag: "2.16.1-selenium-grid-20250222"
webhooks:
registry: selenium
repository: keda-admission-webhooks
tag: "2.16.1-selenium-grid-20250202"
tag: "2.16.1-selenium-grid-20250222"
```
If you are deployment Selenium Grid chart with `autoscaling.enabled` is `true` (implies installing KEDA sub-chart), KEDA images registry and tag already set in the `values.yaml`. Refer to list [configuration](../charts/selenium-grid/CONFIGURATION.md).
Expand Down
157 changes: 102 additions & 55 deletions .keda/scalers/selenium-grid-scaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ triggers:
platformName: '' # Optional.
unsafeSsl: 'false' # Optional.
activationThreshold: 0 # Optional.
nodeMaxSessions: 1 # Optional.
capabilities: '' # Optional.
```
**Parameter list:**
Expand All @@ -37,7 +39,7 @@ triggers:
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
- `platformName` - Name of the browser platform. Refer to the [Selenium Grid's](https://www.selenium.dev/documentation/en/getting_started_with_webdriver/browsers/) and [WebdriverIO's](https://webdriver.io/docs/options/#capabilities) documentation for more info. (Optional)
- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior. (Default: `1`, Optional).
- `capabilities` - Add more custom capabilities for matching specific Nodes. (Optional)
- `capabilities` - Add more custom capabilities for matching specific Nodes. It should be in JSON string, see [example](https://www.selenium.dev/documentation/grid/configuration/toml_options/#setting-custom-capabilities-for-matching-specific-nodes) (Optional)

**Trigger Authentication**
- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
Expand All @@ -47,6 +49,9 @@ triggers:

### Example

---
#### Selenium Grid scaler trigger metadata for Chrome browser with `platformNane` and empty `browserVersion`

Here is a full example of scaled object definition using Selenium Grid trigger:

```yaml
Expand Down Expand Up @@ -125,7 +130,7 @@ With above script, the request is sent to Grid. Via GraphQL response, it looks l
}
```

In Node deployment spec, there is environment variable `SE_NODE_BROWSER_VERSION` which is set to empty. This is used to unset `browserVersion` in Node stereotypes (it is in project [docker-selenium](https://github.com/SeleniumHQ/docker-selenium) setting short browser build number by default), which is expected to match with the request capabilities in queue and scaler trigger metadata.
In Node deployment spec, there is environment variable `SE_NODE_BROWSER_VERSION` which can be set to empty. This is used to unset `browserVersion` in Node stereotypes (it is in project [docker-selenium](https://github.com/SeleniumHQ/docker-selenium) setting short browser build number by default), which is expected to match with the request capabilities in queue and scaler trigger metadata.

When the request capabilities match with scaler trigger metadata, the scaler will create a new Node and connect to the Hub. Now the GraphQL response looks like

Expand Down Expand Up @@ -161,6 +166,9 @@ When the request capabilities match with scaler trigger metadata, the scaler wil

Now, the request can be picked up by the Node and the session is created. Session queue will be cleared and the scaler will not create a new Node until the next request comes in.

---
#### Selenium Grid scaler trigger metadata for Chrome browser with `browserVersion` and `platformName`

Moreover, at the same time, you can create one more scaled object for Chrome browser request with specific `browserVersion`. For example

```yaml
Expand All @@ -178,6 +186,11 @@ spec:
image: selenium/node-chrome:131.0
ports:
- containerPort: 5555
env:
- name: SE_NODE_BROWSER_VERSION
value: '131.0'
- name: SE_NODE_PLATFORM_NAME
value: 'Linux'
---
Expand Down Expand Up @@ -211,6 +224,9 @@ options.set_capability('browserVersion', '131.0')
driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL)
```

---
#### Selenium Grid scaler trigger metadata with extra `capabilities`

For an advanced use case, you also can set custom capabilities for matching specific Nodes in the scaler trigger metadata. For example

```yaml
Expand All @@ -227,15 +243,15 @@ spec:
- name: selenium-node-chrome
image: selenium/node-chrome:132.0
ports:
- containerPort: 5555
- containerPort: 5555
env:
- name: SE_NODE_BROWSER_VERSION
value: '132.0'
- name: SE_NODE_PLATFORM_NAME
value: 'Linux'
# Append custom capabilities to Node stereotype. See: https://github.com/SeleniumHQ/docker-selenium?tab=readme-ov-file#node-configuration-options
- name: SE_NODE_STEREOTYPE_EXTRA
value: "{\"myApp:version\":\"beta\", \"myApp:publish:\":\"public\"}"
- name: SE_NODE_BROWSER_VERSION
value: '132.0'
- name: SE_NODE_PLATFORM_NAME
value: 'Linux'
# Append custom capabilities to Node stereotype. See: https://github.com/SeleniumHQ/docker-selenium?tab=readme-ov-file#node-configuration-options
- name: SE_NODE_STEREOTYPE_EXTRA
value: "{\"myApp:version\":\"beta\", \"myApp:publish:\":\"public\"}"
---
Expand Down Expand Up @@ -274,9 +290,32 @@ options.set_capability('myApp:publish', 'public')
driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL)
```

Similarly, for Firefox
---
#### Selenium Grid scaler trigger metadata for Firefox browser

```yaml
kind: Deployment
metadata:
name: selenium-node-firefox
labels:
deploymentName: selenium-node-firefox
spec:
replicas: 1
template:
spec:
containers:
- name: selenium-node-firefox
image: selenium/node-firefox:latest
ports:
- containerPort: 5555
env:
- name: SE_NODE_BROWSER_VERSION
value: ''
- name: SE_NODE_PLATFORM_NAME
value: 'Linux'
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
Expand Down Expand Up @@ -305,9 +344,34 @@ options.set_capability('platformName', 'Linux')
driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL)
```

---
#### Selenium Grid scaler trigger metadata for Edge browser

Similarly, for Edge. Note that for Edge you must set the `sessionBrowserName` to `msedge` inorder for scaling to work properly.

```yaml
kind: Deployment
metadata:
name: selenium-node-edge
labels:
deploymentName: selenium-node-edge
spec:
replicas: 1
template:
spec:
containers:
- name: selenium-node-edge
image: selenium/node-edge:latest
ports:
- containerPort: 5555
env:
- name: SE_NODE_BROWSER_VERSION
value: ''
- name: SE_NODE_PLATFORM_NAME
value: 'Linux'
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
Expand Down Expand Up @@ -337,73 +401,56 @@ options.set_capability('platformName', 'Linux')
driver = webdriver.Remote(options=options, command_executor=SELENIUM_GRID_URL)
```

---
#### Selenium Grid scaler trigger metadata for Chrome browser with `nodeMaxSessions`

In case you want to scale from 0 (`minReplicaCount: 0`), and browser nodes are configured different `--max-sessions` greater than 1, you can set `nodeMaxSessions` for scaler align with number of slots available per node to have the correct scaling behavior.

```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
kind: Deployment
metadata:
name: selenium-grid-chrome-scaledobject
namespace: keda
name: selenium-node-chrome
labels:
deploymentName: selenium-node-chrome
spec:
maxReplicaCount: 8
scaleTargetRef:
name: selenium-node-chrome
triggers:
- type: selenium-grid
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
nodeMaxSessions: 4
unsafeSsl: 'true'
```

If you are supporting multiple versions of browser capability in your Selenium Grid, You should create one scaler for every browser version and pass the `browserVersion` in the metadata.
replicas: 1
template:
spec:
containers:
- name: selenium-node-chrome
image: selenium/node-chrome:latest
ports:
- containerPort: 5555
env:
- name: SE_NODE_BROWSER_VERSION
value: ''
- name: SE_NODE_PLATFORM_NAME
value: 'Linux'
- name: SE_NODE_OVERRIDE_MAX_SESSIONS
value: 'true'
- name: SE_NODE_MAX_SESSIONS
value: '4'
```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: selenium-grid-chrome-91-scaledobject
namespace: keda
labels:
deploymentName: selenium-node-chrome-91
spec:
maxReplicaCount: 8
scaleTargetRef:
name: selenium-node-chrome-91
triggers:
- type: selenium-grid
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
browserVersion: '91.0'
unsafeSsl: 'true'
```
---
```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: selenium-grid-chrome-90-scaledobject
name: selenium-grid-chrome-scaledobject
namespace: keda
labels:
deploymentName: selenium-node-chrome-90
deploymentName: selenium-node-chrome
spec:
maxReplicaCount: 8
scaleTargetRef:
name: selenium-node-chrome-90
name: selenium-node-chrome
triggers:
- type: selenium-grid
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
platformName: 'Linux'
browserVersion: '90.0'
nodeMaxSessions: 4
unsafeSsl: 'true'
```

Expand Down
8 changes: 4 additions & 4 deletions NodeDocker/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
# start a container with the given image.
configs = [
"selenium/standalone-firefox:4.28.1-20250202", '{"browserName": "firefox", "platformName": "linux"}',
"selenium/standalone-chrome:4.28.1-20250202", '{"browserName": "chrome", "platformName": "linux"}',
"selenium/standalone-edge:4.28.1-20250202", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
"selenium/standalone-firefox:4.29.0-20250222", '{"browserName": "firefox", "platformName": "linux"}',
"selenium/standalone-chrome:4.29.0-20250222", '{"browserName": "chrome", "platformName": "linux"}',
"selenium/standalone-edge:4.29.0-20250222", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
]

# URL for connecting to the docker daemon
Expand All @@ -14,7 +14,7 @@ configs = [
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
url = "http://127.0.0.1:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-7.1-20250202"
video-image = "selenium/video:ffmpeg-7.1-20250222"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
Expand Down
Loading

0 comments on commit dc3f59d

Please sign in to comment.