Skip to content

Commit 3c1453e

Browse files
authored
K8s: Distributor uses Greedy algo as slot selector strategy in autoscaling (#2875)
K8s: Distributor uses Greedy as slot selector strategy in autoscaling Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent 2641d8d commit 3c1453e

16 files changed

+55
-5
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
if: github.event.inputs.skip-build-push-image != 'true'
129129
uses: nick-invision/retry@master
130130
with:
131-
timeout_minutes: 90
131+
timeout_minutes: 160
132132
max_attempts: 3
133133
retry_wait_seconds: 60
134134
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build

.github/workflows/docker-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ jobs:
222222
uses: nick-invision/retry@master
223223
if: matrix.build-all == true
224224
with:
225-
timeout_minutes: 20
225+
timeout_minutes: 90
226226
max_attempts: 3
227227
retry_wait_seconds: 60
228228
command: |

.github/workflows/helm-chart-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ jobs:
197197
- name: Build Docker images
198198
uses: nick-invision/retry@master
199199
with:
200-
timeout_minutes: 12
200+
timeout_minutes: 90
201201
max_attempts: 3
202202
retry_wait_seconds: 60
203203
command: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build

.github/workflows/k8s-scaling-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ jobs:
178178
- name: Build Docker images
179179
uses: nick-invision/retry@master
180180
with:
181-
timeout_minutes: 12
181+
timeout_minutes: 30
182182
max_attempts: 3
183183
retry_wait_seconds: 60
184184
command: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
- name: Build images
7979
uses: nick-invision/retry@master
8080
with:
81-
timeout_minutes: 90
81+
timeout_minutes: 160
8282
max_attempts: 3
8383
retry_wait_seconds: 60
8484
command: PLATFORMS="${PLATFORMS}" VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build

Distributor/start-selenium-grid-distributor.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ if [ ! -z "$SE_REJECT_UNSUPPORTED_CAPS" ]; then
145145
append_se_opts "--reject-unsupported-caps" "${SE_REJECT_UNSUPPORTED_CAPS}"
146146
fi
147147

148+
if [ ! -z "$SE_DISTRIBUTOR_SLOT_SELECTOR" ]; then
149+
append_se_opts "--slot-selector" "${SE_DISTRIBUTOR_SLOT_SELECTOR}"
150+
fi
151+
148152
if [ ! -z "$SE_NEW_SESSION_THREAD_POOL_SIZE" ]; then
149153
append_se_opts "--newsession-threadpool-size" "${SE_NEW_SESSION_THREAD_POOL_SIZE}"
150154
fi

ENV_VARIABLES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,4 @@
154154
| SE_VIDEO_MAXRATE | | | |
155155
| SE_NODE_DELETE_SESSION_ON_UI | true | Enable capability to support deleting session on Grid UI | --delete-session-on-ui |
156156
| 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) | |
157+
| 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 |

Hub/start-selenium-grid-hub.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ if [ ! -z "$SE_REJECT_UNSUPPORTED_CAPS" ]; then
101101
append_se_opts "--reject-unsupported-caps" "${SE_REJECT_UNSUPPORTED_CAPS}"
102102
fi
103103

104+
if [ ! -z "$SE_DISTRIBUTOR_SLOT_SELECTOR" ]; then
105+
append_se_opts "--slot-selector" "${SE_DISTRIBUTOR_SLOT_SELECTOR}"
106+
fi
107+
104108
if [ ! -z "$SE_NEW_SESSION_THREAD_POOL_SIZE" ]; then
105109
append_se_opts "--newsession-threadpool-size" "${SE_NEW_SESSION_THREAD_POOL_SIZE}"
106110
fi

Standalone/start-selenium-standalone.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ if [ ! -z "$SE_REJECT_UNSUPPORTED_CAPS" ]; then
128128
append_se_opts "--reject-unsupported-caps" "${SE_REJECT_UNSUPPORTED_CAPS}"
129129
fi
130130

131+
if [ ! -z "$SE_DISTRIBUTOR_SLOT_SELECTOR" ]; then
132+
append_se_opts "--slot-selector" "${SE_DISTRIBUTOR_SLOT_SELECTOR}"
133+
fi
134+
131135
if [ ! -z "$SE_NEW_SESSION_THREAD_POOL_SIZE" ]; then
132136
append_se_opts "--newsession-threadpool-size" "${SE_NEW_SESSION_THREAD_POOL_SIZE}"
133137
fi

charts/selenium-grid/CONFIGURATION.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
219219
| components.distributor.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
220220
| components.distributor.imagePullSecret | string | `""` | Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) |
221221
| components.distributor.newSessionThreadPoolSize | string | `nil` | Configure fixed-sized thread pool for the Distributor to create new sessions as it consumes new session requests from the queue |
222+
| components.distributor.slotSelectorStrategy | string | `""` | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched |
222223
| components.distributor.extraEnvironmentVariables | list | `[]` | Specify extra environment variables for Distributor |
223224
| components.distributor.extraEnvFrom | list | `[]` | Specify extra environment variables from ConfigMap and Secret for Distributor |
224225
| components.distributor.affinity | object | `{}` | Specify affinity for distributor pods, this overwrites global.seleniumGrid.affinity parameter |
@@ -340,6 +341,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
340341
| hub.readinessProbe | object | `{"enabled":true,"failureThreshold":10,"initialDelaySeconds":12,"path":"/readyz","periodSeconds":10,"successThreshold":1,"timeoutSeconds":10}` | Readiness probe settings |
341342
| hub.livenessProbe | object | `{"enabled":true,"failureThreshold":30,"initialDelaySeconds":60,"path":"/readyz","periodSeconds":60,"successThreshold":1,"timeoutSeconds":60}` | Liveness probe settings |
342343
| hub.subPath | string | `""` | Custom sub path for the hub deployment |
344+
| hub.slotSelectorStrategy | string | `""` | Full class name of non-default slot selector. This is used to select a slot in a Node once the Node has been matched |
343345
| hub.extraEnvironmentVariables | list | `[]` | Custom environment variables for selenium-hub |
344346
| hub.extraEnvFrom | list | `[]` | Custom environment variables by sourcing entire configMap, Secret, etc. for selenium-hub |
345347
| hub.extraVolumeMounts | list | `[]` | Extra volume mounts for Hub container |
@@ -391,6 +393,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
391393
| autoscaling.enableWithExistingKEDA | bool | `false` | Enable autoscaling without automatically installing KEDA |
392394
| autoscaling.scalingType | string | `"job"` | Which type of KEDA scaling to use: job or deployment |
393395
| autoscaling.setReplicasInSpec | bool | `true` | Force remove replicas in deployment spec in case ArgoCD with AutoSync enabled will try to resolve back to desired state |
396+
| autoscaling.slotSelectorStrategy | string | `"org.openqa.selenium.grid.distributor.selector.GreedySlotSelector"` | Strategy for Selenium Hub/Distributor select slot to assign to a new session. |
394397
| autoscaling.authenticationRef | object | `{"annotations":{"helm.sh/hook":"post-install,post-upgrade,post-rollback","helm.sh/hook-weight":"0"},"name":""}` | Specify an external KEDA TriggerAuthentication resource is used for scaler triggers config. Apply for all browser nodes |
395398
| autoscaling.useCachedMetrics | bool | `false` | Enables caching of metric values during polling interval (as specified in .spec.pollingInterval, the default: false in KEDA). |
396399
| autoscaling.triggerName | string | `""` | Set trigger name. |

0 commit comments

Comments
 (0)