diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index 58f327e0f..d555d99b9 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -195,9 +195,6 @@ RUN pip3 wheel --wheel-dir=/wheels -r /requirements-wheels.txt && \ # Install HailoRT & Wheels RUN --mount=type=bind,source=docker/main/install_hailort.sh,target=/deps/install_hailort.sh \ /deps/install_hailort.sh -#Install Synaptics SL1680 runtime library and wheels -RUN --mount=type=bind,source=docker/main/install_synap1680.sh,target=/deps/install_synap1680.sh \ - /deps/install_synap1680.sh # Collect deps in a single layer FROM scratch AS deps-rootfs diff --git a/docker/synap1680/Dockerfile b/docker/synap1680/Dockerfile index 93440768b..ba32471a8 100644 --- a/docker/synap1680/Dockerfile +++ b/docker/synap1680/Dockerfile @@ -1,15 +1,28 @@ -# syntax=docker/dockerfile:1.4 +# syntax=docker/dockerfile:1.6 # https://askubuntu.com/questions/972516/debian-frontend-environment-variable ARG DEBIAN_FRONTEND=noninteractive -FROM deps AS synap1680-deps +# Globally set pip break-system-packages option to avoid having to specify it every time +ARG PIP_BREAK_SYSTEM_PACKAGES=1 + +FROM wheels AS synap1680-wheels ARG TARGETARCH # Install dependencies -RUN --mount=type=bind,source=docker/synap1680/install_deps.sh,target=/deps/install_deps.sh \ - /deps/install_deps.sh +RUN wget -qO- "https://github.com/GaryHuang-ASUS/frigate-synaptics-rt/releases/download/v1.5.0-1.0/synaptics-rt-1.0.tar" | tar -C / -xzf - +RUN wget -P /wheels/ "https://github.com/synaptics-synap/synap-python/releases/download/v0.0.4-preview/synap_python-0.0.4-cp311-cp311-manylinux_2_35_aarch64.whl" + +FROM deps AS synap1680-deps +ARG TARGETARCH +ARG PIP_BREAK_SYSTEM_PACKAGES + +RUN --mount=type=bind,from=synap1680-wheels,source=/wheels,target=/deps/synap-wheels \ +pip3 install --no-deps -U /deps/synap-wheels/*.whl WORKDIR /opt/frigate/ COPY --from=rootfs / / + +COPY --from=synap1680-wheels /rootfs/usr/local/lib/*.so /usr/lib + ADD https://raw.githubusercontent.com/synaptics-astra/synap-release/v1.5.0/models/dolphin/object_detection/coco/model/mobilenet224_full80/model.synap /model.synap diff --git a/docker/synap1680/synap1680.hcl b/docker/synap1680/synap1680.hcl index 864f884a0..c573845cd 100644 --- a/docker/synap1680/synap1680.hcl +++ b/docker/synap1680/synap1680.hcl @@ -1,3 +1,9 @@ +target wheels { + dockerfile = "docker/main/Dockerfile" + platforms = ["linux/arm64"] + target = "wheels" +} + target deps { dockerfile = "docker/main/Dockerfile" platforms = ["linux/arm64"] @@ -13,6 +19,7 @@ target rootfs { target synap1680 { dockerfile = "docker/synap1680/Dockerfile" contexts = { + wheels = "target:wheels", deps = "target:deps", rootfs = "target:rootfs" }