mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	Update base image (#15103)
* Change base image * Update python * Update coral library * Fix source file * Install correct apt packages * Cleanup * Fix installation of coral deps * fix python installations * Fix devcontainer build * Get tensorrt build working * Update other deps * Filter out tflite log * Get ROCm build working * Get rockchip build working * Get hailo build working * Add note to comment
This commit is contained in:
		
							parent
							
								
									99992fd18f
								
							
						
					
					
						commit
						0aabf9a24f
					
				@ -5,6 +5,7 @@ ARG DEBIAN_FRONTEND=noninteractive
 | 
				
			|||||||
# Build Python wheels
 | 
					# Build Python wheels
 | 
				
			||||||
FROM wheels AS h8l-wheels
 | 
					FROM wheels AS h8l-wheels
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN python3 -m pip config set global.break-system-packages true
 | 
				
			||||||
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
 | 
					COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
 | 
				
			||||||
COPY docker/hailo8l/requirements-wheels-h8l.txt /requirements-wheels-h8l.txt
 | 
					COPY docker/hailo8l/requirements-wheels-h8l.txt /requirements-wheels-h8l.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -30,6 +31,7 @@ COPY --from=hailort /hailo-wheels /deps/hailo-wheels
 | 
				
			|||||||
COPY --from=hailort /rootfs/ /
 | 
					COPY --from=hailort /rootfs/ /
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Install the wheels
 | 
					# Install the wheels
 | 
				
			||||||
 | 
					RUN python3 -m pip config set global.break-system-packages true
 | 
				
			||||||
RUN pip3 install -U /deps/h8l-wheels/*.whl
 | 
					RUN pip3 install -U /deps/h8l-wheels/*.whl
 | 
				
			||||||
RUN pip3 install -U /deps/hailo-wheels/*.whl
 | 
					RUN pip3 install -U /deps/hailo-wheels/*.whl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -15,5 +15,5 @@ wget -qO- "https://github.com/frigate-nvr/hailort/releases/download/v${hailo_ver
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
mkdir -p /hailo-wheels
 | 
					mkdir -p /hailo-wheels
 | 
				
			||||||
 | 
					
 | 
				
			||||||
wget -P /hailo-wheels/ "https://github.com/frigate-nvr/hailort/releases/download/v${hailo_version}/hailort-${hailo_version}-cp39-cp39-linux_${arch}.whl"
 | 
					wget -P /hailo-wheels/ "https://github.com/frigate-nvr/hailort/releases/download/v${hailo_version}/hailort-${hailo_version}-cp311-cp311-linux_${arch}.whl"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -3,12 +3,12 @@
 | 
				
			|||||||
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
 | 
					# https://askubuntu.com/questions/972516/debian-frontend-environment-variable
 | 
				
			||||||
ARG DEBIAN_FRONTEND=noninteractive
 | 
					ARG DEBIAN_FRONTEND=noninteractive
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ARG BASE_IMAGE=debian:11
 | 
					ARG BASE_IMAGE=debian:12
 | 
				
			||||||
ARG SLIM_BASE=debian:11-slim
 | 
					ARG SLIM_BASE=debian:12-slim
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM ${BASE_IMAGE} AS base
 | 
					FROM ${BASE_IMAGE} AS base
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM --platform=${BUILDPLATFORM} debian:11 AS base_host
 | 
					FROM --platform=${BUILDPLATFORM} debian:12 AS base_host
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM ${SLIM_BASE} AS slim-base
 | 
					FROM ${SLIM_BASE} AS slim-base
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -66,8 +66,8 @@ COPY docker/main/requirements-ov.txt /requirements-ov.txt
 | 
				
			|||||||
RUN apt-get -qq update \
 | 
					RUN apt-get -qq update \
 | 
				
			||||||
    && apt-get -qq install -y wget python3 python3-dev python3-distutils gcc pkg-config libhdf5-dev \
 | 
					    && apt-get -qq install -y wget python3 python3-dev python3-distutils gcc pkg-config libhdf5-dev \
 | 
				
			||||||
    && wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
 | 
					    && wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
 | 
				
			||||||
    && python3 get-pip.py "pip" \
 | 
					    && python3 get-pip.py "pip" --break-system-packages \
 | 
				
			||||||
    && pip install -r /requirements-ov.txt
 | 
					    && pip install --break-system-packages -r /requirements-ov.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Get OpenVino Model
 | 
					# Get OpenVino Model
 | 
				
			||||||
RUN --mount=type=bind,source=docker/main/build_ov_model.py,target=/build_ov_model.py \
 | 
					RUN --mount=type=bind,source=docker/main/build_ov_model.py,target=/build_ov_model.py \
 | 
				
			||||||
@ -139,24 +139,17 @@ ARG TARGETARCH
 | 
				
			|||||||
# Use a separate container to build wheels to prevent build dependencies in final image
 | 
					# Use a separate container to build wheels to prevent build dependencies in final image
 | 
				
			||||||
RUN apt-get -qq update \
 | 
					RUN apt-get -qq update \
 | 
				
			||||||
    && apt-get -qq install -y \
 | 
					    && apt-get -qq install -y \
 | 
				
			||||||
    apt-transport-https \
 | 
					    apt-transport-https wget \
 | 
				
			||||||
    gnupg \
 | 
					 | 
				
			||||||
    wget \
 | 
					 | 
				
			||||||
    # the key fingerprint can be obtained from https://ftp-master.debian.org/keys.html
 | 
					 | 
				
			||||||
    && wget -qO- "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA4285295FC7B1A81600062A9605C66F00D6C9793" | \
 | 
					 | 
				
			||||||
    gpg --dearmor > /usr/share/keyrings/debian-archive-bullseye-stable.gpg \
 | 
					 | 
				
			||||||
    && echo "deb [signed-by=/usr/share/keyrings/debian-archive-bullseye-stable.gpg] http://deb.debian.org/debian bullseye main contrib non-free" | \
 | 
					 | 
				
			||||||
    tee /etc/apt/sources.list.d/debian-bullseye-nonfree.list \
 | 
					 | 
				
			||||||
    && apt-get -qq update \
 | 
					    && apt-get -qq update \
 | 
				
			||||||
    && apt-get -qq install -y \
 | 
					    && apt-get -qq install -y \
 | 
				
			||||||
    python3.9 \
 | 
					    python3 \
 | 
				
			||||||
    python3.9-dev \
 | 
					    python3-dev \
 | 
				
			||||||
    # opencv dependencies
 | 
					    # opencv dependencies
 | 
				
			||||||
    build-essential cmake git pkg-config libgtk-3-dev \
 | 
					    build-essential cmake git pkg-config libgtk-3-dev \
 | 
				
			||||||
    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
 | 
					    libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
 | 
				
			||||||
    libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
 | 
					    libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \
 | 
				
			||||||
    gfortran openexr libatlas-base-dev libssl-dev\
 | 
					    gfortran openexr libatlas-base-dev libssl-dev\
 | 
				
			||||||
    libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \
 | 
					    libtbbmalloc2 libtbb-dev libdc1394-dev libopenexr-dev \
 | 
				
			||||||
    libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
 | 
					    libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev \
 | 
				
			||||||
    # sqlite3 dependencies
 | 
					    # sqlite3 dependencies
 | 
				
			||||||
    tclsh \
 | 
					    tclsh \
 | 
				
			||||||
@ -164,14 +157,11 @@ RUN apt-get -qq update \
 | 
				
			|||||||
    gcc gfortran libopenblas-dev liblapack-dev && \
 | 
					    gcc gfortran libopenblas-dev liblapack-dev && \
 | 
				
			||||||
    rm -rf /var/lib/apt/lists/*
 | 
					    rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Ensure python3 defaults to python3.9
 | 
					 | 
				
			||||||
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
 | 
					RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
 | 
				
			||||||
    && python3 get-pip.py "pip"
 | 
					    && python3 get-pip.py "pip" --break-system-packages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY docker/main/requirements.txt /requirements.txt
 | 
					COPY docker/main/requirements.txt /requirements.txt
 | 
				
			||||||
RUN pip3 install -r /requirements.txt
 | 
					RUN pip3 install -r /requirements.txt --break-system-packages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Build pysqlite3 from source
 | 
					# Build pysqlite3 from source
 | 
				
			||||||
COPY docker/main/build_pysqlite3.sh /build_pysqlite3.sh
 | 
					COPY docker/main/build_pysqlite3.sh /build_pysqlite3.sh
 | 
				
			||||||
@ -221,8 +211,8 @@ RUN --mount=type=bind,source=docker/main/install_deps.sh,target=/deps/install_de
 | 
				
			|||||||
    /deps/install_deps.sh
 | 
					    /deps/install_deps.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
 | 
					RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
 | 
				
			||||||
    python3 -m pip install --upgrade pip && \
 | 
					    python3 -m pip install --upgrade pip --break-system-packages && \
 | 
				
			||||||
    pip3 install -U /deps/wheels/*.whl
 | 
					    pip3 install -U /deps/wheels/*.whl --break-system-packages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY --from=deps-rootfs / /
 | 
					COPY --from=deps-rootfs / /
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -269,7 +259,7 @@ RUN apt-get update \
 | 
				
			|||||||
    && rm -rf /var/lib/apt/lists/*
 | 
					    && rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN --mount=type=bind,source=./docker/main/requirements-dev.txt,target=/workspace/frigate/requirements-dev.txt \
 | 
					RUN --mount=type=bind,source=./docker/main/requirements-dev.txt,target=/workspace/frigate/requirements-dev.txt \
 | 
				
			||||||
    pip3 install -r requirements-dev.txt
 | 
					    pip3 install -r requirements-dev.txt --break-system-packages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
HEALTHCHECK NONE
 | 
					HEALTHCHECK NONE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -8,8 +8,7 @@ SECURE_TOKEN_MODULE_VERSION="1.5"
 | 
				
			|||||||
SET_MISC_MODULE_VERSION="v0.33"
 | 
					SET_MISC_MODULE_VERSION="v0.33"
 | 
				
			||||||
NGX_DEVEL_KIT_VERSION="v0.3.3"
 | 
					NGX_DEVEL_KIT_VERSION="v0.3.3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cp /etc/apt/sources.list /etc/apt/sources.list.d/sources-src.list
 | 
					sed -i '/^Types:/s/deb/& deb-src/' /etc/apt/sources.list.d/debian.sources
 | 
				
			||||||
sed -i 's|deb http|deb-src http|g' /etc/apt/sources.list.d/sources-src.list
 | 
					 | 
				
			||||||
apt-get update
 | 
					apt-get update
 | 
				
			||||||
 | 
					
 | 
				
			||||||
apt-get -yqq build-dep nginx
 | 
					apt-get -yqq build-dep nginx
 | 
				
			||||||
 | 
				
			|||||||
@ -4,7 +4,7 @@ from openvino.tools import mo
 | 
				
			|||||||
ov_model = mo.convert_model(
 | 
					ov_model = mo.convert_model(
 | 
				
			||||||
    "/models/ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb",
 | 
					    "/models/ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb",
 | 
				
			||||||
    compress_to_fp16=True,
 | 
					    compress_to_fp16=True,
 | 
				
			||||||
    transformations_config="/usr/local/lib/python3.9/dist-packages/openvino/tools/mo/front/tf/ssd_v2_support.json",
 | 
					    transformations_config="/usr/local/lib/python3.11/dist-packages/openvino/tools/mo/front/tf/ssd_v2_support.json",
 | 
				
			||||||
    tensorflow_object_detection_api_pipeline_config="/models/ssdlite_mobilenet_v2_coco_2018_05_09/pipeline.config",
 | 
					    tensorflow_object_detection_api_pipeline_config="/models/ssdlite_mobilenet_v2_coco_2018_05_09/pipeline.config",
 | 
				
			||||||
    reverse_input_channels=True,
 | 
					    reverse_input_channels=True,
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
				
			|||||||
@ -4,8 +4,7 @@ set -euxo pipefail
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SQLITE_VEC_VERSION="0.1.3"
 | 
					SQLITE_VEC_VERSION="0.1.3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cp /etc/apt/sources.list /etc/apt/sources.list.d/sources-src.list
 | 
					sed -i '/^Types:/s/deb/& deb-src/' /etc/apt/sources.list.d/debian.sources
 | 
				
			||||||
sed -i 's|deb http|deb-src http|g' /etc/apt/sources.list.d/sources-src.list
 | 
					 | 
				
			||||||
apt-get update
 | 
					apt-get update
 | 
				
			||||||
apt-get -yqq build-dep sqlite3 gettext git
 | 
					apt-get -yqq build-dep sqlite3 gettext git
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -11,35 +11,34 @@ apt-get -qq install --no-install-recommends -y \
 | 
				
			|||||||
    lbzip2 \
 | 
					    lbzip2 \
 | 
				
			||||||
    procps vainfo \
 | 
					    procps vainfo \
 | 
				
			||||||
    unzip locales tzdata libxml2 xz-utils \
 | 
					    unzip locales tzdata libxml2 xz-utils \
 | 
				
			||||||
    python3.9 \
 | 
					    python3 \
 | 
				
			||||||
    python3-pip \
 | 
					    python3-pip \
 | 
				
			||||||
    curl \
 | 
					    curl \
 | 
				
			||||||
    lsof \
 | 
					    lsof \
 | 
				
			||||||
    jq \
 | 
					    jq \
 | 
				
			||||||
    nethogs \
 | 
					    nethogs \
 | 
				
			||||||
    libgl1 \
 | 
					    libgl1 \
 | 
				
			||||||
    libglib2.0-0
 | 
					    libglib2.0-0 \
 | 
				
			||||||
 | 
					    libusb-1.0.0
 | 
				
			||||||
# ensure python3 defaults to python3.9
 | 
					 | 
				
			||||||
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
mkdir -p -m 600 /root/.gnupg
 | 
					mkdir -p -m 600 /root/.gnupg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# add coral repo
 | 
					# install coral runtime
 | 
				
			||||||
curl -fsSLo - https://packages.cloud.google.com/apt/doc/apt-key.gpg | \
 | 
					wget -q -O /tmp/libedgetpu1-max.deb "https://github.com/feranick/libedgetpu/releases/download/16.0TF2.17.0-1/libedgetpu1-max_16.0tf2.17.0-1.bookworm_${TARGETARCH}.deb"
 | 
				
			||||||
    gpg --dearmor -o /etc/apt/trusted.gpg.d/google-cloud-packages-archive-keyring.gpg
 | 
					unset DEBIAN_FRONTEND
 | 
				
			||||||
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list
 | 
					yes | dpkg -i /tmp/libedgetpu1-max.deb && export DEBIAN_FRONTEND=noninteractive
 | 
				
			||||||
echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections
 | 
					rm /tmp/libedgetpu1-max.deb
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# enable non-free repo in Debian
 | 
					# install python3 & tflite runtime
 | 
				
			||||||
if grep -q "Debian" /etc/issue; then
 | 
					if [[ "${TARGETARCH}" == "amd64" ]]; then
 | 
				
			||||||
    sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list
 | 
					    pip3 install --break-system-packages https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp311-cp311-linux_x86_64.whl
 | 
				
			||||||
 | 
					    pip3 install --break-system-packages https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp311-cp311-linux_x86_64.whl
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# coral drivers
 | 
					if [[ "${TARGETARCH}" == "arm64" ]]; then
 | 
				
			||||||
apt-get -qq update
 | 
					    pip3 install --break-system-packages https://github.com/feranick/TFlite-builds/releases/download/v2.17.0/tflite_runtime-2.17.0-cp311-cp311-linux_aarch64.whl
 | 
				
			||||||
apt-get -qq install --no-install-recommends --no-install-suggests -y \
 | 
					    pip3 install --break-system-packages https://github.com/feranick/pycoral/releases/download/2.0.2TF2.17.0/pycoral-2.0.2-cp311-cp311-linux_aarch64.whl
 | 
				
			||||||
    libedgetpu1-max python3-tflite-runtime python3-pycoral
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# btbn-ffmpeg -> amd64
 | 
					# btbn-ffmpeg -> amd64
 | 
				
			||||||
if [[ "${TARGETARCH}" == "amd64" ]]; then
 | 
					if [[ "${TARGETARCH}" == "amd64" ]]; then
 | 
				
			||||||
@ -67,23 +66,15 @@ fi
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# arch specific packages
 | 
					# arch specific packages
 | 
				
			||||||
if [[ "${TARGETARCH}" == "amd64" ]]; then
 | 
					if [[ "${TARGETARCH}" == "amd64" ]]; then
 | 
				
			||||||
    # use debian bookworm for amd / intel-i965 driver packages
 | 
					    # install amd / intel-i965 driver packages
 | 
				
			||||||
    echo 'deb https://deb.debian.org/debian bookworm main contrib non-free' >/etc/apt/sources.list.d/debian-bookworm.list
 | 
					 | 
				
			||||||
    apt-get -qq update
 | 
					 | 
				
			||||||
    apt-get -qq install --no-install-recommends --no-install-suggests -y \
 | 
					    apt-get -qq install --no-install-recommends --no-install-suggests -y \
 | 
				
			||||||
        i965-va-driver intel-gpu-tools onevpl-tools \
 | 
					        i965-va-driver intel-gpu-tools onevpl-tools \
 | 
				
			||||||
        libva-drm2 \
 | 
					        libva-drm2 \
 | 
				
			||||||
        mesa-va-drivers radeontop
 | 
					        mesa-va-drivers radeontop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # something about this dependency requires it to be installed in a separate call rather than in the line above
 | 
					 | 
				
			||||||
    apt-get -qq install --no-install-recommends --no-install-suggests -y \
 | 
					 | 
				
			||||||
        i965-va-driver-shaders
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # intel packages use zst compression so we need to update dpkg
 | 
					    # intel packages use zst compression so we need to update dpkg
 | 
				
			||||||
    apt-get install -y dpkg
 | 
					    apt-get install -y dpkg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rm -f /etc/apt/sources.list.d/debian-bookworm.list
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # use intel apt intel packages
 | 
					    # use intel apt intel packages
 | 
				
			||||||
    wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
 | 
					    wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --yes --dearmor --output /usr/share/keyrings/intel-graphics.gpg
 | 
				
			||||||
    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | tee /etc/apt/sources.list.d/intel-gpu-jammy.list
 | 
					    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy client" | tee /etc/apt/sources.list.d/intel-gpu-jammy.list
 | 
				
			||||||
 | 
				
			|||||||
@ -7,13 +7,14 @@ FROM wheels as rk-wheels
 | 
				
			|||||||
COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
 | 
					COPY docker/main/requirements-wheels.txt /requirements-wheels.txt
 | 
				
			||||||
COPY docker/rockchip/requirements-wheels-rk.txt /requirements-wheels-rk.txt
 | 
					COPY docker/rockchip/requirements-wheels-rk.txt /requirements-wheels-rk.txt
 | 
				
			||||||
RUN sed -i "/https:\/\//d" /requirements-wheels.txt
 | 
					RUN sed -i "/https:\/\//d" /requirements-wheels.txt
 | 
				
			||||||
 | 
					RUN python3 -m pip config set global.break-system-packages true
 | 
				
			||||||
RUN pip3 wheel --wheel-dir=/rk-wheels -c /requirements-wheels.txt -r /requirements-wheels-rk.txt
 | 
					RUN pip3 wheel --wheel-dir=/rk-wheels -c /requirements-wheels.txt -r /requirements-wheels-rk.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM deps AS rk-frigate
 | 
					FROM deps AS rk-frigate
 | 
				
			||||||
ARG TARGETARCH
 | 
					ARG TARGETARCH
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN --mount=type=bind,from=rk-wheels,source=/rk-wheels,target=/deps/rk-wheels \
 | 
					RUN --mount=type=bind,from=rk-wheels,source=/rk-wheels,target=/deps/rk-wheels \
 | 
				
			||||||
    pip3 install -U /deps/rk-wheels/*.whl
 | 
					    pip3 install -U /deps/rk-wheels/*.whl --break-system-packages
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WORKDIR /opt/frigate/
 | 
					WORKDIR /opt/frigate/
 | 
				
			||||||
COPY --from=rootfs / /
 | 
					COPY --from=rootfs / /
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +1 @@
 | 
				
			|||||||
rknn-toolkit-lite2 @ https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.0.0/rknn_toolkit_lite2-2.0.0b0-cp39-cp39-linux_aarch64.whl
 | 
					rknn-toolkit-lite2 @ https://github.com/MarcA711/rknn-toolkit2/releases/download/v2.0.0/rknn_toolkit_lite2-2.0.0b0-cp311-cp311-linux_aarch64.whl
 | 
				
			||||||
@ -34,7 +34,7 @@ RUN mkdir -p /opt/rocm-dist/etc/ld.so.conf.d/
 | 
				
			|||||||
RUN echo /opt/rocm/lib|tee /opt/rocm-dist/etc/ld.so.conf.d/rocm.conf
 | 
					RUN echo /opt/rocm/lib|tee /opt/rocm-dist/etc/ld.so.conf.d/rocm.conf
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#######################################################################
 | 
					#######################################################################
 | 
				
			||||||
FROM --platform=linux/amd64 debian:11 as debian-base
 | 
					FROM --platform=linux/amd64 debian:12 as debian-base
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN apt-get update && apt-get -y upgrade
 | 
					RUN apt-get update && apt-get -y upgrade
 | 
				
			||||||
RUN apt-get -y install --no-install-recommends libelf1 libdrm2 libdrm-amdgpu1 libnuma1 kmod
 | 
					RUN apt-get -y install --no-install-recommends libelf1 libdrm2 libdrm-amdgpu1 libnuma1 kmod
 | 
				
			||||||
@ -51,7 +51,7 @@ COPY --from=rocm /opt/rocm-$ROCM /opt/rocm-$ROCM
 | 
				
			|||||||
RUN ln -s /opt/rocm-$ROCM /opt/rocm
 | 
					RUN ln -s /opt/rocm-$ROCM /opt/rocm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN apt-get -y install g++ cmake
 | 
					RUN apt-get -y install g++ cmake
 | 
				
			||||||
RUN apt-get -y install python3-pybind11 python3.9-distutils python3-dev
 | 
					RUN apt-get -y install python3-pybind11 python3-distutils python3-dev
 | 
				
			||||||
 | 
					
 | 
				
			||||||
WORKDIR /opt/build
 | 
					WORKDIR /opt/build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -70,10 +70,11 @@ RUN apt-get -y install libnuma1
 | 
				
			|||||||
WORKDIR /opt/frigate/
 | 
					WORKDIR /opt/frigate/
 | 
				
			||||||
COPY --from=rootfs / /
 | 
					COPY --from=rootfs / /
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY docker/rocm/requirements-wheels-rocm.txt /requirements.txt
 | 
					# Temporarily disabled to see if a new wheel can be built to support py3.11
 | 
				
			||||||
RUN python3 -m pip install --upgrade pip \
 | 
					#COPY docker/rocm/requirements-wheels-rocm.txt /requirements.txt
 | 
				
			||||||
    && pip3 uninstall -y onnxruntime-openvino \
 | 
					#RUN python3 -m pip install --upgrade pip \
 | 
				
			||||||
    && pip3 install -r /requirements.txt
 | 
					#    && pip3 uninstall -y onnxruntime-openvino \
 | 
				
			||||||
 | 
					#    && pip3 install -r /requirements.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#######################################################################
 | 
					#######################################################################
 | 
				
			||||||
FROM scratch AS rocm-dist
 | 
					FROM scratch AS rocm-dist
 | 
				
			||||||
@ -86,12 +87,12 @@ COPY --from=rocm /opt/rocm-$ROCM/share/miopen/db/*$AMDGPU* /opt/rocm-$ROCM/share
 | 
				
			|||||||
COPY --from=rocm /opt/rocm-$ROCM/share/miopen/db/*gfx908* /opt/rocm-$ROCM/share/miopen/db/
 | 
					COPY --from=rocm /opt/rocm-$ROCM/share/miopen/db/*gfx908* /opt/rocm-$ROCM/share/miopen/db/
 | 
				
			||||||
COPY --from=rocm /opt/rocm-$ROCM/lib/rocblas/library/*$AMDGPU* /opt/rocm-$ROCM/lib/rocblas/library/
 | 
					COPY --from=rocm /opt/rocm-$ROCM/lib/rocblas/library/*$AMDGPU* /opt/rocm-$ROCM/lib/rocblas/library/
 | 
				
			||||||
COPY --from=rocm /opt/rocm-dist/ /
 | 
					COPY --from=rocm /opt/rocm-dist/ /
 | 
				
			||||||
COPY --from=debian-build /opt/rocm/lib/migraphx.cpython-39-x86_64-linux-gnu.so /opt/rocm-$ROCM/lib/
 | 
					COPY --from=debian-build /opt/rocm/lib/migraphx.cpython-311-x86_64-linux-gnu.so /opt/rocm-$ROCM/lib/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#######################################################################
 | 
					#######################################################################
 | 
				
			||||||
FROM deps-prelim AS rocm-prelim-hsa-override0
 | 
					FROM deps-prelim AS rocm-prelim-hsa-override0
 | 
				
			||||||
 | 
					\
 | 
				
			||||||
ENV HSA_ENABLE_SDMA=0
 | 
					    ENV HSA_ENABLE_SDMA=0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY --from=rocm-dist / /
 | 
					COPY --from=rocm-dist / /
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -24,7 +24,7 @@ sed -i -e's/ main/ main contrib non-free/g' /etc/apt/sources.list
 | 
				
			|||||||
if [[ "${TARGETARCH}" == "arm64" ]]; then
 | 
					if [[ "${TARGETARCH}" == "arm64" ]]; then
 | 
				
			||||||
    # add raspberry pi repo
 | 
					    # add raspberry pi repo
 | 
				
			||||||
    gpg --no-default-keyring --keyring /usr/share/keyrings/raspbian.gpg --keyserver keyserver.ubuntu.com --recv-keys 82B129927FA3303E
 | 
					    gpg --no-default-keyring --keyring /usr/share/keyrings/raspbian.gpg --keyserver keyserver.ubuntu.com --recv-keys 82B129927FA3303E
 | 
				
			||||||
    echo "deb [signed-by=/usr/share/keyrings/raspbian.gpg] https://archive.raspberrypi.org/debian/ bullseye main" | tee /etc/apt/sources.list.d/raspi.list
 | 
					    echo "deb [signed-by=/usr/share/keyrings/raspbian.gpg] https://archive.raspberrypi.org/debian/ bookworm main" | tee /etc/apt/sources.list.d/raspi.list
 | 
				
			||||||
    apt-get -qq update
 | 
					    apt-get -qq update
 | 
				
			||||||
    apt-get -qq install --no-install-recommends --no-install-suggests -y ffmpeg
 | 
					    apt-get -qq install --no-install-recommends --no-install-suggests -y ffmpeg
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
				
			|||||||
@ -7,18 +7,19 @@ ARG DEBIAN_FRONTEND=noninteractive
 | 
				
			|||||||
FROM wheels as trt-wheels
 | 
					FROM wheels as trt-wheels
 | 
				
			||||||
ARG DEBIAN_FRONTEND
 | 
					ARG DEBIAN_FRONTEND
 | 
				
			||||||
ARG TARGETARCH
 | 
					ARG TARGETARCH
 | 
				
			||||||
 | 
					RUN python3 -m pip config set global.break-system-packages true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Add TensorRT wheels to another folder
 | 
					# Add TensorRT wheels to another folder
 | 
				
			||||||
COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
 | 
					COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
 | 
				
			||||||
RUN mkdir -p /trt-wheels && pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt
 | 
					RUN mkdir -p /trt-wheels && pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM tensorrt-base AS frigate-tensorrt
 | 
					FROM tensorrt-base AS frigate-tensorrt
 | 
				
			||||||
ENV TRT_VER=8.5.3
 | 
					ENV TRT_VER=8.6.1
 | 
				
			||||||
 | 
					RUN python3 -m pip config set global.break-system-packages true
 | 
				
			||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
 | 
					RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
 | 
				
			||||||
    pip3 install -U /deps/trt-wheels/*.whl && \
 | 
					    pip3 install -U /deps/trt-wheels/*.whl --break-system-packages && \
 | 
				
			||||||
    ldconfig
 | 
					    ldconfig
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ENV LD_LIBRARY_PATH=/usr/local/lib/python3.9/dist-packages/tensorrt:/usr/local/cuda/lib64:/usr/local/lib/python3.9/dist-packages/nvidia/cufft/lib
 | 
					 | 
				
			||||||
WORKDIR /opt/frigate/
 | 
					WORKDIR /opt/frigate/
 | 
				
			||||||
COPY --from=rootfs / /
 | 
					COPY --from=rootfs / /
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -31,4 +32,4 @@ COPY --from=trt-deps /usr/local/cuda-12.1 /usr/local/cuda
 | 
				
			|||||||
COPY docker/tensorrt/detector/rootfs/ /
 | 
					COPY docker/tensorrt/detector/rootfs/ /
 | 
				
			||||||
COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
 | 
					COPY --from=trt-deps /usr/local/lib/libyolo_layer.so /usr/local/lib/libyolo_layer.so
 | 
				
			||||||
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
 | 
					RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
 | 
				
			||||||
    pip3 install -U /deps/trt-wheels/*.whl
 | 
					    pip3 install -U /deps/trt-wheels/*.whl --break-system-packages
 | 
				
			||||||
 | 
				
			|||||||
@ -41,11 +41,11 @@ RUN --mount=type=bind,source=docker/tensorrt/detector/build_python_tensorrt.sh,t
 | 
				
			|||||||
    && TENSORRT_VER=$(cat /etc/TENSORRT_VER) /deps/build_python_tensorrt.sh
 | 
					    && TENSORRT_VER=$(cat /etc/TENSORRT_VER) /deps/build_python_tensorrt.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
COPY docker/tensorrt/requirements-arm64.txt /requirements-tensorrt.txt
 | 
					COPY docker/tensorrt/requirements-arm64.txt /requirements-tensorrt.txt
 | 
				
			||||||
ADD https://nvidia.box.com/shared/static/9aemm4grzbbkfaesg5l7fplgjtmswhj8.whl /tmp/onnxruntime_gpu-1.15.1-cp39-cp39-linux_aarch64.whl
 | 
					ADD https://nvidia.box.com/shared/static/psl23iw3bh7hlgku0mjo1xekxpego3e3.whl /tmp/onnxruntime_gpu-1.15.1-cp311-cp311-linux_aarch64.whl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
RUN pip3 uninstall -y onnxruntime-openvino \
 | 
					RUN pip3 uninstall -y onnxruntime-openvino \
 | 
				
			||||||
    && pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt \
 | 
					    && pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt \
 | 
				
			||||||
    && pip3 install --no-deps /tmp/onnxruntime_gpu-1.15.1-cp39-cp39-linux_aarch64.whl
 | 
					    && pip3 install --no-deps /tmp/onnxruntime_gpu-1.15.1-cp311-cp311-linux_aarch64.whl
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FROM build-wheels AS trt-model-wheels
 | 
					FROM build-wheels AS trt-model-wheels
 | 
				
			||||||
ARG DEBIAN_FRONTEND
 | 
					ARG DEBIAN_FRONTEND
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,8 @@
 | 
				
			|||||||
/usr/local/lib
 | 
					/usr/local/lib
 | 
				
			||||||
/usr/local/lib/python3.9/dist-packages/nvidia/cudnn/lib
 | 
					/usr/local/cuda/lib64
 | 
				
			||||||
/usr/local/lib/python3.9/dist-packages/nvidia/cuda_runtime/lib
 | 
					/usr/local/lib/python3.11/dist-packages/nvidia/cudnn/lib
 | 
				
			||||||
/usr/local/lib/python3.9/dist-packages/nvidia/cublas/lib
 | 
					/usr/local/lib/python3.11/dist-packages/nvidia/cuda_runtime/lib
 | 
				
			||||||
/usr/local/lib/python3.9/dist-packages/nvidia/cuda_nvrtc/lib
 | 
					/usr/local/lib/python3.11/dist-packages/nvidia/cublas/lib
 | 
				
			||||||
/usr/local/lib/python3.9/dist-packages/tensorrt
 | 
					/usr/local/lib/python3.11/dist-packages/nvidia/cuda_nvrtc/lib
 | 
				
			||||||
 | 
					/usr/local/lib/python3.11/dist-packages/tensorrt
 | 
				
			||||||
 | 
					/usr/local/lib/python3.11/dist-packages/nvidia/cufft/lib
 | 
				
			||||||
@ -1,8 +1,8 @@
 | 
				
			|||||||
# NVidia TensorRT Support (amd64 only)
 | 
					# NVidia TensorRT Support (amd64 only)
 | 
				
			||||||
--extra-index-url 'https://pypi.nvidia.com'
 | 
					--extra-index-url 'https://pypi.nvidia.com'
 | 
				
			||||||
numpy < 1.24; platform_machine == 'x86_64'
 | 
					numpy < 1.24; platform_machine == 'x86_64'
 | 
				
			||||||
tensorrt == 8.5.3.*; platform_machine == 'x86_64'
 | 
					tensorrt == 8.6.1.*; platform_machine == 'x86_64'
 | 
				
			||||||
cuda-python == 11.8; platform_machine == 'x86_64'
 | 
					cuda-python == 11.8.*; platform_machine == 'x86_64'
 | 
				
			||||||
cython == 0.29.*; platform_machine == 'x86_64'
 | 
					cython == 0.29.*; platform_machine == 'x86_64'
 | 
				
			||||||
nvidia-cuda-runtime-cu12 == 12.1.*; platform_machine == 'x86_64'
 | 
					nvidia-cuda-runtime-cu12 == 12.1.*; platform_machine == 'x86_64'
 | 
				
			||||||
nvidia-cuda-runtime-cu11 == 11.8.*; platform_machine == 'x86_64'
 | 
					nvidia-cuda-runtime-cu11 == 11.8.*; platform_machine == 'x86_64'
 | 
				
			||||||
 | 
				
			|||||||
@ -18,12 +18,19 @@ LOG_HANDLER.setFormatter(
 | 
				
			|||||||
    )
 | 
					    )
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# filter out norfair warning
 | 
				
			||||||
LOG_HANDLER.addFilter(
 | 
					LOG_HANDLER.addFilter(
 | 
				
			||||||
    lambda record: not record.getMessage().startswith(
 | 
					    lambda record: not record.getMessage().startswith(
 | 
				
			||||||
        "You are using a scalar distance function"
 | 
					        "You are using a scalar distance function"
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# filter out tflite logging
 | 
				
			||||||
 | 
					LOG_HANDLER.addFilter(
 | 
				
			||||||
 | 
					    lambda record: "Created TensorFlow Lite XNNPACK delegate for CPU."
 | 
				
			||||||
 | 
					    not in record.getMessage()
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
log_listener: Optional[QueueListener] = None
 | 
					log_listener: Optional[QueueListener] = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user