Add Linux Docker image source files

This commit is contained in:
Simran Spiller
2020-09-23 01:55:47 +02:00
parent f0019be680
commit 9fadd9905f
12 changed files with 585 additions and 0 deletions
+71
View File
@@ -0,0 +1,71 @@
# Copyright (C) 2020 Olive Team
# SPDX-License-Identifier: GPL-3.0-or-later
# Build image (default):
# docker build -t olivevideoeditor/ci-common:2 -f ci-common/Dockerfile .
ARG OLIVE_ORG=olivevideoeditor
ARG ASWF_PKG_ORG=aswftesting
ARG CI_COMMON_VERSION=2
ARG DTS_VERSION=9
ARG CMAKE_VERSION=3.17.3
FROM ${ASWF_PKG_ORG}/ci-package-clang:${CI_COMMON_VERSION} as ci-package-clang
FROM ${ASWF_PKG_ORG}/ci-package-ninja:${CI_COMMON_VERSION} as ci-package-ninja
FROM centos:7 as ci-common
ARG OLIVE_ORG
ARG CI_COMMON_VERSION
ARG DTS_VERSION
ARG CMAKE_VERSION
LABEL maintainer="olivevideoeditor@gmail.com"
LABEL org.opencontainers.image.name="$OLIVE_ORG/ci-common"
LABEL org.opencontainers.image.description="CentOS CI Shared Image"
LABEL org.opencontainers.image.url="http://olivevideoeditor.org"
LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive"
LABEL org.opencontainers.image.vendor="Olive Team"
LABEL org.opencontainers.image.version="1.0"
USER root
COPY scripts/${CI_COMMON_VERSION}/versions_common.sh \
scripts/common/install_yumpackages.sh \
scripts/common/before_build.sh \
scripts/common/copy_new_files.sh \
/tmp/
RUN source /tmp/versions_common.sh && \
/tmp/install_yumpackages.sh
RUN mkdir /opt/olive
WORKDIR /opt/olive
ENV OLIVE_ORG=${OLIVE_ORG} \
CI_COMMON_VERSION=${CI_COMMON_VERSION} \
DTS_VERSION=${DTS_VERSION} \
CMAKE_VERSION=${CMAKE_VERSION} \
LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64:/opt/rh/httpd24/root/usr/lib64:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/lib64:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/lib:${LD_LIBRARY_PATH} \
PATH=/opt/rh/rh-git218/root/usr/bin:/usr/local/bin:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/bin:/opt/app-root/src/bin:/opt/rh/devtoolset-${DTS_VERSION}/root/usr/bin/:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin
#COPY scripts/common/install_sonar.sh \
# scripts/common/install_ccache.sh \
# /tmp/
COPY --from=ci-package-clang /. /usr/local/
COPY --from=ci-package-ninja /. /usr/local/
#COPY scripts/common/setup_aswfuser.sh /tmp
#RUN /tmp/setup_aswfuser.sh
COPY scripts/base/install_cmake.sh \
/tmp/
RUN export DOWNLOADS_DIR=/tmp/downloads && \
mkdir /tmp/downloads && \
# source /tmp/versions_base.sh && \
/tmp/install_cmake.sh && \
# /tmp/patchup.sh && \
rm -rf /tmp/downloads
+37
View File
@@ -0,0 +1,37 @@
# Copyright (C) 2020 Olive Team
# SPDX-License-Identifier: GPL-3.0-or-later
# Build image (default):
# docker build -t olivevideoeditor/ci-package-crashpad -f ci-crashpad/Dockerfile .
ARG OLIVE_ORG=olivevideoeditor
ARG CI_COMMON_VERSION=2
FROM ${OLIVE_ORG}/ci-common:${CI_COMMON_VERSION} as ci-crashpad
ARG OLIVE_ORG
ARG CI_COMMON_VERSION
LABEL maintainer="olivevideoeditor@gmail.com"
LABEL org.opencontainers.image.name="$OLIVE_ORG/ci-crashpad"
LABEL org.opencontainers.image.description="CentOS Crashpad Build Image"
LABEL org.opencontainers.image.url="http://olivevideoeditor.org"
LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive"
LABEL org.opencontainers.image.vendor="Olive Team"
LABEL org.opencontainers.image.version="1.0"
COPY scripts/build_crashpad.sh \
/tmp/
ENV OLIVE_ORG=${OLIVE_ORG} \
CI_COMMON_VERSION=${CI_COMMON_VERSION} \
OLIVE_INSTALL_PREFIX=/usr/local
RUN /tmp/before_build.sh && \
/tmp/build_crashpad.sh && \
/tmp/copy_new_files.sh
FROM scratch as ci-package-crashpad
COPY --from=ci-crashpad /package /
+57
View File
@@ -0,0 +1,57 @@
# Copyright (C) 2020 Olive Team
# SPDX-License-Identifier: GPL-3.0-or-later
# Build image (default):
# docker build -t olivevideoeditor/ci-package-ffmpeg:4.2.4 -f ci-ffmpeg/Dockerfile .
ARG OLIVE_ORG=olivevideoeditor
ARG CI_COMMON_VERSION=2
ARG FFMPEG_VERSION=4.2.4
ARG NASM_VERSION=2.15.03
ARG YASM_VERSION=1.3.0
ARG LAME_VERSION=3.100
ARG OPUS_VERSION=1.3.1
# TODO: Make version of x264, x265 and libvpx selectable?
ARG NUM_JOBS=2
FROM ${OLIVE_ORG}/ci-common:${CI_COMMON_VERSION} as ci-ffmpeg
ARG OLIVE_ORG
ARG CI_COMMON_VERSION
ARG FFMPEG_VERSION
ARG NASM_VERSION
ARG YASM_VERSION
ARG LAME_VERSION
ARG OPUS_VERSION
# TODO: Make version of x264, x265 and libvpx selectable?
ARG NUM_JOBS=2
LABEL maintainer="olivevideoeditor@gmail.com"
LABEL org.opencontainers.image.name="$OLIVE_ORG/ci-ffmpeg"
LABEL org.opencontainers.image.description="CentOS FFmpeg Build Image"
LABEL org.opencontainers.image.url="http://olivevideoeditor.org"
LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive"
LABEL org.opencontainers.image.vendor="Olive Team"
LABEL org.opencontainers.image.version="1.0"
COPY scripts/build_ffmpeg.sh \
/tmp/
ENV OLIVE_ORG=${OLIVE_ORG} \
CI_COMMON_VERSION=${CI_COMMON_VERSION} \
FFMPEG_VERSION=${FFMPEG_VERSION} \
NASM_VERSION=${NASM_VERSION} \
YASM_VERSION=${YASM_VERSION} \
LAME_VERSION=${LAME_VERSION} \
OPUS_VERSION=${OPUS_VERSION} \
NUM_JOBS=${NUM_JOBS} \
OLIVE_INSTALL_PREFIX=/usr/local
RUN /tmp/before_build.sh && \
/tmp/build_ffmpeg.sh && \
/tmp/copy_new_files.sh
FROM scratch as ci-package-ffmpeg
COPY --from=ci-ffmpeg /package/. /
+52
View File
@@ -0,0 +1,52 @@
# Copyright (C) 2020 Olive Team
# SPDX-License-Identifier: GPL-3.0-or-later
# Build image (default):
# docker build -t olivevideoeditor/ci-olive:2021.2 -f ci-olive/Dockerfile .
ARG OLIVE_ORG=olivevideoeditor
ARG ASWF_PKG_ORG=aswftesting
ARG CI_COMMON_VERSION=2
ARG VFXPLATFORM_VERSION=2021
ARG FFMPEG_VERSION=4.2.4
FROM ${ASWF_PKG_ORG}/ci-package-qt:${VFXPLATFORM_VERSION} as ci-package-qt
FROM ${ASWF_PKG_ORG}/ci-package-python:${VFXPLATFORM_VERSION} as ci-package-python
FROM ${ASWF_PKG_ORG}/ci-package-boost:${VFXPLATFORM_VERSION} as ci-package-boost
FROM ${ASWF_PKG_ORG}/ci-package-openexr:${VFXPLATFORM_VERSION} as ci-package-openexr
FROM ${ASWF_PKG_ORG}/ci-package-oiio:${VFXPLATFORM_VERSION} as ci-package-oiio
FROM ${ASWF_PKG_ORG}/ci-package-ocio:${VFXPLATFORM_VERSION} as ci-package-ocio
FROM ${OLIVE_ORG}/ci-package-ffmpeg:${FFMPEG_VERSION} as ci-package-ffmpeg
FROM ${OLIVE_ORG}/ci-package-crashpad:latest as ci-package-crashpad
FROM ${OLIVE_ORG}/ci-common:${CI_COMMON_VERSION} as ci-olive
ARG OLIVE_ORG
ARG VFXPLATFORM_VERSION
ARG PYTHON_VERSION=3.7
LABEL maintainer="olivevideoeditor@gmail.com"
LABEL org.opencontainers.image.name="olivevideoeditor/ci-olive"
LABEL org.opencontainers.image.description="CentOS CI Olive Build Image"
LABEL org.opencontainers.image.url="http://olivevideoeditor.org"
LABEL org.opencontainers.image.source="https://github.com/olive-editor/olive"
LABEL org.opencontainers.image.vendor="Olive Team"
LABEL org.opencontainers.image.version="1.0"
ENV PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:${PYTHONPATH} \
CRASHPAD_LOCATION=/usr/local/crashpad \
VFXPLATFORM_VERSION=${VFXPLATFORM_VERSION}
COPY --from=ci-package-qt /. /usr/local/
COPY --from=ci-package-python /. /usr/local/
COPY --from=ci-package-boost /. /usr/local/
COPY --from=ci-package-openexr /. /usr/local/
COPY --from=ci-package-oiio /. /usr/local/
COPY --from=ci-package-ocio /. /usr/local/
COPY --from=ci-package-ffmpeg /. /usr/local/
COPY --from=ci-package-crashpad /. /usr/local/
RUN curl --location "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" \
-o "/usr/local/linuxdeployqt-x86_64.AppImage" && \
chmod a+x "/usr/local/linuxdeployqt-x86_64.AppImage"
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -ex
export DTS_VERSION=9
export CLANG_VERSION=10.0.0
export NINJA_VERSION=1.10.0
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -ex
export BOOST_VERSION=1.70.0
export CMAKE_VERSION=3.17.3
export NUMPY_VERSION=1.16
export PYSIDE_VERSION=5.12.6
export PYTHON_VERSION_FULL=3.7.3
export PYTHON_VERSION=3.7
export QT_VERSION=5.12.8
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -ex
if [ ! -f "$DOWNLOADS_DIR/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" ]; then
curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" -o "$DOWNLOADS_DIR/cmake-${CMAKE_VERSION}-Linux-x86_64.sh"
fi
sh "$DOWNLOADS_DIR/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" --skip-license --prefix=/usr/local --exclude-subdir
+82
View File
@@ -0,0 +1,82 @@
#!/usr/bin/env bash
# Copyright (C) 2020 Olive Team
# SPDX-License-Identifier: GPL-3.0-or-later
set -ex
# Get Google's build tools
git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
# HACK: Compile our own gn. The one included in depot_tools requires GLIBC_2.18,
# but CentOS 7 only ships with GLIBC_2.17.
git clone https://gn.googlesource.com/gn
# NOTE: Don't clone with --depth 1, this will make build/gen.py fail!
cd gn
python build/gen.py
ninja -C out
cd ..
# Put the path to our own gn build first
PATH="$(pwd)/gn/out:$(pwd)/depot_tools:$PATH"
export PATH
# Build Crashpad with Clang (default)
# Toolchain can be controlled with env vars CC, CXX and AR
mkdir crashpad
cd crashpad
fetch crashpad
cd crashpad
# TODO: Do we want to set any special args here? For example:
# gn gen --args="target_cpu=\"x64\" is_debug=true" out/Default
gn gen out/Default
ninja -C out/Default
# Include list
echo 'out/Default/crashpad_handler' > /tmp/crashpad_include_list.txt
find . \( -type f -o -type l \) \
-name "*.h" -o \
-name "*.o" -o \
-name "*.a" | cut -c3- >> /tmp/crashpad_include_list.txt
# Exclude list
echo '**/.git/**
compat/android/**
compat/ios/**
compat/mac/**
compat/non_elf/**
compat/win/**
handler/mac/**
handler/win/**
infra/**
minidump/test/**
out/Default/**_test*
snapshot/fuchsia/**
snapshot/ios/**
snapshot/mac/**
snapshot/win/**
test/**
third_party/fuchsia/**
third_party/gyp/gyp/test/**
third_party/mini_chromium/mini_chromium/base/fuchsia/**
third_party/mini_chromium/mini_chromium/testing/**
tools/mac/**
util/fuchsia/**
util/ios/**
util/mac/**
util/win/**' > /tmp/crashpad_exclude_list.txt
rsync -av \
--files-from=/tmp/crashpad_include_list.txt \
--exclude-from=/tmp/crashpad_exclude_list.txt \
--prune-empty-dirs \
. "${OLIVE_INSTALL_PREFIX}/crashpad"
cd ../..
# Build Breakpad for minidump_stackwalk
mkdir breakpad
cd breakpad
fetch breakpad
cd src
./configure --prefix="${OLIVE_INSTALL_PREFIX}/breakpad"
make
make install -j$(nproc)
+158
View File
@@ -0,0 +1,158 @@
#!/usr/bin/env bash
# Copyright (C) 2020 Olive Team
# SPDX-License-Identifier: GPL-3.0-or-later
# Largely copied from https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
#
# Uses { command } & pattern for parallelism https://gist.github.com/thenadz/6c0584d42fb007582fbc
#
# TOOD: Use advanced options such as LTO? e.g. https://code.videolan.org/videolan/x264/-/blob/master/configure
# TODO: Enable debug symbols? (Or is it opt-out?)
# TODO: Add more ffmpeg libraries? See https://raw.githubusercontent.com/jrottenberg/ffmpeg/master/docker-images/4.2/centos7/Dockerfile
set -ex
# Set up recent NASM
{
curl -fLsS -o nasm.tar.xz "https://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.xz"
tar xf nasm.tar.xz
rm -f nasm.tar.xz
cd nasm*
./autogen.sh
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}"
make -j${NUM_JOBS}
make install
cd ..
rm -rf nasm*
} &
# Set up recent YASM
{
curl -fLsS -o yasm.tar.gz "http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz"
tar xf yasm.tar.gz
rm -f yasm.tar.gz
cd yasm*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}"
make -j${NUM_JOBS}
make install
cd ..
rm -rf yasm*
} &
# join jobs, some libs depend on NASM/YASM
wait
# Set up libx264
{
git clone --depth 1 "https://code.videolan.org/videolan/x264.git"
cd x264
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared \
--enable-pic \
--disable-cli
make -j${NUM_JOBS}
make install
cd ..
rm -rf x264
} &
# Set up libx265
{
# BitBucket dropped support for Mercurial repos
#hg clone https://bitbucket.org/multicoreware/x265
git clone --depth 1 "https://bitbucket.org/multicoreware/x265_git.git" x265
cd x265/build/linux
cmake \
-G "Unix Makefiles" \
-DCMAKE_INSTALL_PREFIX="${OLIVE_INSTALL_PREFIX}" \
../../source
make -j${NUM_JOBS}
make install
cd ../../..
rm -rf x265
} &
# Set up libmp3lame
{
curl -fLsS -o lame.tar.gz "https://downloads.sourceforge.net/project/lame/lame/${LAME_VERSION}/lame-${LAME_VERSION}.tar.gz"
tar xf lame.tar.gz
rm -f lame.tar.gz
cd lame*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared \
--enable-nasm \
--disable-frontend
make -j${NUM_JOBS}
make install
cd ..
rm -rf lame*
} &
# Set up libopus
{
curl -fLsS -o opus.tar.gz "https://archive.mozilla.org/pub/opus/opus-${OPUS_VERSION}.tar.gz"
tar xf opus.tar.gz
rm -f opus.tar.gz
cd opus*
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared
make -j${NUM_JOBS}
make install
cd ..
rm -rf opus*
} &
# Set up libvpx
{
git clone --depth 1 "https://chromium.googlesource.com/webm/libvpx.git"
cd libvpx
./configure \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--enable-shared \
--enable-pic \
--enable-vp9-highbitdepth \
--as=yasm \
--disable-examples \
--disable-unit-tests \
--disable-docs \
--disable-install-bins
make -j${NUM_JOBS}
make install
cd ..
rm -rf libvpx
} &
# join all jobs
wait
curl -fLsS -o ffmpeg.tar.xz "https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.xz"
tar xf ffmpeg.tar.xz
cd ffmpeg*
# TODO: --enable-debug?
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" ./configure \
--disable-doc \
--disable-ffplay \
--enable-gpl \
--enable-version3 \
--enable-shared \
--enable-libfreetype \
--enable-libmp3lame \
--enable-libopus \
--enable-libvpx \
--enable-libx264 \
--enable-libx265 \
--prefix="${OLIVE_INSTALL_PREFIX}" \
--extra-libs=-lpthread \
--extra-libs=-lm \
--extra-cflags="-I${OLIVE_INSTALL_PREFIX}/include" \
--extra-ldflags="-L${OLIVE_INSTALL_PREFIX}/lib"
make -j${NUM_JOBS}
make install
cd ..
rm -rf ffmpeg*
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -ex
rm -rf /package
cd "${OLIVE_INSTALL_PREFIX}"
find . -type f -o -type l | cut -c3- > /tmp/previous-prefix-files.txt
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -ex
mkdir -p /package
cd "${OLIVE_INSTALL_PREFIX}"
find . -type l -o -type f | cut -c3- > /tmp/new-prefix-files.txt
rsync -av --files-from=/tmp/new-prefix-files.txt --exclude-from=/tmp/previous-prefix-files.txt . /package/
@@ -0,0 +1,74 @@
#!/usr/bin/env bash
# Copyright (C) 2019 Olive Team
# Copyright (c) Contributors to the aswf-docker Project. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 OR GPL-3.0-or-later
set -ex
# TODO: Check if this causes any problems. ASWF doesn't run a yum update.
yum update -y
# TODO: Add deps of deps which are explicitly listed in aswf-docker?
yum install --setopt=tsflags=nodocs -y \
bzip2-devel \
cups-libs \
freetype-devel \
giflib-devel \
gstreamer1 gstreamer1-devel \
gstreamer1-plugins-bad-free gstreamer1-plugins-bad-free-devel \
libicu-devel \
libmng-devel \
LibRaw-devel \
libwebp-devel \
libXcomposite libXcomposite-devel \
libXcursor libXcursor-devel \
libxkbcommon libxkbcommon-devel \
libxkbcommon-x11-devel \
libXScrnSaver libXScrnSaver-devel \
mesa-libGL-devel \
openjpeg2-devel \
pciutils-devel \
pulseaudio-libs pulseaudio-libs-devel \
python3-tkinter \
zlib-devel
# This is needed for Xvfb to function properly.
dbus-uuidgen > /etc/machine-id
yum -y groupinstall "Development Tools"
# TODO: Below code installs the obsolete devtoolset-6.
# Unclear which devtoolset it will be for VFX platform CY2021:
# https://groups.google.com/forum/#!topic/vfx-platform-discuss/_-_CPw1fD3c
yum install -y --setopt=tsflags=nodocs centos-release-scl-rh yum-utils
if [[ $DTS_VERSION == 6 ]]; then
# Use the centos vault as the original devtoolset-6 is not part of CentOS-7 anymore
sed -i 's/7/7.6.1810/g; s|^#\s*\(baseurl=http://\)mirror|\1vault|g; /mirrorlist/d' /etc/yum.repos.d/CentOS-SCLo-*.repo
fi
yum install -y --setopt=tsflags=nodocs \
"devtoolset-$DTS_VERSION-toolchain"
yum install -y epel-release
# Additional package that are not found initially
yum install -y \
rh-git218 \
# lame-devel
# libcaca-devel \
# libdb4-devel \
# libdc1394-devel \
# p7zip \
# yasm-devel \
# zvbi-devel
# TODO: Does clearing the cache have any negative side effects?
yum clean all
# HACK: Qt5GuiConfigExtras.cmake expects libGL.so in /usr/local/lib64 but it gets installed to /usr/lib64
ln -s /usr/lib64/libGL.so /usr/local/lib64/
# Alternatively, we could edit /usr/local/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
# - _qt5gui_find_extra_libs(OPENGL "/usr/local/lib64/libGL.so" "" "")
# + _qt5gui_find_extra_libs(OPENGL "/usr/lib64/libGL.so" "" "")