Skip to content

fix(chart): Improve default value for videoRecorder #1984

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

Merged
merged 1 commit into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ template:
imagePullPolicy: {{ .Values.videoRecorder.imagePullPolicy }}
env:
- name: UPLOAD_DESTINATION_PREFIX
value: {{ .Values.videoRecorder.uploadDestinationPrefix }}
value: {{ .Values.videoRecorder.uploadDestinationPrefix | quote }}
{{- with .Values.videoRecorder.extraEnvironmentVariables }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/chrome-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ spec:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-chrome-node" -}}
{{- $_ = set $podScope "node" .Values.chromeNode -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/chrome-node-scaledjobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ spec:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-chrome-node" -}}
{{- $_ = set $podScope "node" .Values.chromeNode -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/edge-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ spec:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-edge-node" -}}
{{- $_ = set $podScope "node" .Values.edgeNode -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/edge-node-scaledjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ spec:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-edge-node" -}}
{{- $_ = set $podScope "node" .Values.edgeNode -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ spec:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-firefox-node" -}}
{{- $_ = set $podScope "node" .Values.firefoxNode -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 2 }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/firefox-node-scaledjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ spec:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-firefox-node" -}}
{{- $_ = set $podScope "node" .Values.firefoxNode -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder .Values.videoRecorder.uploader) -}}
{{- $_ = set $podScope "uploader" (get .Values.videoRecorder (.Values.videoRecorder.uploader | toString)) -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
{{- end }}
11 changes: 7 additions & 4 deletions charts/selenium-grid/templates/video-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ data:
if [[ "$session_id" != "null" && "$session_id" != "" && "$recording_started" = "false" ]]
then
video_file_name="$session_id.mp4"
video_file="${VIDEO_LOCATION:-/videos}/$video_file_name"
video_file="${SE_VIDEO_FOLDER:-/videos}/$video_file_name"
echo "Starting to record video"
ffmpeg -nostdin -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} -i ${DISPLAY} -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p $video_file &
recording_started="true"
Expand All @@ -74,9 +74,12 @@ data:
echo "Stopping to record video"
kill -INT %1
fg || echo ffmpeg exited with code $?
upload_destination=${UPLOAD_DESTINATION_PREFIX}${video_file_name}
echo "Uploading video to $upload_destination"
echo $video_file $upload_destination > /videos/uploadpipe &
if [[ "$UPLOAD_DESTINATION_PREFIX" != "false" ]]
then
upload_destination=${UPLOAD_DESTINATION_PREFIX}${video_file_name}
echo "Uploading video to $upload_destination"
echo $video_file $upload_destination > /videos/uploadpipe &
fi
recording_started="false"
elif [[ $recording_started = "true" ]]
then
Expand Down
8 changes: 5 additions & 3 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -730,9 +730,10 @@ videoRecorder:
imageName: selenium/video
enabled: false
# Where to upload the video file. Should be set to something like 's3://myvideobucket/'
uploadDestinationPrefix: ""
uploadDestinationPrefix: false
# What uploader to use. See .videRecorder.s3 for how to create a new one.
uploader: s3
# uploader: s3
uploader: false

# Image of video recorder
imageTag: latest
Expand All @@ -749,7 +750,7 @@ videoRecorder:
memory: "1Gi"
cpu: "1"
extraEnvironmentVariables: []
# - name: VIDEO_LOCATION
# - name: SE_VIDEO_FOLDER
# value: /videos
# Custom environment variables by sourcing entire configMap, Secret, etc. for video recorder.
extraEnvFrom:
Expand All @@ -761,6 +762,7 @@ videoRecorder:
terminationGracePeriodSeconds: 30
volume:
emptyDir: {}
# Container spec for the uploader if above it is defined as "uploader: s3"
s3:
imageName: public.ecr.aws/bitnami/aws-cli
imageTag: "2"
Expand Down