Skip to content

Commit c5e10a7

Browse files
committed
Update tag 4.27.0-20241127 in docs and files
1 parent 4e20283 commit c5e10a7

28 files changed

+239
-231
lines changed

Diff for: .github/ISSUE_TEMPLATE/bug_report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ body:
5656
attributes:
5757
label: Docker Selenium version (image tag)
5858
description: What version of Docker Selenium are you using?
59-
placeholder: 4.26.0-20241101? Please use the full tag, avoid "latest"
59+
placeholder: 4.27.0-20241127? Please use the full tag, avoid "latest"
6060
validations:
6161
required: true
6262
- type: input

Diff for: .keda/README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ The stable implementation will be merged to the upstream KEDA repository frequen
1313
Replace the image registry and tag of these KEDA components with the patched image tag:
1414

1515
```bash
16-
docker pull selenium/keda:2.15.1-selenium-grid-20241101
17-
docker pull selenium/keda-metrics-apiserver:2.15.1-selenium-grid-20241101
18-
docker pull selenium/keda-admission-webhooks:2.15.1-selenium-grid-20241101
16+
docker pull selenium/keda:2.16.0-selenium-grid-20241127
17+
docker pull selenium/keda-metrics-apiserver:2.16.0-selenium-grid-20241127
18+
docker pull selenium/keda-admission-webhooks:2.16.0-selenium-grid-20241127
1919
```
2020

2121
Besides that, you also can use image tag `latest` or `nightly`.
@@ -27,15 +27,15 @@ If you are deploying KEDA core using their official Helm [chart](https://github.
2727
keda:
2828
registry: selenium
2929
repository: keda
30-
tag: "2.15.1-selenium-grid-20241101"
30+
tag: "2.16.0-selenium-grid-20241127"
3131
metricsApiServer:
3232
registry: selenium
3333
repository: keda-metrics-apiserver
34-
tag: "2.15.1-selenium-grid-20241101"
34+
tag: "2.16.0-selenium-grid-20241127"
3535
webhooks:
3636
registry: selenium
3737
repository: keda-admission-webhooks
38-
tag: "2.15.1-selenium-grid-20241101"
38+
tag: "2.16.0-selenium-grid-20241127"
3939
```
4040
4141
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).

Diff for: .keda/scalers/selenium-grid-scaler.md

+24-19
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,25 @@ triggers:
2929
3030
**Parameter list:**
3131
32-
- `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.
33-
- `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.
32+
- `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. If endpoint requires authentication, you can use `TriggerAuthentication` to provide the credentials instead of embedding in the URL.
33+
- `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.
3434
- `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)
3535
- `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)
3636
- `unsafeSsl` - Skip certificate validation when connecting over HTTPS. (Values: `true`, `false`, Default: `false`, Optional)
3737
- `activationThreshold` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional)
3838
- `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)
39-
- `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.
39+
- `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).
40+
- `targetQueueLength` - The target number of queued sessions to scale on. (Default: `1`, Optional).
4041

