Skip to content

Commit

Permalink
Update tag 4.25.0-20241024 in docs and files
Browse files Browse the repository at this point in the history
  • Loading branch information
selenium-ci committed Oct 24, 2024
1 parent 7491764 commit 653af3e
Show file tree
Hide file tree
Showing 27 changed files with 378 additions and 188 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.25.0-20241010? Please use the full tag, avoid "latest"
placeholder: 4.25.0-20241024? Please use the full tag, avoid "latest"
validations:
required: true
- type: input
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.15.1-selenium-grid-20241010
docker pull selenium/keda-metrics-apiserver:2.15.1-selenium-grid-20241010
docker pull selenium/keda-admission-webhooks:2.15.1-selenium-grid-20241010
docker pull selenium/keda:2.15.1-selenium-grid-20241024
docker pull selenium/keda-metrics-apiserver:2.15.1-selenium-grid-20241024
docker pull selenium/keda-admission-webhooks:2.15.1-selenium-grid-20241024
```

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.15.1-selenium-grid-20241010"
tag: "2.15.1-selenium-grid-20241024"
metricsApiServer:
registry: selenium
repository: keda-metrics-apiserver
tag: "2.15.1-selenium-grid-20241010"
tag: "2.15.1-selenium-grid-20241024"
webhooks:
registry: selenium
repository: keda-admission-webhooks
tag: "2.15.1-selenium-grid-20241010"
tag: "2.15.1-selenium-grid-20241024"
```
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
34 changes: 30 additions & 4 deletions .keda/scalers/selenium-grid-scaler.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,21 @@ triggers:
**Parameter list:**
- `url` - Graphql url of your Selenium Grid. Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info.
- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
- `password` - Password for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
- `browserName` - Name of browser that usually gets passed in the browser capability. 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.
- `url` - Graphql url of your Selenium Grid (Required). Refer to the Selenium Grid's documentation [here](https://www.selenium.dev/documentation/en/grid/grid_4/graphql_support/) to for more info. If endpoint requires authentication, you can use `TriggerAuthentication` to provide the credentials instead of embedding in the URL.
- `browserName` - Name of browser that usually gets passed in the browser capability (Required). 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.
- `sessionBrowserName` - Name of the browser when it is an active session, only set if `BrowserName` changes between the queue and the active session. See the Edge example below for further detail. (Optional)
- `browserVersion` - Version of browser that usually gets passed in the browser capability. 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)
- `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional)
- `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. (Default: `Linux`, Optional)
- `nodeMaxSessions` - Number of maximum sessions that can run in parallel on a Node. (Default: `1`, Optional). Update this parameter align with node config `--max-sessions` (`SE_NODE_MAX_SESSIONS`) to have the correct scaling behavior.

**Trigger Authentication**
- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
- `password` - Password for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
- `authType` - Type of authentication to be used. (Optional). This can be set to `Bearer` or `OAuth2` in case Selenium Grid behind an Ingress proxy with other authentication types.
- `accessToken` - Access token (Optional). This is required when `authType` is set a value.

### Example

Here is a full example of scaled object definition using Selenium Grid trigger:
Expand Down Expand Up @@ -108,6 +112,28 @@ spec:
sessionBrowserName: 'msedge'
```

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
metadata:
name: selenium-grid-chrome-scaledobject
namespace: keda
labels:
deploymentName: selenium-chrome-node
spec:
maxReplicaCount: 8
scaleTargetRef:
name: selenium-chrome-node
triggers:
- type: selenium-grid
metadata:
url: 'http://selenium-hub:4444/graphql'
browserName: 'chrome'
nodeMaxSessions: 4
```

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.

