Skip to content

[ci] Add workflow to build and deploy FFmpeg tools image #2507

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
Dec 12, 2024
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
12 changes: 9 additions & 3 deletions .ffmpeg/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ FROM ubuntu:noble AS builder
ARG VERSION_FFMPEG="7.1"
ARG VERSION_RCLONE="v1.68.2"
ARG VERSION_GO="latest"
ARG GO_CRYPTO_VERSION="v0.31.0"

USER root

#======================================
# Install build tools
#======================================
ARG TOOLS_DEPS="autoconf automake cmake libfreetype6 gcc build-essential libtool make nasm pkg-config zlib1g-dev numactl \
libnuma-dev libx11-6 libxcb1 libxcb1-dev yasm git curl jq wget ca-certificates"
libnuma-dev libx11-dev libxcb-shm0 libxcb1-dev yasm git curl jq wget ca-certificates"

RUN apt-get update -qqy \
&& apt-get upgrade -yq \
Expand All @@ -30,6 +31,10 @@ RUN cd /usr/local/src \
&& git clone https://github.com/rclone/rclone.git \
&& cd rclone \
&& git checkout $VERSION_RCLONE \
# Patch deps version in go.mod to fix CVEs
&& sed -i "s|golang.org/x/crypto v.*|golang.org/x/crypto ${GO_CRYPTO_VERSION}|g" go.mod \
&& go mod tidy \
# Build rclone
&& make \
&& mv ~/go/bin/rclone /usr/local/bin/ \
&& rclone version
Expand Down Expand Up @@ -74,8 +79,9 @@ COPY --from=builder /usr/local/bin/rclone /usr/local/bin/rclone

RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
libx11-dev libxcb1 libxcb-shm0 \
libx11-dev libxcb-shm0 libxcb1-dev \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

RUN ffmpeg -version \
RUN ldd /usr/local/bin/ffmpeg \
&& ffmpeg -version \
&& rclone --version
68 changes: 68 additions & 0 deletions .github/workflows/build-ffmpeg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build and Deploy FFmpeg

on:
push:
paths:
- '.ffmpeg/Dockerfile'
workflow_dispatch:
inputs:
release:
description: 'Deploy a new release'
required: false
type: boolean
default: false

jobs:
deploy:
name: Build and Deploy FFmpeg
runs-on: blacksmith-8vcpu-ubuntu-2204
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@main
with:
persist-credentials: false
fetch-depth: 0
- name: Set up containerd image store feature
uses: nick-invision/retry@master
with:
timeout_minutes: 10
max_attempts: 3
command: |
make setup_dev_env
- name: Output Docker info
run: docker info
- name: Sets build date
run: |
echo "BUILD_DATE=$(date '+%Y%m%d')" >> $GITHUB_ENV
echo "NAME=${NAMESPACE}" >> $GITHUB_ENV
make set_build_multiarch
cat .env | xargs -I {} echo {} >> $GITHUB_ENV
env:
NAMESPACE: ${{ vars.DOCKER_NAMESPACE || 'selenium' }}
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
- name: Build images
uses: nick-invision/retry@master
with:
timeout_minutes: 300
max_attempts: 2
retry_wait_seconds: 60
command: |
PLATFORMS="${PLATFORMS}" make ffmpeg
make tag_ffmpeg_latest
- name: Login Docker Hub
if: ${{ github.event.inputs.release == 'true' }}
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}}
DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}}
- name: Deploy new images
if: ${{ github.event.inputs.release == 'true' }}
uses: nick-invision/retry@master
with:
timeout_minutes: 20
max_attempts: 5
retry_wait_seconds: 300
continue_on_error: true
command: |
make release_ffmpeg_latest
4 changes: 2 additions & 2 deletions Video/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ COPY --from=source /usr/local/bin/rclone /usr/local/bin/rclone

RUN apt-get -qqy update \
&& apt-get -qqy --no-install-recommends install \
libx11-6 libxcb1 libxcb-shm0 \
libx11-dev libxcb-shm0 libxcb1-dev \
x11-xserver-utils x11-utils \
python3-pip \
&& pip install --break-system-packages --no-cache-dir setuptools psutil \
&& pip install --upgrade --break-system-packages --no-cache-dir setuptools psutil \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*

COPY *.conf /etc/supervisor/conf.d/
Expand Down
Loading