Skip to content

Commit

Permalink
Merge branch 'master' into ubuntu20fix
Browse files Browse the repository at this point in the history
  • Loading branch information
culhatsker authored Nov 14, 2024
2 parents 26d00c8 + e4d20ee commit a0ab488
Show file tree
Hide file tree
Showing 23 changed files with 4,985 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/images_build_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04]
image_os: [ubuntu20]
image_os: [ubuntu22]
image_distribution: [runtime]
exclude:
- os: ubuntu-20.04
Expand Down
3,248 changes: 3,248 additions & 0 deletions dockerfiles/ubuntu24/third-party-programs-docker-dev.txt

Large diffs are not rendered by default.

1,243 changes: 1,243 additions & 0 deletions dockerfiles/ubuntu24/third-party-programs-docker-runtime.txt

Large diffs are not rendered by default.

43 changes: 22 additions & 21 deletions templates/rhel8/common/base.dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,33 +32,33 @@ FROM base as opencv
LABEL description="This is the dev image for OpenCV building with OpenVINO Runtime backend"
LABEL vendor="Intel Corporation"

RUN rm -f /etc/rhsm-host
{% if 'autobuild' != rhel_platform %}
COPY ./entitlement /etc/pki/entitlement
COPY ./rhsm-conf /etc/rhsm
COPY ./rhsm-ca /etc/rhsm/ca
{% endif %}

RUN rm -f /etc/rhsm-host && subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf clean all
RUN dnf install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm && dnf clean all
# hadolint ignore=DL3033
RUN yum install -y \
gtk3-devel \
gstreamer1-devel \
gstreamer1-plugins-base-devel \
ffmpeg-devel \
libmfx-devel \
cmake \
git \
python38-devel \
python38-pip \
gcc-c++ \
gcc && yum clean all
RUN subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm \
&& dnf install -y \
gtk3-devel \
gstreamer1-devel \
gstreamer1-plugins-base-devel \
ffmpeg-devel \
libmfx-devel \
cmake \
git \
python39-devel \
python39-pip \
gcc-c++ \
gcc \
&& dnf clean all

RUN rm -rf /etc/pki/entitlement && rm -rf /etc/rhsm

# hadolint ignore=DL3013
RUN python3 -m pip install --no-cache-dir numpy==1.23.1
ARG OPENCV_BRANCH="377be68d923e40900ac5526242bcf221e3f355e5" # 4.8 with a fix for building tests
ARG OPENCV_BRANCH=4.10.0
WORKDIR /opt/repo
RUN git clone https://github.com/opencv/opencv.git
WORKDIR /opt/repo/opencv
Expand Down Expand Up @@ -187,13 +187,14 @@ COPY --from=base /opt/intel /opt/intel
{% endif %}

{% if 'runtime' == distribution %}
ARG LGPL_DEPS="bash" # no new packages
ARG LGPL_DEPS="bash python39" # no new packages
ARG INSTALL_PACKAGES="-c=python -c=core"
{% else %}
ARG LGPL_DEPS="gcc-c++ \
glibc \
libstdc++ \
libgcc"
libgcc \
python39"
ARG INSTALL_PACKAGES="-c=opencv_req -c=python -c=opencv_opt -c=core -c=dev"
{% endif %}
ARG INSTALL_SOURCES="no"
Expand Down
4 changes: 0 additions & 4 deletions templates/rhel8/python/python38.dockerfile.j2

This file was deleted.

4 changes: 4 additions & 0 deletions templates/rhel8/python/python39.dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# setup Python
ENV PYTHON_VER python3.9

RUN ${PYTHON_VER} -m pip install --upgrade pip
271 changes: 271 additions & 0 deletions templates/ubuntu24/common/base.dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,271 @@
# Copyright (C) 2019-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
FROM ubuntu:24.04 AS base

# hadolint ignore=DL3002
USER root
WORKDIR /

SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

ENV DEBIAN_FRONTEND=noninteractive

