From 032afbc13802c736caa7333c511306414e29d53b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=88=9E?= Date: Sun, 25 Aug 2024 21:02:33 +0800 Subject: [PATCH] style: refactor environment variable handling for NVIDIA settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format UndefinedVar: Usage of undefined variable '$PYTHONPATH' - Fix syntax for `NVIDIA_VISIBLE_DEVICES` and `NVIDIA_DRIVER_CAPABILITIES` environment variables - Remove usage of the existing `PYTHONPATH` environment variable in favor of setting it directly Signed-off-by: 陳鈞 --- Dockerfile | 6 +++--- ubi.Dockerfile | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e96ec7d..2cb3e0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -81,8 +81,8 @@ RUN --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/r ######################################## FROM base AS no_model -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility # We don't need them anymore RUN pip3.11 uninstall -y pip wheel && \ @@ -121,7 +121,7 @@ COPY --link --chown=$UID:0 --chmod=775 whisperX/LICENSE /licenses/whisperX.LICEN COPY --link --chown=$UID:0 --chmod=775 --from=build /root/.local /home/$UID/.local ENV PATH="/home/$UID/.local/bin:$PATH" -ENV PYTHONPATH="/home/$UID/.local/lib/python3.11/site-packages:$PYTHONPATH" +ENV PYTHONPATH="/home/$UID/.local/lib/python3.11/site-packages" ARG WHISPER_MODEL ENV WHISPER_MODEL= diff --git a/ubi.Dockerfile b/ubi.Dockerfile index d10d553..6f28d25 100644 --- a/ubi.Dockerfile +++ b/ubi.Dockerfile @@ -88,8 +88,8 @@ RUN --mount=type=cache,id=pip-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/r ######################################## FROM base AS no_model -ENV NVIDIA_VISIBLE_DEVICES all -ENV NVIDIA_DRIVER_CAPABILITIES compute,utility +ENV NVIDIA_VISIBLE_DEVICES=all +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility ARG CACHE_HOME ARG CONFIG_HOME @@ -120,7 +120,7 @@ COPY --link --chown=$UID:0 --chmod=775 whisperX/LICENSE /licenses/whisperX.LICEN COPY --link --chown=$UID:0 --chmod=775 --from=build /root/.local /root/.local ENV PATH="/root/.local/bin:$PATH" -ENV PYTHONPATH="/root/.local/lib/python3.11/site-packages:$PYTHONPATH" +ENV PYTHONPATH="/root/.local/lib/python3.11/site-packages" ARG WHISPER_MODEL ENV WHISPER_MODEL=