Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(chart): se:recordVideo should be used to determine if record video #2104

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat(chart): se:recordVideo should be used to determine if video shou…
…ld be recorded

Signed-off-by: Viet Nguyen Duc <[email protected]>
VietND96 committed Jan 22, 2024

Verified

This commit was signed with the committer’s verified signature.
VietND96 Viet Nguyen Duc
commit 2f4de64dcbc4c21321cd028e3726c503495dd9de
18 changes: 18 additions & 0 deletions charts/selenium-grid/configs/recorder/graphQLRecordVideo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Define parameters
SESSION_ID=$1
GRAPHQL_ENDPOINT=${2:-$SE_NODE_GRID_GRAPHQL_URL}

# Send GraphQL query
curl --retry 3 -k -X POST \
-H "Content-Type: application/json" \
--data '{"query":"{ session (id: \"'${SESSION_ID}'\") { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } } } "}' \
-s "${GRAPHQL_ENDPOINT}" > /tmp/graphQL_$SESSION_ID.json

RECORD_VIDEO=$(jq -r '.data.session.capabilities | fromjson | ."se:recordVideo"' /tmp/graphQL_$SESSION_ID.json)

if [ "${RECORD_VIDEO}" = "false" ]; then
echo "${RECORD_VIDEO}"
else
echo true
fi
21 changes: 14 additions & 7 deletions charts/selenium-grid/configs/recorder/video.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env bash

UPLOAD_ENABLED=${UPLOAD_ENABLED:-"false"}
VIDEO_UPLOAD_ENABLED=${VIDEO_UPLOAD_ENABLED:-"false"}
VIDEO_CONFIG_DIRECTORY=${VIDEO_CONFIG_DIRECTORY:-"/opt/bin"}

