Skip to content

Commit

Permalink
Update Video/Dockerfile with based image ffmpeg:6.0-alpine (#1981)
Browse files Browse the repository at this point in the history
[deploy]
  • Loading branch information
VietND96 authored Oct 25, 2023
1 parent 01648f3 commit 60ad27e
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 37 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BUILD_ARGS := $(BUILD_ARGS)
MAJOR := $(word 1,$(subst ., ,$(TAG_VERSION)))
MINOR := $(word 2,$(subst ., ,$(TAG_VERSION)))
MAJOR_MINOR_PATCH := $(word 1,$(subst -, ,$(TAG_VERSION)))
FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-4.3.1)
FFMPEG_TAG_VERSION := $(or $(FFMPEG_TAG_VERSION),$(FFMPEG_TAG_VERSION),ffmpeg-6.0)

all: hub \
distributor \
Expand Down Expand Up @@ -357,9 +357,9 @@ test_video: video hub chrome firefox edge
done
# Using ffmpeg to verify file integrity
# https://superuser.com/questions/100288/how-can-i-check-the-integrity-of-a-video-file-avi-mpeg-mp4
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:4.3.1-ubuntu2004 -v error -i ./tests/videos/chrome_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:4.3.1-ubuntu2004 -v error -i ./tests/videos/firefox_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:4.3.1-ubuntu2004 -v error -i ./tests/videos/edge_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:6.0-alpine -v error -i ./tests/videos/chrome_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:6.0-alpine -v error -i ./tests/videos/firefox_video.mp4 -f null - 2>error.log
docker run -v $$(pwd):$$(pwd) -w $$(pwd) jrottenberg/ffmpeg:6.0-alpine -v error -i ./tests/videos/edge_video.mp4 -f null - 2>error.log

.PHONY: \
all \
Expand Down
2 changes: 1 addition & 1 deletion NodeDocker/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ configs = [
# socat -4 TCP-LISTEN:2375,fork UNIX-CONNECT:/var/run/docker.sock
url = "http://127.0.0.1:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20231020"
video-image = "selenium/video:ffmpeg-6.0-20231020"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ ___

## Video recording

Tests execution can be recorded by using the `selenium/video:ffmpeg-4.3.1-20231020`
Tests execution can be recorded by using the `selenium/video:ffmpeg-6.0-20231020`
Docker image. One container is needed per each container where a browser is running. This means if you are
running 5 Nodes/Standalone containers, you will need 5 video containers, the mapping is 1-1.

Expand All @@ -500,7 +500,7 @@ This example shows how to start the containers manually:
``` bash
$ docker network create grid
$ docker run -d -p 4444:4444 -p 6900:5900 --net grid --name selenium --shm-size="2g" selenium/standalone-chrome:4.14.1-20231020
$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-4.3.1-20231020
$ docker run -d --net grid --name video -v /tmp/videos:/videos selenium/video:ffmpeg-6.0-20231020
# Run your tests
$ docker stop video && docker rm video
$ docker stop selenium && docker rm selenium
Expand Down Expand Up @@ -547,7 +547,7 @@ configs = [
# Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue.
url = "http://127.0.0.1:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20231020"
video-image = "selenium/video:ffmpeg-6.0-20231020"

# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
Expand Down Expand Up @@ -678,7 +678,7 @@ configs = [
# Linux: varies from machine to machine, please mount /var/run/docker.sock. If this does not work, please create an issue.
url = "http://127.0.0.1:2375"
# Docker image used for video recording
video-image = "selenium/video:ffmpeg-4.3.1-20231020"
video-image = "selenium/video:ffmpeg-6.0-20231020"
# Uncomment the following section if you are running the node on a separate VM
# Fill out the placeholders with appropriate values
Expand Down
38 changes: 14 additions & 24 deletions Video/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
FROM jrottenberg/ffmpeg:4.3.1-ubuntu2004
FROM jrottenberg/ffmpeg:6.0-alpine
LABEL authors="Selenium <[email protected]>"

#================================================
# Customize sources for apt-get
#================================================
RUN echo "deb http://archive.ubuntu.com/ubuntu focal main universe\n" > /etc/apt/sources.list \
&& echo "deb http://archive.ubuntu.com/ubuntu focal-updates main universe\n" >> /etc/apt/sources.list \
&& echo "deb http://security.ubuntu.com/ubuntu focal-security main universe\n" >> /etc/apt/sources.list

# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true

#========================
# Supervisor
#========================
RUN apt-get -qqy update \
&& apt-get upgrade -yq \
&& apt-get -qqy --no-install-recommends install \
supervisor x11-xserver-utils x11-utils curl jq python3-pip \
&& python3 -m pip install --upgrade pip \
&& python3 -m pip install --upgrade setuptools \
&& python3 -m pip install --upgrade wheel \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
RUN apk update \
&& apk upgrade \
&& apk add --no-cache --update --virtual .build-deps supervisor bash curl jq xset python3 py3-psutil py3-pip \
&& ln -sf python3 /usr/bin/python \
&& rm -rf /tmp/* /var/cache/apk/*

ENV PYTHONUNBUFFERED=1
RUN python3 -m pip install --no-cache --upgrade --no-cache-dir pip urllib3 setuptools requests wheel

#======================================
# Add Supervisor configuration files
#======================================
ENV SE_VIDEO_FOLDER /videos
RUN mkdir -p /opt/bin/
RUN mkdir -p /var/run/supervisor /var/log/supervisor ${SE_VIDEO_FOLDER}

COPY supervisord.conf /etc
COPY entry_point.sh video.sh video_ready.py /opt/bin/
RUN cd /opt/bin && pip install psutil

RUN mkdir -p /var/run/supervisor /var/log/supervisor /videos

RUN chmod +x /opt/bin/*
ENTRYPOINT ["/opt/bin/entry_point.sh"]
CMD ["/opt/bin/entry_point.sh"]

Expand All @@ -44,6 +35,5 @@ ENV SE_FRAME_RATE 15
ENV SE_CODEC libx264
ENV SE_PRESET "-preset ultrafast"
ENV FILE_NAME video.mp4
ENV SE_VIDEO_FOLDER /videos

EXPOSE 9000
6 changes: 3 additions & 3 deletions docker-compose-v3-video.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
- SE_EVENT_BUS_SUBSCRIBE_PORT=4443

chrome_video:
image: selenium/video:ffmpeg-4.3.1-20231020
image: selenium/video:ffmpeg-6.0-20231020
volumes:
- /tmp/videos:/videos
depends_on:
Expand All @@ -44,7 +44,7 @@ services:
- FILE_NAME=chrome_video.mp4

edge_video:
image: selenium/video:ffmpeg-4.3.1-20231020
image: selenium/video:ffmpeg-6.0-20231020
volumes:
- /tmp/videos:/videos
depends_on:
Expand All @@ -54,7 +54,7 @@ services:
- FILE_NAME=edge_video.mp4

firefox_video:
image: selenium/video:ffmpeg-4.3.1-20231020
image: selenium/video:ffmpeg-6.0-20231020
volumes:
- /tmp/videos:/videos
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion generate_release_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chrom
EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}')
FIREFOX_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}')
GECKODRIVER_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}')
FFMPEG_VERSION=$(docker run --entrypoint="" --rm selenium/video:ffmpeg-4.3.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1)
FFMPEG_VERSION=$(docker run --entrypoint="" --rm selenium/video:ffmpeg-6.0-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1)


echo "" >> release_notes.md
Expand Down

0 comments on commit 60ad27e

Please sign in to comment.