# hadolint ignore=DL3008
RUN apt-get update && \
apt-get install -y --no-install-recommends curl tzdata ca-certificates && \
rm -rf /var/lib/apt/lists/*

{% for pre_command in pre_commands %}
{{ pre_command|safe }}
{% endfor %}
RUN rm -rf ${INTEL_OPENVINO_DIR}/.distribution && mkdir ${INTEL_OPENVINO_DIR}/.distribution && \
touch ${INTEL_OPENVINO_DIR}/.distribution/docker
# -----------------

{% if distribution == 'dev' %}

FROM base AS opencv

LABEL description="This is the dev image for OpenCV building with OpenVINO Runtime backend"
LABEL vendor="Intel Corporation"

SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

# hadolint ignore=DL3008
RUN apt-get update; \
apt-get install -y --no-install-recommends \
git \
python3-dev \
python3-pip \
python3-venv \
build-essential \
cmake \
ninja-build \
libgtk-3-dev \
libpng-dev \
libjpeg-dev \
libwebp-dev \
libtiff5-dev \
libopenexr-dev \
libopenblas-dev \
libx11-dev \
libavutil-dev \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
libswresample-dev \
# libtbb2 \
libssl-dev \
libva-dev \
libmfx-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev && \
rm -rf /var/lib/apt/lists/*

ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH=$VIRTUAL_ENV/bin:$PATH

RUN python3 -m pip install --no-cache-dir --upgrade pip
RUN python3 -m pip install --no-cache-dir numpy==1.26.4

ARG OPENCV_BRANCH=4.10.0
WORKDIR /opt/repo
RUN git clone https://github.com/opencv/opencv.git
WORKDIR /opt/repo/opencv
RUN git checkout ${OPENCV_BRANCH}
WORKDIR /opt/repo/opencv/build

# hadolint ignore=SC1091
RUN . "${INTEL_OPENVINO_DIR}"/setupvars.sh; \
cmake -G Ninja \
-D BUILD_INFO_SKIP_EXTRA_MODULES=ON \
-D BUILD_EXAMPLES=OFF \
-D BUILD_JASPER=OFF \
-D BUILD_JAVA=OFF \
-D BUILD_JPEG=ON \
-D BUILD_APPS_LIST=version \
-D BUILD_opencv_apps=ON \
-D BUILD_opencv_java=OFF \
-D BUILD_OPENEXR=OFF \
-D BUILD_PNG=ON \
-D BUILD_TBB=OFF \
-D BUILD_WEBP=OFF \
-D BUILD_ZLIB=ON \
-D BUILD_TESTS=ON \
-D WITH_1394=OFF \
-D WITH_CUDA=OFF \
-D WITH_EIGEN=OFF \
-D WITH_GPHOTO2=OFF \
-D WITH_GSTREAMER=ON \
-D OPENCV_GAPI_GSTREAMER=OFF \
-D WITH_GTK_2_X=OFF \
-D WITH_IPP=ON \
-D WITH_JASPER=OFF \
-D WITH_LAPACK=OFF \
-D WITH_MATLAB=OFF \
-D WITH_MFX=ON \
-D WITH_OPENCLAMDBLAS=OFF \
-D WITH_OPENCLAMDFFT=OFF \
-D WITH_OPENEXR=OFF \
-D WITH_OPENJPEG=OFF \
-D WITH_QUIRC=OFF \
-D WITH_TBB=OFF \
-D WITH_TIFF=OFF \
-D WITH_VTK=OFF \
-D WITH_WEBP=OFF \
-D CMAKE_USE_RELATIVE_PATHS=ON \
-D CMAKE_SKIP_INSTALL_RPATH=ON \
-D ENABLE_BUILD_HARDENING=ON \
-D ENABLE_CONFIG_VERIFICATION=ON \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D ENABLE_CXX11=ON \
-D INSTALL_PDB=ON \
-D INSTALL_TESTS=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=OFF \
-D CMAKE_INSTALL_PREFIX=install \
-D OPENCV_SKIP_PKGCONFIG_GENERATION=ON \
-D OPENCV_SKIP_PYTHON_LOADER=OFF \
-D OPENCV_SKIP_CMAKE_ROOT_CONFIG=ON \
-D OPENCV_GENERATE_SETUPVARS=OFF \
-D OPENCV_BIN_INSTALL_PATH=bin \
-D OPENCV_INCLUDE_INSTALL_PATH=include \
-D OPENCV_LIB_INSTALL_PATH=lib \
-D OPENCV_CONFIG_INSTALL_PATH=cmake \
-D OPENCV_3P_LIB_INSTALL_PATH=3rdparty \
-D OPENCV_DOC_INSTALL_PATH=doc \
-D OPENCV_OTHER_INSTALL_PATH=etc \
-D OPENCV_LICENSES_INSTALL_PATH=etc/licenses \
-D OPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT=ON \
-D BUILD_opencv_world=OFF \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D BUILD_opencv_dnn=OFF \
-D BUILD_opencv_gapi=OFF \
-D PYTHON3_PACKAGES_PATH=install/python/python3 \
-D PYTHON3_LIMITED_API=ON \
-D HIGHGUI_PLUGIN_LIST=all \
-D OPENCV_PYTHON_INSTALL_PATH=python \
-D CPU_BASELINE=SSE4_2 \
-D OPENCV_IPP_GAUSSIAN_BLUR=ON \
-D WITH_INF_ENGINE=ON \
-D InferenceEngine_DIR="${INTEL_OPENVINO_DIR}"/runtime/cmake/ \
-D ngraph_DIR="${INTEL_OPENVINO_DIR}"/runtime/cmake/ \
-D INF_ENGINE_RELEASE=2022010000 \
-D VIDEOIO_PLUGIN_LIST=ffmpeg,gstreamer,mfx \
-D CMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \
-D CMAKE_BUILD_TYPE=Release /opt/repo/opencv && \
ninja -j "$(nproc)" && cmake --install . && \
rm -Rf install/bin install/etc/samples

WORKDIR /opt/repo/opencv/build/install
CMD ["/bin/bash"]
# -------------------------------------------------------------------------------------------------
{% endif %}

FROM ubuntu:24.04 AS ov_base

LABEL description="This is the {{ distribution }} image for {{ product_name }} on Ubuntu 22.04 LTS"
LABEL vendor="Intel Corporation"

USER root
WORKDIR /

SHELL ["/bin/bash", "-xo", "pipefail", "-c"]

ENV DEBIAN_FRONTEND=noninteractive

# Creating user openvino and adding it to groups "video" and "users" to use GPU and VPU
RUN sed -ri -e 's@^UMASK[[:space:]]+[[:digit:]]+@UMASK 000@g' /etc/login.defs && \
grep -E "^UMASK" /etc/login.defs && useradd -ms /bin/bash -G video,users openvino && \
chown openvino -R /home/openvino

RUN mkdir /opt/intel

ENV INTEL_OPENVINO_DIR /opt/intel/openvino

COPY --from=base /opt/intel/ /opt/intel/

WORKDIR /thirdparty

ARG INSTALL_SOURCES="no"

ARG DEPS="tzdata \
curl"
{% if 'runtime' == distribution %}
ARG LGPL_DEPS=""
ARG INSTALL_PACKAGES="-c=python -c=core"
{% elif 'dev' == distribution or 'dev_no_samples' == distribution %}
ARG LGPL_DEPS="g++ \
gcc \
libc6-dev"
ARG INSTALL_PACKAGES="-c=python -c=core -c=dev"
{% else %}
ARG LGPL_DEPS="g++ \
gcc \
libc6-dev"
ARG INSTALL_PACKAGES="-c=python"
{% endif %}

# hadolint ignore=DL3008
RUN apt-get update && \
dpkg --get-selections | grep -v deinstall | awk '{print $1}' > base_packages.txt && \
apt-get install -y --no-install-recommends ${DEPS} && \
rm -rf /var/lib/apt/lists/*

RUN apt-get update && apt-get reinstall -y ca-certificates && rm -rf /var/lib/apt/lists/* && update-ca-certificates

# hadolint ignore=DL3008, SC2012
RUN apt-get update && \
apt-get install -y --no-install-recommends python3-venv ${LGPL_DEPS} && \
${INTEL_OPENVINO_DIR}/install_dependencies/install_openvino_dependencies.sh -y ${INSTALL_PACKAGES} && \
if [ "$INSTALL_SOURCES" = "yes" ]; then \
sed -Ei 's/# deb-src /deb-src /' /etc/apt/sources.list && \
apt-get update && \
dpkg --get-selections | grep -v deinstall | awk '{print $1}' > all_packages.txt && \
grep -v -f base_packages.txt all_packages.txt | while read line; do \
package=$(echo $line); \
name=(${package//:/ }); \
grep -l GPL /usr/share/doc/${name[0]}/copyright; \
exit_status=$?; \
if [ $exit_status -eq 0 ]; then \
apt-get source -q --download-only $package; \
fi \
done && \
echo "Download source for $(ls | wc -l) third-party packages: $(du -sh)"; fi && \
rm /usr/lib/python3.*/lib-dynload/readline.cpython-3*-gnu.so && rm -rf /var/lib/apt/lists/*

RUN curl -L -O https://github.com/oneapi-src/oneTBB/releases/download/v2021.9.0/oneapi-tbb-2021.9.0-lin.tgz && \
tar -xzf oneapi-tbb-2021.9.0-lin.tgz&& \
cp oneapi-tbb-2021.9.0/lib/intel64/gcc4.8/libtbb.so* /opt/intel/openvino/runtime/lib/intel64/ && \
rm -Rf oneapi-tbb-2021.9.0*

WORKDIR ${INTEL_OPENVINO_DIR}/licensing
RUN if [ "$INSTALL_SOURCES" = "no" ]; then \
echo "This image doesn't contain source for 3d party components under LGPL/GPL licenses. They are stored in https://storage.openvinotoolkit.org/repositories/openvino/ci_dependencies/container_gpl_sources/." > DockerImage_readme.txt ; \
fi

{% for command in commands %}
{{ command|safe }}
{% endfor %}

# Post-installation cleanup and setting up OpenVINO environment variables
ENV LIBVA_DRIVER_NAME=iHD
ENV GST_VAAPI_ALL_DRIVERS=1
ENV LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri

RUN apt-get update && \
apt-get autoremove -y gfortran && \
rm -rf /var/lib/apt/lists/*

USER openvino
WORKDIR ${INTEL_OPENVINO_DIR}
ENV DEBIAN_FRONTEND=noninteractive

CMD ["/bin/bash"]

# Setup custom layers below
{% for layer in layers %}
{{ layer|safe }}
{% endfor %}
Loading

0 comments on commit a0ab488

Please sign in to comment.