```yaml
Expand Down
164 changes: 164 additions & 0 deletions .keda/scalers/selenium_grid_scaler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1526,6 +1526,170 @@ func Test_getCountFromSeleniumResponse(t *testing.T) {
want: 2,
wantErr: false,
},
// Tests from PR: https://github.com/kedacore/keda/pull/6055
{
name: "sessions requests with matching browsername and platformName when setSessionsFromHub turned on and node with 1 slots matches should return count as 0",
args: args{
b: []byte(`{
"data": {
"grid": {
"sessionCount": 0,
"maxSession": 1,
"totalSlots": 1
},
"nodesInfo": {
"nodes": [
{
"id": "82ee33bd-390e-4dd6-aee2-06b17ecee18e",
"status": "UP",
"sessionCount": 0,
"maxSession": 1,
"slotCount": 1,
"stereotypes":"[{\"slots\":1,\"stereotype\":{\"browserName\":\"chrome\",\"platformName\":\"linux\"}}]",
"sessions": []
}
]
},
"sessionsInfo": {
"sessionQueueRequests": [
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\"\n}"
]
}
}
}`),
browserName: "chrome",
sessionBrowserName: "chrome",
browserVersion: "latest",
platformName: "linux",
},
want: 0,
wantErr: false,
},
{
name: "4 sessions requests with matching browsername and platformName when setSessionsFromHub turned on and node with 2 slots matches should return count as 2",
args: args{
b: []byte(`{
"data": {
"grid": {
"sessionCount": 0,
"maxSession": 2,
"totalSlots": 2
},
"nodesInfo": {
"nodes": [
{
"id": "82ee33bd-390e-4dd6-aee2-06b17ecee18e",
"status": "UP",
"sessionCount": 0,
"maxSession": 2,
"slotCount": 2,
"stereotypes":"[{\"slots\":2,\"stereotype\":{\"browserName\":\"chrome\",\"platformName\":\"linux\"}}]",
"sessions": [
]
}
]
},
"sessionsInfo": {
"sessionQueueRequests": [
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\"\n}"]
}
}
}`),
browserName: "chrome",
sessionBrowserName: "chrome",
browserVersion: "latest",
platformName: "linux",
},
want: 2,
wantErr: false,
},
{
name: "4 sessions requests with matching browsername and platformName when setSessionsFromHub turned on, no nodes and sessionsPerNode=2 matches should return count as 2",
args: args{
b: []byte(`{
"data": {
"grid": {
"sessionCount": 0,
"maxSession": 0,
"totalSlots": 0
},
"nodesInfo": {
"nodes": []
},
"sessionsInfo": {
"sessionQueueRequests": [
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\"\n}"]
}
}
}`),
browserName: "chrome",
sessionBrowserName: "chrome",
browserVersion: "latest",
platformName: "linux",
nodeMaxSessions: 2,
},
want: 2,
wantErr: false,
},
{
name: "sessions requests and active sessions with 1 matching browsername, platformName and sessionBrowserVersion should return count as 1",
args: args{
b: []byte(`{
"data": {
"grid": {
"sessionCount": 2,
"maxSession": 2,
"totalSlots": 2
},
"nodesInfo": {
"nodes": [
{
"id": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c",
"status": "UP",
"sessionCount": 2,
"maxSession": 2,
"slotCount": 2,
"stereotypes":"[{\"slots\":2,\"stereotype\":{\"browserName\":\"chrome\",\"platformName\":\"linux\"}}]",
"sessions": [
{
"id": "0f9c5a941aa4d755a54b84be1f6535b1",
"capabilities": "{\n \"acceptInsecureCerts\": false,\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0.4472.114\",\n \"chrome\": {\n \"chromedriverVersion\": \"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs\\u002fbranch-heads\\u002f4472@{#1462})\",\n \"userDataDir\": \"\\u002ftmp\\u002f.com.google.Chrome.DMqx9m\"\n },\n \"goog:chromeOptions\": {\n \"debuggerAddress\": \"localhost:35839\"\n },\n \"networkConnectionEnabled\": false,\n \"pageLoadStrategy\": \"normal\",\n \"platformName\": \"linux\",\n \"proxy\": {\n },\n \"se:cdp\": \"http:\\u002f\\u002flocalhost:35839\",\n \"se:cdpVersion\": \"91.0.4472.114\",\n \"se:vncEnabled\": true,\n \"se:vncLocalAddress\": \"ws:\\u002f\\u002flocalhost:7900\\u002fwebsockify\",\n \"setWindowRect\": true,\n \"strictFileInteractability\": false,\n \"timeouts\": {\n \"implicit\": 0,\n \"pageLoad\": 300000,\n \"script\": 30000\n },\n \"unhandledPromptBehavior\": \"dismiss and notify\",\n \"webauthn:extension:largeBlob\": true,\n \"webauthn:virtualAuthenticators\": true\n}",
"nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c"
},
{
"id": "0f9c5a941aa4d755a54b84be1f6535b1",
"capabilities": "{\n \"acceptInsecureCerts\": false,\n \"browserName\": \"chrome\",\n \"browserVersion\": \"91.0.4472.114\",\n \"chrome\": {\n \"chromedriverVersion\": \"91.0.4472.101 (af52a90bf87030dd1523486a1cd3ae25c5d76c9b-refs\\u002fbranch-heads\\u002f4472@{#1462})\",\n \"userDataDir\": \"\\u002ftmp\\u002f.com.google.Chrome.DMqx9m\"\n },\n \"goog:chromeOptions\": {\n \"debuggerAddress\": \"localhost:35839\"\n },\n \"networkConnectionEnabled\": false,\n \"pageLoadStrategy\": \"normal\",\n \"platformName\": \"linux\",\n \"proxy\": {\n },\n \"se:cdp\": \"http:\\u002f\\u002flocalhost:35839\",\n \"se:cdpVersion\": \"91.0.4472.114\",\n \"se:vncEnabled\": true,\n \"se:vncLocalAddress\": \"ws:\\u002f\\u002flocalhost:7900\\u002fwebsockify\",\n \"setWindowRect\": true,\n \"strictFileInteractability\": false,\n \"timeouts\": {\n \"implicit\": 0,\n \"pageLoad\": 300000,\n \"script\": 30000\n },\n \"unhandledPromptBehavior\": \"dismiss and notify\",\n \"webauthn:extension:largeBlob\": true,\n \"webauthn:virtualAuthenticators\": true\n}",
"nodeId": "d44dcbc5-0b2c-4d5e-abf4-6f6aa5e0983c"
}
]
}
]
},
"sessionsInfo": {
"sessionQueueRequests": [
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"linux\"\n}",
"{\n \"browserName\": \"chrome\",\n \"platformName\": \"Windows 11\",\n \"browserVersion\": \"91.0\"\n}"
]
}
}
}`),
browserName: "chrome",
sessionBrowserName: "chrome",
browserVersion: "91.0.4472.114",
platformName: "linux",
},
want: 1,
wantErr: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BUILD_ARGS := $(BUILD_ARGS) --progress plain
MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION)))
MINOR := $(word 2,$(subst ., ,$(TAG_VERSION)))
MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(TAG_VERSION)))
FFMPEG_TAG_PREV_VERSION := $(or $(FFMPEG_TAG_PREV_VERSION),$(FFMPEG_TAG_PREV_VERSION),ffmpeg-7.0.2)
FFMPEG_TAG_PREV_VERSION := $(or $(FFMPEG_TAG_PREV_VERSION),$(FFMPEG_TAG_PREV_VERSION),ffmpeg-7.1)
FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-7.1)
FFMPEG_BASED_NAME := $(or $(FFMPEG_BASED_NAME),$(FFMPEG_BASED_NAME),linuxserver)
FFMPEG_BASED_TAG := $(or $(FFMPEG_BASED_TAG),$(FFMPEG_BASED_TAG),version-7.1-cli)
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.25.0-20241010", '{"browserName": "firefox", "platformName": "linux"}',
"selenium/standalone-chrome:4.25.0-20241010", '{"browserName": "chrome", "platformName": "linux"}',
"selenium/standalone-edge:4.25.0-20241010", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
"selenium/standalone-firefox:4.25.0-20241024", '{"browserName": "firefox", "platformName": "linux"}',
"selenium/standalone-chrome:4.25.0-20241024", '{"browserName": "chrome", "platformName": "linux"}',
"selenium/standalone-edge:4.25.0-20241024", '{"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.0.2-20241010"
video-image = "selenium/video:ffmpeg-7.1-20241024"

# 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 653af3e

Please sign in to comment.