mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-08-08 13:51:01 +02:00
fix docker memryx installation
This commit is contained in:
parent
2304457557
commit
01d84f3039
@ -138,6 +138,9 @@ RUN wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/da
|
|||||||
RUN wget -qO - https://www.kaggle.com/api/v1/models/google/yamnet/tfLite/classification-tflite/1/download | tar xvz && mv 1.tflite cpu_audio_model.tflite
|
RUN wget -qO - https://www.kaggle.com/api/v1/models/google/yamnet/tfLite/classification-tflite/1/download | tar xvz && mv 1.tflite cpu_audio_model.tflite
|
||||||
COPY audio-labelmap.txt .
|
COPY audio-labelmap.txt .
|
||||||
|
|
||||||
|
# Copy 81 class coco label map
|
||||||
|
RUN wget -O coco_81class_labelmap.txt https://developer.memryx.com/example_files/1p2_frigate/labelmap.txt
|
||||||
|
|
||||||
|
|
||||||
FROM wget AS s6-overlay
|
FROM wget AS s6-overlay
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
@ -176,6 +179,9 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
|
|||||||
&& sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' get-pip.py \
|
&& sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' get-pip.py \
|
||||||
&& python3 get-pip.py "pip"
|
&& python3 get-pip.py "pip"
|
||||||
|
|
||||||
|
# Build MemryX SDK wheel
|
||||||
|
RUN pip3 wheel --wheel-dir=/wheels/memx/ --extra-index-url https://developer.memryx.com/pip memryx~=1.2.0
|
||||||
|
|
||||||
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
|
||||||
|
|
||||||
@ -240,64 +246,35 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \
|
|||||||
&& sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' get-pip.py \
|
&& sed -i 's/args.append("setuptools")/args.append("setuptools==77.0.3")/' get-pip.py \
|
||||||
&& python3 get-pip.py "pip"
|
&& python3 get-pip.py "pip"
|
||||||
|
|
||||||
RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \
|
RUN --mount=type=bind,from=wheels,source=/wheels,target=/wheels \
|
||||||
pip3 install -U /deps/wheels/*.whl
|
bash -euo pipefail -c '\
|
||||||
|
echo "→ Installing MemryX SDK wheels…"; \
|
||||||
|
pip3 install --no-deps /wheels/memx/*.whl; \
|
||||||
|
echo "→ Installing/overwriting with project wheels…"; \
|
||||||
|
pip3 install --no-deps --upgrade /wheels/*.whl; \
|
||||||
|
'
|
||||||
|
|
||||||
COPY --from=deps-rootfs / /
|
COPY --from=deps-rootfs / /
|
||||||
|
|
||||||
####
|
# Add MemryX APT repo & install memx-accl
|
||||||
#
|
|
||||||
# MemryX Support
|
|
||||||
#
|
|
||||||
# 1. Install system dependencies and Python packages
|
|
||||||
# 2. Add MemryX repo and install memx-accl
|
|
||||||
#
|
|
||||||
####
|
|
||||||
# Install system dependencies
|
|
||||||
RUN apt-get -qq update && \
|
|
||||||
apt-get -qq install -y --no-install-recommends \
|
|
||||||
libhdf5-dev \
|
|
||||||
python3-dev \
|
|
||||||
cmake \
|
|
||||||
python3-venv \
|
|
||||||
build-essential \
|
|
||||||
curl \
|
|
||||||
wget \
|
|
||||||
gnupg
|
|
||||||
|
|
||||||
RUN python3 -m pip install --upgrade pip && \
|
|
||||||
python3 -m pip install --extra-index-url https://developer.memryx.com/pip "memryx~=1.2.0"
|
|
||||||
|
|
||||||
# Add MemryX repository and key
|
|
||||||
RUN curl -fsSL https://developer.memryx.com/deb/memryx.asc | tee /etc/apt/trusted.gpg.d/memryx.asc && \
|
RUN curl -fsSL https://developer.memryx.com/deb/memryx.asc | tee /etc/apt/trusted.gpg.d/memryx.asc && \
|
||||||
echo "deb https://developer.memryx.com/deb stable main" > /etc/apt/sources.list.d/memryx.list && \
|
echo "deb https://developer.memryx.com/deb stable main" > /etc/apt/sources.list.d/memryx.list && \
|
||||||
apt-get update -qq
|
apt-get update -qq && \
|
||||||
|
bash -c '\
|
||||||
# Install memx-accl using a custom function that installs the latest 1.2.x version and holds it.
|
install_and_hold() { \
|
||||||
RUN bash -c '\
|
echo "Processing package: $1..."; \
|
||||||
install_and_hold() { \
|
local versions; \
|
||||||
echo "Processing package: $1..."; \
|
versions=$(apt-cache policy "$1" | grep -E "^\s*(\*{3}\s*)?1\.2" | awk "{if(\$1==\"***\") print \$2; else print \$1}"); \
|
||||||
local versions; \
|
if [ -z \"$versions\" ]; then \
|
||||||
versions=$(apt-cache policy "$1" | grep -E "^\s*(\*{3}\s*)?1\.2" | awk "{if(\$1==\"***\") print \$2; else print \$1}"); \
|
echo "No 1.2 versions found for package $1" >&2; exit 1; \
|
||||||
if [ -z \"$versions\" ]; then \
|
fi; \
|
||||||
echo "No 1.2 versions found for package $1" >&2; \
|
local latest; \
|
||||||
exit 1; \
|
latest=$(echo "$versions" | sort -V | tail -n 1); \
|
||||||
fi; \
|
echo "Installing $1 version $latest..."; \
|
||||||
local latest; \
|
apt install -y --no-install-recommends "$1=${latest}" || { echo "Install failed." >&2; exit 1; }; \
|
||||||
latest=$(echo "$versions" | sort -V | tail -n 1); \
|
apt-mark hold "$1"; \
|
||||||
echo "Latest 1.2.x version of $1 is: $latest"; \
|
}; \
|
||||||
echo "Installing $1 version $latest..."; \
|
install_and_hold memx-accl'
|
||||||
apt install -y "$1=${latest}" || { echo "Installation of $1 version $latest failed." >&2; exit 1; }; \
|
|
||||||
echo "Marking $1 at version $latest as held..."; \
|
|
||||||
apt-mark hold "$1" || { echo "Failed to hold package $1." >&2; exit 1; }; \
|
|
||||||
echo "Package $1 installed and pinned at version $latest successfully."; \
|
|
||||||
}; \
|
|
||||||
install_and_hold memx-accl'
|
|
||||||
|
|
||||||
# Copy the 81-class COCO label map
|
|
||||||
RUN wget -O coco_81class_labelmap.txt https://developer.memryx.com/example_files/1p2_frigate/labelmap.txt
|
|
||||||
|
|
||||||
###### End MemryX setup
|
|
||||||
|
|
||||||
RUN ldconfig
|
RUN ldconfig
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user