4142
**Trigger Authentication**
4243
- `username` - Username for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
4344
- `password` - Password for basic authentication in GraphQL endpoint instead of embedding in the URL. (Optional)
44-
- `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.
45-
- `accessToken` - Access token (Optional). This is required when `authType` is set a value.
45+
- `authType` - Type of authentication to be used. This can be set to `Bearer` or `OAuth2` in case Selenium Grid behind an Ingress proxy with other authentication types. (Optional)
46+
- `accessToken` - Access token. This is required when `authType` is set a value. (Optional)
47+
48+
### How does it work?
49+
50+
The scaler will query the Hub GraphQL response to get the number of queued sessions in the specified combination of browser name, version, and platform. If the number of queued sessions is **equal to or greater than** the `targetQueueLength`, the scaler will scale up.
4651

4752
### Example
4853

@@ -55,11 +60,11 @@ metadata:
5560
name: selenium-grid-chrome-scaledobject
5661
namespace: keda
5762
labels:
58-
deploymentName: selenium-node-chrome
63+
deploymentName: selenium-chrome-node
5964
spec:
6065
maxReplicaCount: 8
6166
scaleTargetRef:
62-
name: selenium-node-chrome
67+
name: selenium-chrome-node
6368
triggers:
6469
- type: selenium-grid
6570
metadata:
@@ -78,11 +83,11 @@ metadata:
7883
name: selenium-grid-firefox-scaledobject
7984
namespace: keda
8085
labels:
81-
deploymentName: selenium-node-firefox
86+
deploymentName: selenium-firefox-node
8287
spec:
8388
maxReplicaCount: 8
8489
scaleTargetRef:
85-
name: selenium-node-firefox
90+
name: selenium-firefox-node
8691
triggers:
8792
- type: selenium-grid
8893
metadata:
@@ -99,11 +104,11 @@ metadata:
99104
name: selenium-grid-edge-scaledobject
100105
namespace: keda
101106
labels:
102-
deploymentName: selenium-node-edge
107+
deploymentName: selenium-edge-node
103108
spec:
104109
maxReplicaCount: 8
105110
scaleTargetRef:
106-
name: selenium-node-edge
111+
name: selenium-edge-node
107112
triggers:
108113
- type: selenium-grid
109114
metadata:
@@ -121,11 +126,11 @@ metadata:
121126
name: selenium-grid-chrome-scaledobject
122127
namespace: keda
123128
labels:
124-
deploymentName: selenium-node-chrome
129+
deploymentName: selenium-chrome-node
125130
spec:
126131
maxReplicaCount: 8
127132
scaleTargetRef:
128-
name: selenium-node-chrome
133+
name: selenium-chrome-node
129134
triggers:
130135
- type: selenium-grid
131136
metadata:
@@ -143,11 +148,11 @@ metadata:
143148
name: selenium-grid-chrome-91-scaledobject
144149
namespace: keda
145150
labels:
146-
deploymentName: selenium-node-chrome-91
151+
deploymentName: selenium-chrome-node-91
147152
spec:
148153
maxReplicaCount: 8
149154
scaleTargetRef:
150-
name: selenium-node-chrome-91
155+
name: selenium-chrome-node-91
151156
triggers:
152157
- type: selenium-grid
153158
metadata:
@@ -163,11 +168,11 @@ metadata:
163168
name: selenium-grid-chrome-90-scaledobject
164169
namespace: keda
165170
labels:
166-
deploymentName: selenium-node-chrome-90
171+
deploymentName: selenium-chrome-node-90
167172
spec:
168173
maxReplicaCount: 8
169174
scaleTargetRef:
170-
name: selenium-node-chrome-90
175+
name: selenium-chrome-node-90
171176
triggers:
172177
- type: selenium-grid
173178
metadata:
@@ -219,11 +224,11 @@ metadata:
219224
name: selenium-grid-chrome-scaledobject
220225
namespace: keda
221226
labels:
222-
deploymentName: selenium-node-chrome
227+
deploymentName: selenium-chrome-node
223228
spec:
224229
maxReplicaCount: 8
225230
scaleTargetRef:
226-
name: selenium-node-chrome
231+
name: selenium-chrome-node
227232
triggers:
228233
- type: selenium-grid
229234
metadata:

Diff for: .keda/scalers/selenium_grid_scaler.go

+19-16
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,11 @@ type seleniumGridScalerMetadata struct {
3636
BrowserName string `keda:"name=browserName, order=triggerMetadata"`
3737
SessionBrowserName string `keda:"name=sessionBrowserName, order=triggerMetadata, optional"`
3838
ActivationThreshold int64 `keda:"name=activationThreshold, order=triggerMetadata, optional"`
39-
BrowserVersion string `keda:"name=browserVersion, order=triggerMetadata, optional, default=latest"`
40-
UnsafeSsl bool `keda:"name=unsafeSsl, order=triggerMetadata, optional, default=false"`
41-
PlatformName string `keda:"name=platformName, order=triggerMetadata, optional, default=linux"`
42-
NodeMaxSessions int `keda:"name=nodeMaxSessions, order=triggerMetadata, optional, default=1"`
43-
44-
TargetValue int64
39+
BrowserVersion string `keda:"name=browserVersion, order=triggerMetadata, default=latest"`
40+
UnsafeSsl bool `keda:"name=unsafeSsl, order=triggerMetadata, default=false"`
41+
PlatformName string `keda:"name=platformName, order=triggerMetadata, default=linux"`
42+
NodeMaxSessions int `keda:"name=nodeMaxSessions, order=triggerMetadata, default=1"`
43+
TargetQueueLength int64 `keda:"name=targetQueueLength, order=triggerMetadata;resolvedEnv, default=1"`
4544
}
4645

4746
type SeleniumResponse struct {
@@ -107,7 +106,8 @@ type Stereotypes []struct {
107106
}
108107

109108
const (
110-
DefaultBrowserVersion string = "latest"
109+
DefaultBrowserVersion string = "latest"
110+
DefaultTargetQueueLength int64 = 1
111111
)
112112

113113
func NewSeleniumGridScaler(config *scalersconfig.ScalerConfig) (Scaler, error) {
@@ -135,9 +135,7 @@ func NewSeleniumGridScaler(config *scalersconfig.ScalerConfig) (Scaler, error) {
135135
}
136136

137137
func parseSeleniumGridScalerMetadata(config *scalersconfig.ScalerConfig) (*seleniumGridScalerMetadata, error) {
138-
meta := &seleniumGridScalerMetadata{
139-
TargetValue: 1,
140-
}
138+
meta := &seleniumGridScalerMetadata{}
141139

142140
if err := config.TypedConfig(meta); err != nil {
143141
return nil, fmt.Errorf("error parsing prometheus metadata: %w", err)
@@ -148,6 +146,10 @@ func parseSeleniumGridScalerMetadata(config *scalersconfig.ScalerConfig) (*selen
148146
if meta.SessionBrowserName == "" {
149147
meta.SessionBrowserName = meta.BrowserName
150148
}
149+
150+
if meta.TargetQueueLength < 1 {
151+
meta.TargetQueueLength = DefaultTargetQueueLength
152+
}
151153
return meta, nil
152154
}
153155

@@ -160,31 +162,32 @@ func (s *seleniumGridScaler) Close(context.Context) error {
160162
}
161163

162164
func (s *seleniumGridScaler) GetMetricsAndActivity(ctx context.Context, metricName string) ([]external_metrics.ExternalMetricValue, bool, error) {
163-
sessions, err := s.getSessionsCount(ctx, s.logger)
165+
queueLen, err := s.getSessionsQueueLength(ctx, s.logger)
164166
if err != nil {
165167
return []external_metrics.ExternalMetricValue{}, false, fmt.Errorf("error requesting selenium grid endpoint: %w", err)
166168
}
167169

168-
metric := GenerateMetricInMili(metricName, float64(sessions))
170+
metric := GenerateMetricInMili(metricName, float64(queueLen))
169171

170-
return []external_metrics.ExternalMetricValue{metric}, sessions > s.metadata.ActivationThreshold, nil
172+
// If the number of sessions queued is equal to or greater than the targetQueueLength, the scaler will scale up.
173+
return []external_metrics.ExternalMetricValue{metric}, queueLen >= s.metadata.TargetQueueLength, nil
171174
}
172175

173176
func (s *seleniumGridScaler) GetMetricSpecForScaling(context.Context) []v2.MetricSpec {
174-
metricName := kedautil.NormalizeString(fmt.Sprintf("seleniumgrid-%s", s.metadata.BrowserName))
177+
metricName := kedautil.NormalizeString(fmt.Sprintf("selenium-grid-%s-%s-%s", s.metadata.BrowserName, s.metadata.BrowserVersion, s.metadata.PlatformName))
175178
externalMetric := &v2.ExternalMetricSource{
176179
Metric: v2.MetricIdentifier{
177180
Name: GenerateMetricNameWithIndex(s.metadata.triggerIndex, metricName),
178181
},
179-
Target: GetMetricTarget(s.metricType, s.metadata.TargetValue),
182+
Target: GetMetricTarget(s.metricType, s.metadata.TargetQueueLength),
180183
}
181184
metricSpec := v2.MetricSpec{
182185
External: externalMetric, Type: externalMetricType,
183186
}
184187
return []v2.MetricSpec{metricSpec}
185188
}
186189

187-
func (s *seleniumGridScaler) getSessionsCount(ctx context.Context, logger logr.Logger) (int64, error) {
190+
func (s *seleniumGridScaler) getSessionsQueueLength(ctx context.Context, logger logr.Logger) (int64, error) {
188191
body, err := json.Marshal(map[string]string{
189192
"query": "{ grid { sessionCount, maxSession, totalSlots }, nodesInfo { nodes { id, status, sessionCount, maxSession, slotCount, stereotypes, sessions { id, capabilities, slot { id, stereotype } } } }, sessionsInfo { sessionQueueRequests } }",
190193
})

Diff for: .keda/scalers/selenium_grid_scaler_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
17501750
URL: "http://selenium-hub:4444/graphql",
17511751
BrowserName: "chrome",
17521752
SessionBrowserName: "chrome",
1753-
TargetValue: 1,
1753+
TargetQueueLength: 1,
17541754
BrowserVersion: "latest",
17551755
PlatformName: "linux",
17561756
NodeMaxSessions: 1,
@@ -1772,7 +1772,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
17721772
URL: "http://selenium-hub:4444/graphql",
17731773
BrowserName: "MicrosoftEdge",
17741774
SessionBrowserName: "msedge",
1775-
TargetValue: 1,
1775+
TargetQueueLength: 1,
17761776
BrowserVersion: "latest",
17771777
PlatformName: "linux",
17781778
NodeMaxSessions: 1,
@@ -1800,7 +1800,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
18001800
Password: "password",
18011801
BrowserName: "MicrosoftEdge",
18021802
SessionBrowserName: "msedge",
1803-
TargetValue: 1,
1803+
TargetQueueLength: 1,
18041804
BrowserVersion: "latest",
18051805
PlatformName: "linux",
18061806
NodeMaxSessions: 1,
@@ -1826,7 +1826,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
18261826
URL: "http://selenium-hub:4444/graphql",
18271827
BrowserName: "MicrosoftEdge",
18281828
SessionBrowserName: "msedge",
1829-
TargetValue: 1,
1829+
TargetQueueLength: 1,
18301830
BrowserVersion: "latest",
18311831
PlatformName: "linux",
18321832
Username: "username",
@@ -1851,7 +1851,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
18511851
URL: "http://selenium-hub:4444/graphql",
18521852
BrowserName: "chrome",
18531853
SessionBrowserName: "chrome",
1854-
TargetValue: 1,
1854+
TargetQueueLength: 1,
18551855
BrowserVersion: "91.0",
18561856
UnsafeSsl: false,
18571857
PlatformName: "linux",
@@ -1876,7 +1876,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
18761876
URL: "http://selenium-hub:4444/graphql",
18771877
BrowserName: "chrome",
18781878
SessionBrowserName: "chrome",
1879-
TargetValue: 1,
1879+
TargetQueueLength: 1,
18801880
ActivationThreshold: 10,
18811881
BrowserVersion: "91.0",
18821882
UnsafeSsl: true,
@@ -1917,7 +1917,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
19171917
URL: "http://selenium-hub:4444/graphql",
19181918
BrowserName: "chrome",
19191919
SessionBrowserName: "chrome",
1920-
TargetValue: 1,
1920+
TargetQueueLength: 1,
19211921
ActivationThreshold: 10,
19221922
BrowserVersion: "91.0",
19231923
UnsafeSsl: true,
@@ -1944,7 +1944,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
19441944
URL: "http://selenium-hub:4444/graphql",
19451945
BrowserName: "chrome",
19461946
SessionBrowserName: "chrome",
1947-
TargetValue: 1,
1947+
TargetQueueLength: 1,
19481948
ActivationThreshold: 10,
19491949
BrowserVersion: "91.0",
19501950
UnsafeSsl: true,
@@ -1978,7 +1978,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
19781978
Password: "password",
19791979
BrowserName: "chrome",
19801980
SessionBrowserName: "chrome",
1981-
TargetValue: 1,
1981+
TargetQueueLength: 1,
19821982
ActivationThreshold: 10,
19831983
BrowserVersion: "91.0",
19841984
UnsafeSsl: true,
@@ -2013,7 +2013,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
20132013
Password: "password",
20142014
BrowserName: "chrome",
20152015
SessionBrowserName: "chrome",
2016-
TargetValue: 1,
2016+
TargetQueueLength: 1,
20172017
ActivationThreshold: 10,
20182018
BrowserVersion: "91.0",
20192019
UnsafeSsl: true,
@@ -2048,7 +2048,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
20482048
AccessToken: "my-access-token",
20492049
BrowserName: "chrome",
20502050
SessionBrowserName: "chrome",
2051-
TargetValue: 1,
2051+
TargetQueueLength: 1,
20522052
ActivationThreshold: 10,
20532053
BrowserVersion: "91.0",
20542054
UnsafeSsl: true,
@@ -2082,7 +2082,7 @@ func Test_parseSeleniumGridScalerMetadata(t *testing.T) {
20822082
AccessToken: "my-access-token",
20832083
BrowserName: "chrome",
20842084
SessionBrowserName: "chrome",
2085-
TargetValue: 1,
2085+
TargetQueueLength: 1,
20862086
ActivationThreshold: 10,
20872087
BrowserVersion: "91.0",
20882088
UnsafeSsl: true,

Diff for: Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PLATFORMS := $(or $(PLATFORMS),$(shell echo $$PLATFORMS),$(CURRENT_PLATFORM))
2626
SEL_PASSWD := $(or $(SEL_PASSWD),$(SEL_PASSWD),secret)
2727
CHROMIUM_VERSION := $(or $(CHROMIUM_VERSION),$(CHROMIUM_VERSION),latest)
2828
SBOM_OUTPUT := $(or $(SBOM_OUTPUT),$(SBOM_OUTPUT),package_versions.txt)
29-
KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION),2.15.1-selenium-grid)
29+
KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION),2.16.0-selenium-grid)
3030
KEDA_TAG_VERSION := $(or $(KEDA_TAG_VERSION),$(KEDA_TAG_VERSION),2.16.0-selenium-grid)
3131
KEDA_BASED_NAME := $(or $(KEDA_BASED_NAME),$(KEDA_BASED_NAME),ndviet)
3232
KEDA_BASED_TAG := $(or $(KEDA_BASED_TAG),$(KEDA_BASED_TAG),2.16.0-selenium-grid-20241127)

Diff for: NodeDocker/config.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Configs have a mapping between the Docker image to use and the capabilities that need to be matched to
33
# start a container with the given image.
44
configs = [
5-
"selenium/standalone-firefox:4.26.0-20241101", '{"browserName": "firefox", "platformName": "linux"}',
6-
"selenium/standalone-chrome:4.26.0-20241101", '{"browserName": "chrome", "platformName": "linux"}',
7-
"selenium/standalone-edge:4.26.0-20241101", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
5+
"selenium/standalone-firefox:4.27.0-20241127", '{"browserName": "firefox", "platformName": "linux"}',
6+
"selenium/standalone-chrome:4.27.0-20241127", '{"browserName": "chrome", "platformName": "linux"}',
7+
"selenium/standalone-edge:4.27.0-20241127", '{"browserName": "MicrosoftEdge", "platformName": "linux"}'
88
]
99

1010
# URL for connecting to the docker daemon
@@ -14,7 +14,7 @@ configs = [
1414
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
1515
url = "http://127.0.0.1:2375"
1616
# Docker image used for video recording
17-
video-image = "selenium/video:ffmpeg-7.1-20241101"
17+
video-image = "selenium/video:ffmpeg-7.1-20241127"
1818

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

0 commit comments

Comments
 (0)