diff --git a/.devcontainer/docker-entrypoint.sh b/.devcontainer/docker-entrypoint.sh index b655108..3ccd9a9 100644 --- a/.devcontainer/docker-entrypoint.sh +++ b/.devcontainer/docker-entrypoint.sh @@ -5,22 +5,24 @@ echo "Running mindctrl devcontainer entrypoint..." echo "running original bootstrap" bash devcontainer_bootstrap +echo "installing uv" +python3 -m pip install --upgrade uv + if [ -d "./.venv" ]; then echo ".venv does exist." else echo "Create venv" - python3 -m venv ./.venv + uv venv fi echo "Activating venv" source ./.venv/bin/activate -python -m pip install --upgrade pip echo "install source" -python -m pip install -e ./python +uv pip install -e ./python echo "install requirements" -python -m pip install -r ./tests/test-requirements.txt +uv pip install -r ./tests/test-requirements.txt exec "$@" diff --git a/.github/workflows/integration-addon.yaml b/.github/workflows/integration-addon.yaml index ee49758..6c8ec8c 100644 --- a/.github/workflows/integration-addon.yaml +++ b/.github/workflows/integration-addon.yaml @@ -25,8 +25,8 @@ jobs: python-version: "3.11" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r tests/test-requirements.txt python/ + python -m pip install --upgrade uv + uv pip install --system -r tests/test-requirements.txt python/ - name: Lint with Ruff run: | ruff check . diff --git a/.github/workflows/integration-k3d.yaml b/.github/workflows/integration-k3d.yaml index fe0d168..f82898b 100644 --- a/.github/workflows/integration-k3d.yaml +++ b/.github/workflows/integration-k3d.yaml @@ -25,8 +25,8 @@ jobs: python-version: "3.11" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r tests/test-requirements.txt python/ + python -m pip install --upgrade uv + uv pip install --system -r tests/test-requirements.txt python/ - name: Lint with Ruff run: | ruff check . diff --git a/.github/workflows/integration-local.yaml b/.github/workflows/integration-local.yaml index 086168d..ad64812 100644 --- a/.github/workflows/integration-local.yaml +++ b/.github/workflows/integration-local.yaml @@ -25,8 +25,8 @@ jobs: python-version: "3.11" - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r tests/test-requirements.txt python/ + python -m pip install --upgrade uv + uv pip install --system -r tests/test-requirements.txt python/ - name: Lint with Ruff run: | ruff check . diff --git a/addons/mindctrl/Dockerfile b/addons/mindctrl/Dockerfile index fa78760..09df664 100644 --- a/addons/mindctrl/Dockerfile +++ b/addons/mindctrl/Dockerfile @@ -24,9 +24,7 @@ RUN set -eux; \ \ python3 --version -RUN pip3 --version - - +RUN pip3 install --no-cache --break-system-packages uv ENV SENTENCE_TRANSFORMERS_HOME=/model_cache ENV HF_HUB_CACHE=/model_cache @@ -50,10 +48,10 @@ ENV TRAEFIK_ARCH=${BUILD_ARCH} RUN /.context/install_traefik.sh COPY requirements.txt / -RUN pip3 install --no-cache --break-system-packages -r /requirements.txt +RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt # One day when builder workflow supports --build-context # COPY --from=mindctrl_source / /pysrc -RUN pip3 install --no-cache --break-system-packages /.context/pysrc/ +RUN uv pip install --no-cache --break-system-packages --python python3 /.context/pysrc/ RUN chmod a+x /usr/bin/run_tracking.sh && \ chmod a+x /usr/bin/run_gateway.sh && \ diff --git a/python/src/mindctrl/Dockerfile b/python/src/mindctrl/Dockerfile deleted file mode 100644 index 65c74db..0000000 --- a/python/src/mindctrl/Dockerfile +++ /dev/null @@ -1,51 +0,0 @@ -ARG BUILD_FROM="ghcr.io/hassio-addons/debian-base:7.3.3" -FROM $BUILD_FROM - -# ensure local python is preferred over distribution python -ENV PATH /usr/local/bin:$PATH - -# http://bugs.python.org/issue19846 -# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. -ENV LANG C.UTF-8 -ENV MINDCTRL_ADDON_VERSION ${BUILD_VERSION} - -# runtime dependencies -RUN set -eux; \ - apt-get update; \ - apt-get install -y --no-install-recommends \ - ca-certificates \ - netbase \ - tzdata \ - python3-full \ - python3-pip \ - wget \ - ; \ - rm -rf /var/lib/apt/lists/*; \ - \ - python3 --version - -RUN pip3 --version - -COPY requirements.txt / - -RUN pip3 install --no-cache --break-system-packages -r /requirements.txt - -COPY . / -ENTRYPOINT [ "/bin/bash" ] # To disable s6 overlay -# python3 -m uvicorn main:app --host 0.0.0.0 --port 5002 -CMD [ "/run_multiserver_container.sh"] - - -LABEL \ - maintainer="AK" \ - org.opencontainers.image.title="${BUILD_NAME}" \ - org.opencontainers.image.description="${BUILD_DESCRIPTION}" \ - org.opencontainers.image.vendor="AK" \ - org.opencontainers.image.authors="AK" \ - org.opencontainers.image.licenses="Apache 2.0" \ - org.opencontainers.image.url="https://addons.community" \ - org.opencontainers.image.source="https://github.com/${BUILD_REPOSITORY}" \ - org.opencontainers.image.documentation="https://github.com/${BUILD_REPOSITORY}/blob/main/README.md" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.revision=${BUILD_REF} \ - org.opencontainers.image.version=${BUILD_VERSION} diff --git a/services/deployments/Dockerfile b/services/deployments/Dockerfile index 664a6f2..b69b37a 100644 --- a/services/deployments/Dockerfile +++ b/services/deployments/Dockerfile @@ -24,14 +24,14 @@ RUN set -eux; \ \ python3 --version -RUN pip3 --version +RUN pip3 install --no-cache --break-system-packages uv COPY requirements.txt / -RUN pip3 install --no-cache --break-system-packages -r /requirements.txt +RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt COPY --from=mindctrl_source / /pysrc -RUN pip3 install --no-cache --break-system-packages /pysrc +RUN uv pip install --no-cache --break-system-packages --python python3 /pysrc # mlflow deployments start-server --config-path /usr/bin/deployments/route-config.yaml --port 5001 --host 0.0.0.0 COPY route-config.yaml run_deployments_container.sh / diff --git a/services/multiserver/Dockerfile b/services/multiserver/Dockerfile index 5d9e8b9..6066fe2 100644 --- a/services/multiserver/Dockerfile +++ b/services/multiserver/Dockerfile @@ -24,14 +24,14 @@ RUN set -eux; \ \ python3 --version -RUN pip3 --version +RUN pip3 install --no-cache --break-system-packages uv COPY requirements.txt / -RUN pip3 install --no-cache --break-system-packages -r /requirements.txt +RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt COPY --from=mindctrl_source / /pysrc -RUN pip3 install --no-cache --break-system-packages /pysrc +RUN uv pip install --no-cache --break-system-packages --python python3 /pysrc COPY run_multiserver_container.sh / diff --git a/services/tracking/Dockerfile b/services/tracking/Dockerfile index 07db0a1..bfdeaaf 100644 --- a/services/tracking/Dockerfile +++ b/services/tracking/Dockerfile @@ -24,11 +24,11 @@ RUN set -eux; \ \ python3 --version -RUN pip3 --version +RUN pip3 install --no-cache --break-system-packages uv COPY requirements.txt / -RUN pip3 install --no-cache --break-system-packages -r /requirements.txt +RUN uv pip install --no-cache --break-system-packages --python python3 -r /requirements.txt COPY run_tracking_container.sh /