From 0b661a38c78d8f48a1c2a849cf8545cd36208c8b Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Fri, 1 Aug 2025 15:31:53 +0700 Subject: [PATCH] Docker: Use GreedySlotSelector in Hub and Standalone --- Base/Dockerfile | 1 + ENV_VARIABLES.md | 2 +- charts/selenium-grid/CONFIGURATION.md | 1 + charts/selenium-grid/values.yaml | 2 ++ scripts/generate_list_env_vars/description.yaml | 3 ++- scripts/generate_list_env_vars/value.yaml | 2 +- 6 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Base/Dockerfile b/Base/Dockerfile index 6251b7482..caf9259ef 100644 --- a/Base/Dockerfile +++ b/Base/Dockerfile @@ -203,6 +203,7 @@ ENV SE_BIND_HOST="false" \ SE_SERVER_PROTOCOL="http" \ # Boolean value, maps "--reject-unsupported-caps" SE_REJECT_UNSUPPORTED_CAPS="false" \ + SE_DISTRIBUTOR_SLOT_SELECTOR="org.openqa.selenium.grid.distributor.selector.GreedySlotSelector" \ SE_OTEL_JAVA_GLOBAL_AUTOCONFIGURE_ENABLED="true" \ SE_OTEL_TRACES_EXPORTER="otlp" \ SE_SUPERVISORD_LOG_LEVEL="info" \ diff --git a/ENV_VARIABLES.md b/ENV_VARIABLES.md index f252a244d..35b7ec0e7 100644 --- a/ENV_VARIABLES.md +++ b/ENV_VARIABLES.md @@ -154,4 +154,4 @@ | SE_VIDEO_MAXRATE | | | | | SE_NODE_DELETE_SESSION_ON_UI | true | Enable capability to support deleting session on Grid UI | --delete-session-on-ui | | SE_UPDATE_CHROME_COMPONENTS | | Applicable for node-chrome, standalone-chrome (arch linux/amd64). Update the latest version of Chrome and ChromeDriver at the beginning of the container startup. Read more: [#2872](https://github.com/SeleniumHQ/docker-selenium/pull/2872) | | -| SE_DISTRIBUTOR_SLOT_SELECTOR | | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched. | --slot-selector | +| SE_DISTRIBUTOR_SLOT_SELECTOR | org.openqa.selenium.grid.distributor.selector.GreedySlotSelector | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched. Switch to default, use class name `org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector` | --slot-selector | diff --git a/charts/selenium-grid/CONFIGURATION.md b/charts/selenium-grid/CONFIGURATION.md index f162bcbf3..b8165c081 100644 --- a/charts/selenium-grid/CONFIGURATION.md +++ b/charts/selenium-grid/CONFIGURATION.md @@ -411,6 +411,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | autoscaling.patchObjectFinalizers.imagePullSecret | string | `""` | Custom pull secret for container in patch job | | autoscaling.patchObjectFinalizers.resources | object | `{"limits":{"cpu":"200m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"200Mi"}}` | Define resources for container in patch job | | autoscaling.patchObjectFinalizers.nodeSelector | object | `{}` | Node selector for the patch job | +| autoscaling.patchObjectFinalizers.tolerations | list | `[]` | Tolerations for the patch job | | autoscaling.scaledOptions | object | `{"maxReplicaCount":24,"minReplicaCount":0,"pollingInterval":20}` | Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) | | autoscaling.scaledOptions.minReplicaCount | int | `0` | Minimum number of replicas | | autoscaling.scaledOptions.maxReplicaCount | int | `24` | Maximum number of replicas | diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 2ac663663..4469abea2 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -1080,6 +1080,8 @@ autoscaling: memory: 500Mi # -- Node selector for the patch job nodeSelector: {} + # -- Tolerations for the patch job + tolerations: [] # -- Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) scaledOptions: # Don't define `triggers` config here, it will apply the same to all node types. Instead, define it under `scaledOptions` of different node type diff --git a/scripts/generate_list_env_vars/description.yaml b/scripts/generate_list_env_vars/description.yaml index 3253bfa34..a21d2bba4 100644 --- a/scripts/generate_list_env_vars/description.yaml +++ b/scripts/generate_list_env_vars/description.yaml @@ -479,5 +479,6 @@ cli: '' - name: SE_DISTRIBUTOR_SLOT_SELECTOR description: Full class name of non-default slot selector. This is used to select - a slot in a Node once the Node has been matched. + a slot in a Node once the Node has been matched. Switch to default, use class + name `org.openqa.selenium.grid.distributor.selector.DefaultSlotSelector` cli: --slot-selector diff --git a/scripts/generate_list_env_vars/value.yaml b/scripts/generate_list_env_vars/value.yaml index 6f87ab0b5..12b8f16c9 100644 --- a/scripts/generate_list_env_vars/value.yaml +++ b/scripts/generate_list_env_vars/value.yaml @@ -19,7 +19,7 @@ - name: SE_DISTRIBUTOR_PORT default: '5553' - name: SE_DISTRIBUTOR_SLOT_SELECTOR - default: '' + default: org.openqa.selenium.grid.distributor.selector.GreedySlotSelector - name: SE_DRAIN_AFTER_SESSION_COUNT default: '0' - name: SE_ENABLE_BROWSER_LEFTOVERS_CLEANUP