diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index de823bf1c..617176f8f 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -147,11 +147,18 @@ 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 \ && python3 get-pip.py "pip" +RUN apt-get -qq update && apt-get -qq install -y \ + python3-numpy python3-matplotlib python3-opencv python3-scipy python3-pandas python3-onnx python3-lxml python3-zmq + COPY docker/main/requirements.txt /requirements.txt -RUN pip3 install -r /requirements.txt +RUN PIP_IGNORE_INSTALLED=0 pip3 install -r /requirements.txt + +RUN PIP_IGNORE_INSTALLED=0 pip3 install --no-deps filterpy norfair==2.1.1 + +RUN PIP_IGNORE_INSTALLED=0 pip3 install --no-deps zeep==3.0.0 onvif_zeep COPY docker/main/requirements-wheels.txt /requirements-wheels.txt -RUN pip3 wheel --wheel-dir=/wheels -r /requirements-wheels.txt +RUN PIP_IGNORE_INSTALLED=0 pip3 wheel --wheel-dir=/wheels -r /requirements-wheels.txt # Collect deps in a single layer @@ -182,6 +189,9 @@ ENV PATH="/usr/lib/btbn-ffmpeg/bin:/usr/local/go2rtc/bin:/usr/local/nginx/sbin:$ RUN --mount=type=bind,source=docker/main/install_deps.sh,target=/deps/install_deps.sh \ /deps/install_deps.sh +COPY --from=wheels /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages +COPY --from=wheels /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages + RUN --mount=type=bind,from=wheels,source=/wheels,target=/deps/wheels \ python3 -m pip install --upgrade pip && \ pip3 install -U /deps/wheels/*.whl diff --git a/docker/main/install_deps.sh b/docker/main/install_deps.sh index 791124332..1ede14b57 100755 --- a/docker/main/install_deps.sh +++ b/docker/main/install_deps.sh @@ -16,14 +16,6 @@ apt-get -qq install --no-install-recommends -y \ jq \ nethogs -# Use latest distro-provided numpy-related libraries, rather than building wheels from scatch -apt-get -qq install --no-install-recommends --no-install-suggests -y \ - python3-numpy python3-matplotlib python3-opencv python3-scipy -y - -# Again, avoid complicated wheel build for lxml and onif_zeep by using distro-provided libraries -apt-get -qq install --no-install-recommends --no-install-suggests -y \ - python3-lxml -y - # ensure python3 defaults to python3.9 update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 diff --git a/docker/main/requirements-wheels.txt b/docker/main/requirements-wheels.txt index 703a624ef..c658ea8ac 100644 --- a/docker/main/requirements-wheels.txt +++ b/docker/main/requirements-wheels.txt @@ -5,10 +5,10 @@ markupsafe == 2.1.* # matplotlib == 3.8.* mypy == 1.6.1 # numpy == 1.26.* -onvif_zeep == 0.2.12 +# onvif_zeep == 0.2.12 # opencv-python-headless == 4.9.0.* paho-mqtt == 2.0.* -pandas == 2.2.* +# pandas == 2.2.* peewee == 3.17.* peewee_migrate == 1.12.* psutil == 5.9.* @@ -16,18 +16,18 @@ pydantic == 2.7.* git+https://github.com/fbcotter/py3nvml#egg=py3nvml PyYAML == 6.0.* pytz == 2024.1 -pyzmq == 26.0.* +#pyzmq == 26.0.* ruamel.yaml == 0.18.* tzlocal == 5.2 types-PyYAML == 6.0.* requests == 2.31.* types-requests == 2.31.* # scipy == 1.13.* -# norfair == 2.2.* +#norfair == 2.1.1 setproctitle == 1.3.* ws4py == 0.5.* unidecode == 1.3.* -onnxruntime == 1.16.* +#onnxruntime == 1.16.* # Openvino Library - Custom built with MYRIAD support openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.3.1/openvino-2022.3.1-1-cp39-cp39-manylinux_2_31_x86_64.whl; platform_machine == 'x86_64' openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.3.1/openvino-2022.3.1-1-cp39-cp39-linux_aarch64.whl; platform_machine == 'aarch64' diff --git a/docker/main/requirements.txt b/docker/main/requirements.txt index eb32f4213..b1f3dfd7d 100644 --- a/docker/main/requirements.txt +++ b/docker/main/requirements.txt @@ -1,6 +1,3 @@ ---only-binary :all: scikit-build == 0.17.* nvidia-pyindex -norfair == 2.1.1 -zeep == 3.0.0 -onvif_zeep \ No newline at end of file +rich \ No newline at end of file