Skip to content

Commit

Permalink
feat(chart): Configure fixed-sized thread pool for the Distributor to…
Browse files Browse the repository at this point in the history
… create new sessions

Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 committed Mar 26, 2024
1 parent c419716 commit 97941f8
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 99 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
test-existing-keda: true
- k8s-version: 'v1.26.15'
test-strategy: deployment
cluster: 'kind'
cluster: 'minikube'
helm-version: 'v3.11.3'
test-existing-keda: true
- k8s-version: 'v1.27.12'
test-strategy: job_https
cluster: 'kind'
cluster: 'minikube'
helm-version: 'v3.12.3'
test-existing-keda: true
- k8s-version: 'v1.28.8'
Expand Down
5 changes: 5 additions & 0 deletions Distributor/start-selenium-grid-distributor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ if [ ! -z "$SE_REJECT_UNSUPPORTED_CAPS" ]; then
SE_OPTS="$SE_OPTS --reject-unsupported-caps ${SE_REJECT_UNSUPPORTED_CAPS}"
fi

if [ ! -z "$SE_NEW_SESSION_THREAD_POOL_SIZE" ]; then
echo "Appending Selenium options: --newsession-threadpool-size ${SE_NEW_SESSION_THREAD_POOL_SIZE}"
SE_OPTS="$SE_OPTS --newsession-threadpool-size ${SE_NEW_SESSION_THREAD_POOL_SIZE}"
fi

EXTRA_LIBS=""

if [ "$SE_ENABLE_TRACING" = "true" ]; then
Expand Down
5 changes: 5 additions & 0 deletions Hub/start-selenium-grid-hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ if [ ! -z "$SE_REJECT_UNSUPPORTED_CAPS" ]; then
SE_OPTS="$SE_OPTS --reject-unsupported-caps ${SE_REJECT_UNSUPPORTED_CAPS}"
fi

if [ ! -z "$SE_NEW_SESSION_THREAD_POOL_SIZE" ]; then
echo "Appending Selenium options: --newsession-threadpool-size ${SE_NEW_SESSION_THREAD_POOL_SIZE}"
SE_OPTS="$SE_OPTS --newsession-threadpool-size ${SE_NEW_SESSION_THREAD_POOL_SIZE}"
fi

EXTRA_LIBS=""

if [ "$SE_ENABLE_TRACING" = "true" ]; then
Expand Down
5 changes: 5 additions & 0 deletions Standalone/start-selenium-standalone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ if [ ! -z "$SE_REJECT_UNSUPPORTED_CAPS" ]; then
SE_OPTS="$SE_OPTS --reject-unsupported-caps ${SE_REJECT_UNSUPPORTED_CAPS}"
fi

if [ ! -z "$SE_NEW_SESSION_THREAD_POOL_SIZE" ]; then
echo "Appending Selenium options: --newsession-threadpool-size ${SE_NEW_SESSION_THREAD_POOL_SIZE}"
SE_OPTS="$SE_OPTS --newsession-threadpool-size ${SE_NEW_SESSION_THREAD_POOL_SIZE}"
fi

/opt/bin/generate_config

echo "Selenium Grid Standalone configuration: "
Expand Down
184 changes: 93 additions & 91 deletions charts/selenium-grid/README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions charts/selenium-grid/templates/distributor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ spec:
value: '{{ template "seleniumGrid.sessionQueue.fullname" . }}.{{ .Release.Namespace }}'
- name: SE_SESSION_QUEUE_PORT
value: {{ .Values.components.sessionQueue.port | quote }}
{{- with .Values.components.distributor.newSessionThreadPoolSize }}
- name: SE_NEW_SESSION_THREAD_POOL_SIZE
value: {{ . | quote }}
{{- end }}
{{- with .Values.components.extraEnvironmentVariables }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand Down
4 changes: 4 additions & 0 deletions charts/selenium-grid/templates/hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ spec:
- name: SE_DISABLE_UI
value: {{ .Values.hub.disableUI | quote }}
{{- end }}
{{- with .Values.hub.newSessionThreadPoolSize }}
- name: SE_NEW_SESSION_THREAD_POOL_SIZE
value: {{ . | quote }}
{{- end }}
{{- with .Values.hub.extraEnvironmentVariables }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand Down
4 changes: 2 additions & 2 deletions charts/selenium-grid/templates/router-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ spec:
- name: SE_SUB_PATH
value: {{ . | quote }}
{{- end }}
{{- if .Values.components.disableUI }}
{{- if .Values.components.router.disableUI }}
- name: SE_DISABLE_UI
value: {{ .Values.components.disableUI | quote }}
value: {{ .Values.components.router.disableUI | quote }}
{{- end }}
{{- with .Values.components.extraEnvironmentVariables }}
{{- tpl (toYaml .) $ | nindent 12 }}
Expand Down
8 changes: 6 additions & 2 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ components:
# Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
imagePullSecret: ""

# Disable the Grid UI
disableUI: false
# Custom annotations for router pods
annotations: {}
# Router port
Expand Down Expand Up @@ -263,6 +265,8 @@ components:
# Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
imagePullSecret: ""

# Configure fixed-sized thread pool for the Distributor to create new sessions as it consumes new session requests from the queue
newSessionThreadPoolSize:
# Custom annotations for Distributor pods
annotations: {}
# Distributor port
Expand Down Expand Up @@ -387,8 +391,6 @@ components:

# Custom sub path for all components
subPath: ""
# Disable the Grid UI
disableUI: false

# Custom environment variables for all components
extraEnvironmentVariables:
Expand Down Expand Up @@ -425,6 +427,8 @@ hub:
labels: {}
# Disable the Grid UI
disableUI: false
# Configure fixed-sized thread pool for the Distributor to create new sessions as it consumes new session requests from the queue
newSessionThreadPoolSize:
# Port where events are published
publishPort: 4442
publishNodePort: 31442
Expand Down
2 changes: 1 addition & 1 deletion tests/charts/templates/render/dummy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ isolateComponents: true

components:
subPath: *gridAppRoot
disableUI: true
router:
disableUI: true
annotations:
"restartOnUpdate": "true"
serviceType: NodePort
Expand Down
2 changes: 1 addition & 1 deletion tests/charts/templates/render/dummy_solution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ selenium-grid:

components:
subPath: *gridAppRoot
disableUI: true
router:
disableUI: true
serviceType: NodePort
distributor:
serviceType: NodePort
Expand Down

0 comments on commit 97941f8

Please sign in to comment.