function create_pipe() {
if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
then
echo "Create pipe if not exists for video upload stream"
if [ ! -p ${SE_VIDEO_FOLDER}/uploadpipe ];
@@ -15,7 +16,7 @@ function create_pipe() {
create_pipe

function wait_util_force_exit_consume() {
if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
then
while [[ -f ${SE_VIDEO_FOLDER}/force_exit ]]
do
@@ -27,7 +28,7 @@ function wait_util_force_exit_consume() {
}

function add_exit_signal() {
if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
then
echo "exit" >> ${SE_VIDEO_FOLDER}/uploadpipe &
echo "exit" > ${SE_VIDEO_FOLDER}/force_exit
@@ -93,8 +94,14 @@ fi
while curl -sk --request GET ${SE_SERVER_PROTOCOL}://${DISPLAY_CONTAINER_NAME}:${SE_NODE_PORT}/status > /tmp/status.json
do
session_id=$(jq -r '.[]?.node?.slots | .[0]?.session?.sessionId' /tmp/status.json)
echo $session_id
echo "Session: $session_id is created"
if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]]
then
caps_se_video_record=$(bash ${VIDEO_CONFIG_DIRECTORY}/graphQLRecordVideo.sh "$session_id")
cat "/tmp/graphQL_$session_id.json"; echo
echo "se:recordVideo value is: $caps_se_video_record"
fi
if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" && "$caps_se_video_record" = "true" ]]
then
video_file_name="$session_id.mp4"
video_file="${SE_VIDEO_FOLDER}/$video_file_name"
@@ -108,12 +115,12 @@ do
pkill -INT ffmpeg
recorded_count=$((recorded_count+1))
recording_started="false"
if [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
if [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ ! -z "${UPLOAD_DESTINATION_PREFIX}" ]];
then
upload_destination=${UPLOAD_DESTINATION_PREFIX}/${video_file_name}
echo "Uploading video to $upload_destination"
echo $video_file ${UPLOAD_DESTINATION_PREFIX} >> ${SE_VIDEO_FOLDER}/uploadpipe &
elif [[ "${UPLOAD_ENABLED}" != "false" ]] && [[ -z "${UPLOAD_DESTINATION_PREFIX}" ]];
elif [[ "${VIDEO_UPLOAD_ENABLED}" != "false" ]] && [[ -z "${UPLOAD_DESTINATION_PREFIX}" ]];
then
echo Upload destination not known since UPLOAD_DESTINATION_PREFIX is not set. Continue without uploading.
fi
107 changes: 51 additions & 56 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -335,15 +335,15 @@ template:
{{- end }}
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
name: {{ tpl (toYaml .Values.busConfigMap.name) $ }}
- configMapRef:
name: {{ .Values.nodeConfigMap.name }}
name: {{ tpl (toYaml .Values.nodeConfigMap.name) $ }}
- configMapRef:
name: {{ .Values.loggingConfigMap.name }}
name: {{ tpl (toYaml .Values.loggingConfigMap.name) $ }}
- configMapRef:
name: {{ .Values.serverConfigMap.name }}
name: {{ tpl (toYaml .Values.serverConfigMap.name) $ }}
- secretRef:
name: {{ include "seleniumGrid.common.secrets" $ | quote }}
name: {{ include "seleniumGrid.common.secrets" $ }}
{{- with .node.extraEnvFrom }}
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
@@ -364,9 +364,11 @@ template:
volumeMounts:
- name: dshm
mountPath: /dev/shm
- name: {{ .Values.nodeConfigMap.scriptVolumeMountName }}
mountPath: /opt/selenium/{{ .Values.nodeConfigMap.preStopScript }}
subPath: {{ .Values.nodeConfigMap.preStopScript }}
{{- range $fileName, $value := .Values.nodeConfigMap.extraScripts }}
- name: {{ $.Values.nodeConfigMap.scriptVolumeMountName }}
mountPath: {{ $.Values.nodeConfigMap.extraScriptsDirectory }}/{{ $fileName }}
subPath: {{ $fileName }}
{{- end }}
{{- if .Values.tls.enabled }}
- name: {{ include "seleniumGrid.tls.fullname" $ | quote }}
mountPath: {{ .Values.serverConfigMap.certVolumeMountPath }}
@@ -451,11 +453,13 @@ template:
{{- end }}
envFrom:
- configMapRef:
name: {{ .Values.busConfigMap.name }}
name: {{ tpl (toYaml .Values.busConfigMap.name) $ }}
- configMapRef:
name: {{ tpl (toYaml .Values.nodeConfigMap.name) $ }}
- configMapRef:
name: {{ .Values.nodeConfigMap.name }}
name: {{ tpl (toYaml .Values.recorderConfigMap.name) $ }}
- configMapRef:
name: {{ .Values.serverConfigMap.name }}
name: {{ tpl (toYaml .Values.serverConfigMap.name) $ }}
{{- with .Values.videoRecorder.extraEnvFrom }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
@@ -499,14 +503,16 @@ template:
{{- if .uploader.args }}
args: {{- tpl (toYaml .uploader.args) $ | nindent 8 }}
{{- else }}
args: ["-c", "{{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ $.Values.videoRecorder.uploader.entryPointFileName }}"]
args: ["-c", "{{ $.Values.recorderConfigMap.extraScriptsDirectory }}/{{ $.Values.videoRecorder.uploader.entryPointFileName }}"]
{{- end }}
{{- with .uploader.extraEnvironmentVariables }}
env: {{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ tpl (toYaml .Values.uploaderConfigMap.name) $ }}
- secretRef:
name: {{ include "seleniumGrid.common.secrets" $ | quote }}
name: {{ tpl (toYaml .Values.uploaderConfigMap.secretVolumeMountName) $ }}
{{- with .uploader.extraEnvFrom }}
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
@@ -655,7 +661,7 @@ Define preStop hook for the node pod. Node preStop script is stored in a ConfigM
{{- define "seleniumGrid.node.deregisterLifecycle" -}}
preStop:
exec:
command: ["bash", "-c", "/opt/selenium/{{ .Values.nodeConfigMap.preStopScript }}"]
command: ["bash", "-c", "{{ $.Values.nodeConfigMap.extraScriptsDirectory }}/nodePreStop.sh"]
{{- end -}}

{{/*
@@ -699,56 +705,45 @@ Define terminationGracePeriodSeconds of the node pod.
{{- $period -}}
{{- end -}}

{{/*
Default specs of VolumeMounts and Volumes for video recorder
*/}}
{{- define "seleniumGrid.video.volume.name.folder" -}}
{{- $name := default "video" (((.Values.videoRecorder).volume).name).folder -}}
{{- $name -}}
{{- end -}}

{{- define "seleniumGrid.video.volume.name.scripts" -}}
{{- $name := default "video-scripts" (((.Values.videoRecorder).volume).name).scripts -}}
{{- $name -}}
{{- end -}}

{{- define "seleniumGrid.video.volumeMounts.default" -}}
{{- $root := . -}}
{{- range $path, $bytes := .Files.Glob "configs/recorder/*.sh" }}
- name: {{ include "seleniumGrid.video.volume.name.scripts" $ }}
mountPath: /opt/bin/{{ base $path }}
subPath: {{ base $path }}
{{- range $fileName, $value := .Values.recorderConfigMap.extraScripts }}
- name: {{ tpl (toYaml $.Values.recorderConfigMap.scriptVolumeMountName) $ }}
mountPath: {{ $.Values.recorderConfigMap.extraScriptsDirectory }}/{{ $fileName }}
subPath: {{ $fileName }}
{{- end }}
- name: {{ include "seleniumGrid.video.volume.name.folder" . }}
mountPath: /videos
- name: {{ tpl (toYaml $.Values.recorderConfigMap.videoVolumeMountName) $ }}
mountPath: {{ $.Values.videoRecorder.targetFolder }}
{{- end -}}

{{- define "seleniumGrid.video.volumes.default" -}}
- name: {{ include "seleniumGrid.video.volume.name.scripts" . }}
- name: {{ tpl (toYaml $.Values.recorderConfigMap.videoVolumeMountName) $ }}
emptyDir: {}
- name: {{ tpl (toYaml $.Values.recorderConfigMap.scriptVolumeMountName) $ }}
configMap:
name: {{ tpl (toYaml $.Values.recorderConfigMap.name) $ }}
defaultMode: {{ $.Values.recorderConfigMap.defaultMode }}
- name: {{ tpl (toYaml $.Values.uploaderConfigMap.scriptVolumeMountName) $ }}
configMap:
name: {{ template "seleniumGrid.video.fullname" . }}
defaultMode: 0500
- name: {{ template "seleniumGrid.common.secrets" . }}
name: {{ tpl (toYaml $.Values.uploaderConfigMap.name) $ }}
defaultMode: {{ $.Values.uploaderConfigMap.defaultMode }}
- name: {{ tpl (toYaml $.Values.uploaderConfigMap.secretVolumeMountName) $ }}
secret:
secretName: {{ template "seleniumGrid.common.secrets" . }}
- name: {{ include "seleniumGrid.video.volume.name.folder" . }}
emptyDir: {}
secretName: {{ tpl (toYaml $.Values.uploaderConfigMap.secretVolumeMountName) $ }}
{{- end -}}

{{- define "seleniumGrid.video.uploader.volumeMounts.default" -}}
{{- $root := . -}}
{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*.sh" $.Values.videoRecorder.uploader.name) }}
- name: {{ include "seleniumGrid.video.volume.name.scripts" $ }}
mountPath: {{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ base $path }}
subPath: {{ base $path }}
{{- range $fileName, $value := .Values.uploaderConfigMap.extraScripts }}
- name: {{ tpl (toYaml $.Values.uploaderConfigMap.scriptVolumeMountName) $ }}
mountPath: {{ $.Values.uploaderConfigMap.extraScriptsDirectory }}/{{ $fileName }}
subPath: {{ $fileName }}
{{- end }}
{{- range $path, $bytes := .Files.Glob (printf "configs/uploader/%s/*.conf" $.Values.videoRecorder.uploader.name) }}
- name: {{ include "seleniumGrid.common.secrets" $ }}
mountPath: {{ $.Values.videoRecorder.uploader.scriptMountPath }}/{{ base $path }}
subPath: {{ base $path }}
{{- range $fileName, $value := .Values.uploaderConfigMap.secretFiles }}
- name: {{ tpl (toYaml $.Values.uploaderConfigMap.secretVolumeMountName) $ }}
mountPath: {{ $.Values.uploaderConfigMap.extraScriptsDirectory }}/{{ $fileName }}
subPath: {{ $fileName }}
{{- end }}
- name: {{ include "seleniumGrid.video.volume.name.folder" . }}
mountPath: /videos
- name: {{ tpl (toYaml $.Values.recorderConfigMap.videoVolumeMountName) $ }}
mountPath: {{ $.Values.videoRecorder.targetFolder }}
{{- end -}}

{{/* Combine videoRecorder.extraVolumeMounts with the default ones for container video recorder */}}
@@ -759,9 +754,9 @@ Default specs of VolumeMounts and Volumes for video recorder
{{- $videoVolumeMounts = append $videoVolumeMounts . -}}
{{- end -}}
{{- end -}}
{{- $defaultVolumeMounts := (include "seleniumGrid.video.volumeMounts.default" . | toString | fromYamlArray ) -}}
{{- $defaultVolumeMounts := (include "seleniumGrid.video.volumeMounts.default" $ | toString | fromYamlArray ) -}}
{{- $videoVolumeMounts = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoVolumeMounts "defaultArray" $defaultVolumeMounts "uniqueKey" "mountPath") -}}
{{- not $videoVolumeMounts | ternary $videoVolumeMounts "" -}}
{{- not (empty $videoVolumeMounts) | ternary $videoVolumeMounts "" -}}
{{- end -}}

{{/* Combine videoRecorder.uploader.extraVolumeMounts with the default ones for container video uploader */}}
@@ -774,7 +769,7 @@ Default specs of VolumeMounts and Volumes for video recorder
{{- end }}
{{- $defaultVolumeMounts := (include "seleniumGrid.video.uploader.volumeMounts.default" . | toString | fromYamlArray ) -}}
{{- $videoUploaderVolumeMounts = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoUploaderVolumeMounts "defaultArray" $defaultVolumeMounts "uniqueKey" "mountPath") -}}
{{- not $videoUploaderVolumeMounts | ternary $videoUploaderVolumeMounts "" -}}
{{- not (empty $videoUploaderVolumeMounts) | ternary $videoUploaderVolumeMounts "" -}}
{{- end -}}

{{/* Combine videoRecorder.extraVolumes with the default ones for the node pod */}}
@@ -787,7 +782,7 @@ Default specs of VolumeMounts and Volumes for video recorder
{{- end -}}
{{- $defaultVolumes := (include "seleniumGrid.video.volumes.default" . | toString | fromYamlArray ) -}}
{{- $videoVolumes = include "utils.appendDefaultIfNotExist" (dict "currentArray" $videoVolumes "defaultArray" $defaultVolumes "uniqueKey" "name") -}}
{{- not $videoVolumes | ternary $videoVolumes "" -}}
{{- not (empty $videoVolumes) | ternary $videoVolumes "" -}}
{{- end -}}

{{/*
14 changes: 9 additions & 5 deletions charts/selenium-grid/templates/node-configmap.yaml
Original file line number Diff line number Diff line change
@@ -14,8 +14,12 @@ metadata:
data:
SE_DRAIN_AFTER_SESSION_COUNT: '{{- and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "1" "0" -}}'
SE_NODE_GRID_URL: '{{ include "seleniumGrid.url" .}}'
UPLOAD_ENABLED: '{{ .Values.videoRecorder.uploader.enabled }}'
UPLOAD_DESTINATION_PREFIX: '{{ .Values.videoRecorder.uploader.destinationPrefix }}'
UPLOAD_CONFIG_FILE_NAME: '{{ .Values.videoRecorder.uploader.configFileName }}'
UPLOAD_CONFIG_DIRECTORY: '{{ .Values.videoRecorder.uploader.scriptMountPath }}'
{{ (.Files.Glob "configs/node/*").AsConfig | indent 2 }}
SE_NODE_GRID_GRAPHQL_URL: '{{ include "seleniumGrid.graphqlURL" .}}'
{{- range $fileName, $value := .Values.nodeConfigMap.extraScripts }}
{{- if not (empty $value) }}
{{ $fileName | indent 2 -}}: |
{{ $value | indent 4 }}
{{- else }}
{{ ($.Files.Glob (printf "configs/node/%s" $fileName)).AsConfig | indent 2 }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/selenium-grid/templates/recorder-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.videoRecorder.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.recorderConfigMap.name }}
namespace: {{ .Release.Namespace }}
{{- with .Values.recorderConfigMap.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
{{- with .Values.customLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
data:
VIDEO_UPLOAD_ENABLED: '{{ .Values.videoRecorder.uploader.enabled }}'
VIDEO_CONFIG_DIRECTORY: '{{ .Values.recorderConfigMap.extraScriptsDirectory }}'
UPLOAD_DESTINATION_PREFIX: '{{ .Values.videoRecorder.uploader.destinationPrefix }}'
{{- range $fileName, $value := .Values.recorderConfigMap.extraScripts }}
{{- if not (empty $value) }}
{{ $fileName | indent 2 -}}: |
{{ $value | indent 4 }}
{{- else }}
{{ ($.Files.Glob (printf "configs/recorder/%s" $fileName)).AsConfig | indent 2 }}
{{- end }}
{{- end }}
{{- end }}
1 change: 0 additions & 1 deletion charts/selenium-grid/templates/router-deployment.yaml
Original file line number Diff line number Diff line change
@@ -110,7 +110,6 @@ spec:
{{- if .Values.components.router.livenessProbe.enabled }}
livenessProbe:
{{- with .Values.components.router.livenessProbe }}
livenessProbe:
{{- if (ne (include "seleniumGrid.probe.fromUserDefine" .) "{}") }}
{{- include "seleniumGrid.probe.fromUserDefine" . | nindent 10 }}
{{- else }}
12 changes: 8 additions & 4 deletions charts/selenium-grid/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -37,9 +37,13 @@ data:
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.videoRecorder.uploader.enabled .Values.videoRecorder.uploader.config }}
{{ .Values.videoRecorder.uploader.configFileName }}: {{ .Values.videoRecorder.uploader.config | b64enc }}
{{- else if and .Values.videoRecorder.uploader.enabled (not .Values.videoRecorder.uploader.config) }}
{{ (.Files.Glob (printf "configs/uploader/%s/*.conf" $.Values.videoRecorder.uploader.name)).AsSecrets | indent 2 }}
{{- if and .Values.videoRecorder.uploader.enabled }}
{{- range $fileName, $value := .Values.uploaderConfigMap.secretFiles }}
{{- if not (empty $value) }}
{{ $fileName }}: {{ $value | b64enc }}
{{- else }}
{{ ($.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName)).AsSecrets | indent 2 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
26 changes: 26 additions & 0 deletions charts/selenium-grid/templates/uploader-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{{- if .Values.videoRecorder.uploader.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.uploaderConfigMap.name }}
namespace: {{ .Release.Namespace }}
{{- with .Values.uploaderConfigMap.annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
{{- with .Values.customLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
data:
UPLOAD_CONFIG_DIRECTORY: '{{ .Values.uploaderConfigMap.extraScriptsDirectory }}'
UPLOAD_CONFIG_FILE_NAME: '{{ .Values.videoRecorder.uploader.configFileName }}'
{{- range $fileName, $value := .Values.uploaderConfigMap.extraScripts }}
{{- if not (empty $value) }}
{{ $fileName | indent 2 -}}: |
{{ $value | indent 4 }}
{{- else }}
{{ ($.Files.Glob (printf "configs/uploader/%s/%s" $.Values.videoRecorder.uploader.name $fileName)).AsConfig | indent 2 }}
{{- end }}
{{- end }}
{{- end }}
14 changes: 0 additions & 14 deletions charts/selenium-grid/templates/video-cm.yaml

This file was deleted.

47 changes: 41 additions & 6 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
@@ -104,12 +104,50 @@ nodeConfigMap:
# Default mode for ConfigMap is mounted as file
defaultMode: 0755
# File name of preStop script in ConfigMap
preStopScript: nodePreStop.sh
extraScriptsDirectory: "/opt/selenium"
extraScripts:
nodePreStop.sh:
# Name of volume mount is used to mount scripts in the ConfigMap
scriptVolumeMountName: node-helper-scripts
# Custom annotations for configmap
annotations: {}

recorderConfigMap:
name: selenium-recorder-config
# Default mode for ConfigMap is mounted as file
defaultMode: 0755
# Directory where the extra scripts are mounted to
extraScriptsDirectory: "/opt/bin"
# List of extra scripts to be mounted to the container. Format as `filename: content`
extraScripts:
video.sh:
graphQLRecordVideo.sh:
# Name of volume mount is used to mount scripts in the ConfigMap
scriptVolumeMountName: recorder-helper-scripts
videoVolumeMountName: videos
# Custom annotations for configmap
annotations: {}

uploaderConfigMap:
name: selenium-uploader-config
# Default mode for ConfigMap is mounted as file
defaultMode: 0755
# Directory where the extra scripts are mounted to
extraScriptsDirectory: "/opt/bin"
# List of extra scripts to be mounted to the container. Format as `filename: content`
extraScripts:
entry_point.sh:
# Extra files stored in Secret to be mounted to the container.
secretFiles:
config.conf:
# Name of volume mount is used to mount scripts in the ConfigMap
scriptVolumeMountName: uploader-helper-scripts
# Name of Secret is used to store the `secretFiles`
secretVolumeMountName: '{{ include "seleniumGrid.common.secrets" $ }}'
# Custom annotations for configmap
annotations: {}


# ConfigMap that contains common environment variables for Logging (https://www.selenium.dev/documentation/grid/configuration/cli_options/#logging)
loggingConfigMap:
name: selenium-logging-config
@@ -987,19 +1025,16 @@ videoRecorder:
# Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images)
imagePullPolicy: IfNotPresent
# Image pull secret (see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/)
targetFolder: "/videos"
uploader:
enabled: false
# Where to upload the video file e.g. remoteName://bucketName/path. Refer to destination syntax of rclone https://rclone.org/docs/
destinationPrefix:
# What uploader to use. See .videRecorder.rclone for how to create a new one.
name: "rclone"
configFileName: "rclone.conf"
configFileName: "config.conf"
entryPointFileName: "entry_point.sh"
scriptMountPath: "/opt/bin"
# Config file for rclone.
config:
# Script to control the upload process.
entryPoint:
# For environment variables used in uploader which contains sensitive information, store in secret and refer envFrom
# Set config for rclone via ENV var with format: RCLONE_CONFIG_ + name of remote + _ + name of config file option (make it all uppercase)
secrets:
3 changes: 3 additions & 0 deletions tests/SeleniumTests/__init__.py
Original file line number Diff line number Diff line change
@@ -99,6 +99,7 @@ def setUp(self):
options = ChromeOptions()
options.enable_downloads = True
options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2')
options.set_capability('se:recordVideo', True)
self.driver = webdriver.Remote(
options=options,
command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT)
@@ -109,6 +110,7 @@ def setUp(self):
options = EdgeOptions()
options.enable_downloads = True
options.add_argument('disable-features=DownloadBubble,DownloadBubbleV2')
options.set_capability('se:recordVideo', True)
self.driver = webdriver.Remote(
options=options,
command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT)
@@ -123,6 +125,7 @@ def setUp(self):
options = FirefoxOptions()
options.profile = profile
options.enable_downloads = True
options.set_capability('se:recordVideo', True)
self.driver = webdriver.Remote(
options=options,
command_executor="%s://%s:%s" % (SELENIUM_GRID_PROTOCOL,SELENIUM_GRID_HOST,SELENIUM_GRID_PORT)