Skip to content
Closed
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
40 changes: 37 additions & 3 deletions .github/workflows/OCV-PR-Linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jobs:
Ubuntu:
# runs-on: opencv-ru-lin-riscv
runs-on: opencv-cn-lin-x86-64
name: >-
Ubuntu (${{ matrix.version }},
${{ matrix.branch }}${{ matrix.libc == 'musl' && ', musl' || '' }})
needs:
- branch_eval
strategy:
Expand All @@ -59,32 +62,63 @@ jobs:
# TODO: enable later
# - '24.04_asan'
branch: ${{ fromJSON(needs.branch_eval.outputs.branches )}}
libc:
- 'glibc'
include:
- version: '24.04'
libc: 'glibc'
image: '24.04:20251127'
cache_key: '24.04'
jpegxl: true
avif: true
avx2: true
gphoto2: true
aravis: true
cache_suffix: '24.04'
# TODO: enable later
# - version: '24.04_asan'
# image: '24.04:20250505'
# asan: true
# jpegxl: true
# avif: true
- version: '22.04'
libc: 'glibc'
image: '22.04:20251015'
cache_key: '22.04'
avif: true
plugins: true
cache_suffix: '22.04'
- version: '20.04'
libc: 'glibc'
image: '20.04:20251015'
cache_key: '20.04'
limited_api: true
cache_suffix: '20.04'
- version: '24.04'
branch: '4.x'
libc: 'musl'
image: 'musl-1-2:20260409'
cache_key: '24.04_musl'
container_prefix: 'opencv-'
jpegxl: true
avif: true
avx2: true

- version: '24.04'
branch: '5.x'
libc: 'musl'
image: 'musl-1-2:20260409'
cache_key: '24.04_musl'
container_prefix: 'opencv-'
jpegxl: true
avif: true
avx2: true
defaults:
run:
shell: bash
container:
image: 'quay.io/opencv-ci/opencv-ubuntu-${{ matrix.image }}'
image: >-
quay.io/opencv-ci/${{ matrix.container_prefix || 'opencv-ubuntu-' }}${{ matrix.image }}
volumes:
# NOTE: RU config
# - /mnt/cache/git_cache:/opt/git_cache
Expand All @@ -93,8 +127,8 @@ jobs:
# - vol_dnn_models:/opt/dnn-models
# NOTE: CN config
- /home/opencv-cn/git_cache:/opt/git_cache
- /home/opencv-cn/ci_cache/opencv/${{ matrix.version }}:/opt/.ccache
- /home/opencv-cn/binaries_cache/${{ matrix.version }}:/opt/binaries_cache
- /home/opencv-cn/ci_cache/opencv/${{ matrix.cache_key }}:/opt/.ccache
- /home/opencv-cn/binaries_cache/${{ matrix.cache_key }}:/opt/binaries_cache
- /home/opencv-cn/dnn-models:/opt/dnn-models
# NOTE: RU config
# options: '--user root:root'
Expand Down
169 changes: 169 additions & 0 deletions docker/ubuntu/Dockerfile-musl
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# version: 20260409
# Image name: quay.io/opencv-ci/opencv-musl-1-2
FROM quay.io/pypa/musllinux_1_2_x86_64:latest

ARG CCACHE_VERSION=3.7.9
ARG FFMPEG_VERSION=6.1.1
ARG FREETYPE_VERSION=2.13.3
ARG LIBPNG_VERSION=1.6.48
ARG VPX_VERSION=v1.15.1
ARG NASM_VERSION=2.15.04
ARG OPENSSL_VERSION=1_1_1w
ARG YASM_VERSION=1.3.0
ARG AOM_VERSION=v3.12.1
ARG AVIF_VERSION=v1.3.0

ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH

RUN apk add --no-cache \
build-base \
diffutils \
cmake \
bash \
git \
curl \
wget \
tar \
xz \
zlib-dev \
xz-dev \
nasm \
yasm \
pkgconfig \
openssl-dev \
libjpeg-turbo-dev \
fontconfig-dev \
freetype-dev \
expat-dev \
libpng-dev \
alsa-lib-dev \
musl-dev \
ttf-dejavu \
linux-headers \
py3-requests \
perl \
ninja

RUN apk del libpng-dev

### libpng
RUN mkdir ~/libpng_sources && \
cd ~/libpng_sources && \
curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \
tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \
cd libpng-${LIBPNG_VERSION} && \
./configure --prefix=/usr/local && \
make && \
make install && \
cd .. && \
rm -rf ~/libpng_sources

### freetype
RUN mkdir ~/freetype_sources && \
cd ~/freetype_sources && \
curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \
cd freetype-${FREETYPE_VERSION} && \
./configure --prefix="/ffmpeg_build" --enable-freetype-config && \
make && \
make install && \
cd .. && \
rm -rf ~/freetype_sources

### OpenSSL
RUN mkdir ~/openssl_sources && \
cd ~/openssl_sources && \
curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \
tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \
cd openssl-OpenSSL_${OPENSSL_VERSION} && \
./config --prefix="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install_sw && \
cd .. && \
rm -rf ~/openssl_build ~/openssl_sources

### libvpx
RUN mkdir ~/libvpx_sources && \
cd ~/libvpx_sources && \
git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \
cd libvpx && \
./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install && \
cd .. && \
rm -rf ~/libvpx_sources


### aom
RUN mkdir -p /tmp/aom_sources && \
cd /tmp/aom_sources && \
git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \
mkdir build && cd build && \
cmake \
-DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc \
-DCMAKE_INSTALL_PREFIX=/usr \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_TESTS=OFF \
-DENABLE_EXAMPLES=OFF \
../aom && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install
### avif
RUN mkdir ~/avif_sources && \
cd ~/avif_sources && \
git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install && \
cd .. && \
rm -rf ~/avif_sources

### ffmpeg
RUN mkdir -p /ffmpeg_sources && \
cd /ffmpeg_sources && \
curl -LO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
cd ffmpeg-${FFMPEG_VERSION} && \
PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure \
--prefix="/ffmpeg_build" \
--extra-cflags="-I/ffmpeg_build/include" \
--extra-ldflags="-L/ffmpeg_build/lib" \
--enable-openssl \
--enable-libvpx \
--enable-shared \
--enable-pic \
--disable-indev=v4l2 \
--disable-outdev=v4l2 && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install && \
rm -rf /ffmpeg_sources

### ccache
RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
tar -xf ccache-${CCACHE_VERSION}.tar.gz && \
cd ccache-${CCACHE_VERSION} && \
./configure && \
make -j$(getconf _NPROCESSORS_ONLN) && \
make install && \
cd .. && \
rm -rf ccache-${CCACHE_VERSION}.tar.gz

# user`s UID is 1000 for self-runner
RUN adduser -D -u 1000 -h /home/ci ci && \
mkdir -p /home/ci /io && \
chown -R ci:ci /home/ci /io && \
chown -R ci:ci /ffmpeg_build && \
# This calls in mutlibuild scripts and cannot be run without permissions
chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel

ENV HOME=/home/ci
WORKDIR /home/ci
USER ci

RUN git config --global --add safe.directory /io
ENV PATH="/ffmpeg_build/bin:$PATH"
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig
ENV LDFLAGS -L/ffmpeg_build/lib
ENV PATH "$HOME/bin:$PATH"
ENV LD_LIBRARY_PATH="/ffmpeg_build/lib:$LD_LIBRARY_PATH"
Loading