Skip to content

Commit 5af1bfe

Browse files
committed
update: video folder could not change via env var
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
1 parent fdb3e83 commit 5af1bfe

File tree

7 files changed

+47
-29
lines changed

7 files changed

+47
-29
lines changed

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ workflows:
2727
name: "K8s test - Autoscaling Deployments"
2828
platforms: linux/arm64
2929
machine-type: ubuntu2204arm64large
30-
k8s-version: 'v1.27.14'
30+
k8s-version: 'v1.27.15'
3131
test-strategy: deployment
3232
cluster: 'minikube'
3333
helm-version: 'v3.12.3'
@@ -37,7 +37,7 @@ workflows:
3737
name: "K8s test - Autoscaling Jobs - HTTPS"
3838
platforms: linux/arm64
3939
machine-type: ubuntu2204arm64large
40-
k8s-version: 'v1.28.10'
40+
k8s-version: 'v1.28.11'
4141
test-strategy: job_https
4242
cluster: 'minikube'
4343
helm-version: 'v3.13.3'
@@ -47,7 +47,7 @@ workflows:
4747
name: "K8s test - Autoscaling Jobs - Ingress hostname"
4848
platforms: linux/arm64
4949
machine-type: ubuntu2204arm64large
50-
k8s-version: 'v1.29.5'
50+
k8s-version: 'v1.29.6'
5151
test-strategy: job_hostname
5252
cluster: 'minikube'
5353
helm-version: 'v3.14.4'
@@ -57,10 +57,10 @@ workflows:
5757
name: "K8s test - Autoscaling Deployments - HTTPS"
5858
platforms: linux/arm64
5959
machine-type: ubuntu2204arm64large
60-
k8s-version: 'v1.30.1'
60+
k8s-version: 'v1.30.2'
6161
test-strategy: deployment_https
6262
cluster: 'minikube'
63-
helm-version: 'v3.15.0'
63+
helm-version: 'v3.15.2'
6464
test-existing-keda: false
6565
test-upgrade: true
6666
- docker-test:

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,28 @@ jobs:
4646
helm-version: 'v3.11.3'
4747
test-existing-keda: true
4848
test-upgrade: true
49-
- k8s-version: 'v1.27.14'
49+
- k8s-version: 'v1.27.15'
5050
test-strategy: deployment
5151
cluster: 'minikube'
5252
helm-version: 'v3.12.3'
5353
test-existing-keda: true
5454
test-upgrade: true
55-
- k8s-version: 'v1.28.10'
55+
- k8s-version: 'v1.28.11'
5656
test-strategy: job_https
5757
cluster: 'minikube'
5858
helm-version: 'v3.13.3'
5959
test-existing-keda: true
6060
test-upgrade: true
61-
- k8s-version: 'v1.29.5'
61+
- k8s-version: 'v1.29.6'
6262
test-strategy: job_hostname
6363
cluster: 'minikube'
6464
helm-version: 'v3.14.4'
6565
test-existing-keda: false
6666
test-upgrade: true
67-
- k8s-version: 'v1.30.1'
67+
- k8s-version: 'v1.30.2'
6868
test-strategy: deployment_https
6969
cluster: 'minikube'
70-
helm-version: 'v3.15.0'
70+
helm-version: 'v3.15.2'
7171
test-existing-keda: false
7272
test-upgrade: true
7373
env:

Video/Dockerfile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ARG SEL_GROUP=${SEL_USER}
1010
ARG SEL_PASSWD=secret
1111
ARG UID=1200
1212
ARG GID=1201
13+
ARG VIDEO_FOLDER=/videos
1314

1415
USER root
1516
#================================================
@@ -85,13 +86,12 @@ ENV SE_UPLOAD_DESTINATION_PREFIX ""
8586
ENV SE_VIDEO_INTERNAL_UPLOAD false
8687
ENV UPLOAD_OPTS "-P"
8788

88-
ENV SE_VIDEO_FOLDER /videos
89-
RUN mkdir -p /var/run/supervisor /var/log/supervisor $SE_VIDEO_FOLDER \
90-
&& chown -R ${SEL_USER}:${SEL_GROUP} /var/run/supervisor /var/log/supervisor $SE_VIDEO_FOLDER $HOME \
91-
&& chmod -R 775 /var/run/supervisor /var/log/supervisor $SE_VIDEO_FOLDER $HOME \
92-
&& chgrp -R 0 /var/run/supervisor /var/log/supervisor $SE_VIDEO_FOLDER $HOME \
93-
&& chmod -R g=u /var/run/supervisor /var/log/supervisor $SE_VIDEO_FOLDER $HOME \
94-
&& setfacl -Rdm u:${SEL_USER}:rwx,g:${SEL_GROUP}:rwx /var/run/supervisor /var/log/supervisor $SE_VIDEO_FOLDER $HOME
89+
RUN mkdir -p /var/run/supervisor /var/log/supervisor ${VIDEO_FOLDER} \
90+
&& chown -R ${SEL_USER}:${SEL_GROUP} /var/run/supervisor /var/log/supervisor ${VIDEO_FOLDER} $HOME \
91+
&& chmod -R 775 /var/run/supervisor /var/log/supervisor ${VIDEO_FOLDER} $HOME \
92+
&& chgrp -R 0 /var/run/supervisor /var/log/supervisor ${VIDEO_FOLDER} $HOME \
93+
&& chmod -R g=u /var/run/supervisor /var/log/supervisor ${VIDEO_FOLDER} $HOME \
94+
&& setfacl -Rdm u:${SEL_USER}:rwx,g:${SEL_GROUP}:rwx /var/run/supervisor /var/log/supervisor ${VIDEO_FOLDER} $HOME
9595

9696
USER ${SEL_UID}
9797

@@ -105,6 +105,7 @@ ENV SE_SCREEN_HEIGHT 1020
105105
ENV SE_FRAME_RATE 15
106106
ENV SE_CODEC libx264
107107
ENV SE_PRESET "-preset ultrafast"
108+
ENV VIDEO_FOLDER ${VIDEO_FOLDER}
108109
ENV SE_VIDEO_FILE_NAME video.mp4
109110
ENV SE_VIDEO_FILE_NAME_TRIM_REGEX "[:alnum:]-_"
110111

Video/upload.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
SE_VIDEO_FOLDER=${SE_VIDEO_FOLDER:-"/videos"}
3+
VIDEO_FOLDER=${VIDEO_FOLDER}
44
UPLOAD_CONFIG_DIRECTORY=${UPLOAD_CONFIG_DIRECTORY:-"/opt/bin"}
55
UPLOAD_CONFIG_FILE_NAME=${UPLOAD_CONFIG_FILE_NAME:-"upload.conf"}
66
UPLOAD_COMMAND=${UPLOAD_COMMAND:-"copy"}
@@ -17,8 +17,8 @@ then
1717
FORCE_EXIT_FILE="/tmp/force_exit"
1818
else
1919
# If using external container for uploading, write signal to the video folder
20-
UPLOAD_PIPE_FILE="${SE_VIDEO_FOLDER}/${UPLOAD_PIPE_FILE_NAME}"
21-
FORCE_EXIT_FILE="${SE_VIDEO_FOLDER}/force_exit"
20+
UPLOAD_PIPE_FILE="${VIDEO_FOLDER}/${UPLOAD_PIPE_FILE_NAME}"
21+
FORCE_EXIT_FILE="${VIDEO_FOLDER}/force_exit"
2222
fi
2323

2424
if [ "${UPLOAD_RETAIN_LOCAL_FILE}" = "false" ];

Video/video.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ VIDEO_FILE_NAME=${FILE_NAME:-$SE_VIDEO_FILE_NAME}
77
FRAME_RATE=${FRAME_RATE:-$SE_FRAME_RATE}
88
CODEC=${CODEC:-$SE_CODEC}
99
PRESET=${PRESET:-$SE_PRESET}
10-
VIDEO_FOLDER=${SE_VIDEO_FOLDER}
10+
VIDEO_FOLDER=${VIDEO_FOLDER}
1111
VIDEO_UPLOAD_ENABLED=${VIDEO_UPLOAD_ENABLED:-$SE_VIDEO_UPLOAD_ENABLED}
1212
VIDEO_CONFIG_DIRECTORY=${VIDEO_CONFIG_DIRECTORY:-"/opt/bin"}
1313
UPLOAD_DESTINATION_PREFIX=${UPLOAD_DESTINATION_PREFIX:-$SE_UPLOAD_DESTINATION_PREFIX}
@@ -18,15 +18,23 @@ SE_NODE_PORT=${SE_NODE_PORT:-"5555"}
1818
max_attempts=${SE_VIDEO_WAIT_ATTEMPTS:-50}
1919
process_name="video.recorder"
2020

21+
if [ -d "${VIDEO_FOLDER}" ];
22+
then
23+
echo "$(date +%FT%T%Z) [${process_name}] - Video folder exists: ${VIDEO_FOLDER}"
24+
else
25+
echo "$(date +%FT%T%Z) [${process_name}] - Video folder does not exist: ${VIDEO_FOLDER}. Due to permission, folder name could not be changed via environment variable. Exiting..."
26+
exit 1
27+
fi
28+
2129
if [ "${SE_VIDEO_INTERNAL_UPLOAD}" = "true" ];
2230
then
2331
# If using RCLONE in the same container, write signal to /tmp internally
2432
UPLOAD_PIPE_FILE="/tmp/${UPLOAD_PIPE_FILE_NAME}"
2533
FORCE_EXIT_FILE="/tmp/force_exit"
2634
else
2735
# If using external container for uploading, write signal to the video folder
28-
UPLOAD_PIPE_FILE="${SE_VIDEO_FOLDER}/${UPLOAD_PIPE_FILE_NAME}"
29-
FORCE_EXIT_FILE="${SE_VIDEO_FOLDER}/force_exit"
36+
UPLOAD_PIPE_FILE="${VIDEO_FOLDER}/${UPLOAD_PIPE_FILE_NAME}"
37+
FORCE_EXIT_FILE="${VIDEO_FOLDER}/force_exit"
3038
fi
3139

3240
function create_pipe() {

Video/video_graphQLQuery.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ SESSION_ID=$1
55
GRAPHQL_ENDPOINT=${2:-$SE_NODE_GRID_GRAPHQL_URL}
66
VIDEO_CAP_NAME=${VIDEO_CAP_NAME:-"se:recordVideo"}
77
TEST_NAME_CAP=${TEST_NAME_CAP:-"se:name"}
8+
VIDEO_NAME_CAP=${VIDEO_NAME_CAP:-"se:videoName"}
89
VIDEO_FILE_NAME_TRIM=${SE_VIDEO_FILE_NAME_TRIM_REGEX:-"[:alnum:]-_"}
910
VIDEO_FILE_NAME_SUFFIX=${SE_VIDEO_FILE_NAME_SUFFIX:-"true"}
1011

@@ -21,6 +22,7 @@ if [ -n "${GRAPHQL_ENDPOINT}" ]; then
2122

2223
RECORD_VIDEO=$(jq -r '.data.session.capabilities | fromjson | ."'${VIDEO_CAP_NAME}'"' /tmp/graphQL_${SESSION_ID}.json)
2324
TEST_NAME=$(jq -r '.data.session.capabilities | fromjson | ."'${TEST_NAME_CAP}'"' /tmp/graphQL_${SESSION_ID}.json)
25+
VIDEO_NAME=$(jq -r '.data.session.capabilities | fromjson | ."'${VIDEO_NAME_CAP}'"' /tmp/graphQL_${SESSION_ID}.json)
2426
fi
2527

2628
if [ "${RECORD_VIDEO,,}" = "false" ]; then
@@ -29,14 +31,21 @@ else
2931
RECORD_VIDEO=true
3032
fi
3133

32-
if [ "${TEST_NAME}" != "null" ] && [ -n "${TEST_NAME}" ]; then
33-
if [ "${VIDEO_FILE_NAME_SUFFIX,,}" = "true" ]; then
34-
TEST_NAME="${TEST_NAME}_${SESSION_ID}"
35-
fi
36-
TEST_NAME="$(echo "${TEST_NAME}" | tr ' ' '_' | tr -dc "${VIDEO_FILE_NAME_TRIM}" | cut -c 1-251)"
34+
if [ "${VIDEO_NAME}" != "null" ] && [ -n "${VIDEO_NAME}" ]; then
35+
TEST_NAME="${VIDEO_NAME}"
36+
elif [ "${TEST_NAME}" != "null" ] && [ -n "${TEST_NAME}" ]; then
37+
TEST_NAME="${TEST_NAME}"
3738
else
39+
TEST_NAME=""
40+
fi
41+
42+
if [ -z "${TEST_NAME}" ]; then
3843
TEST_NAME="${SESSION_ID}"
44+
elif [ "${VIDEO_FILE_NAME_SUFFIX,,}" = "true" ]; then
45+
TEST_NAME="${TEST_NAME}_${SESSION_ID}"
3946
fi
4047

48+
TEST_NAME="$(echo "${TEST_NAME}" | tr ' ' '_' | tr -dc "${VIDEO_FILE_NAME_TRIM}" | cut -c 1-251)"
49+
4150
return_array=("${RECORD_VIDEO}" "${TEST_NAME}")
4251
echo "${return_array[@]}"

tests/charts/make/chart_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ kubectl version --client
119119
echo "==============================="
120120

121121
echo "Installing Helm for AMD64 / ARM64"
122-
HELM_VERSION=${HELM_VERSION:-"v3.14.4"}
122+
HELM_VERSION=${HELM_VERSION:-"v3.15.2"}
123123
curl -fsSL -o helm.tar.gz https://get.helm.sh/helm-${HELM_VERSION}-linux-$(dpkg --print-architecture).tar.gz
124124
mkdir -p helm
125125
tar -xf helm.tar.gz --strip-components 1 -C helm

0 commit comments

Comments
 (0)