Skip to content

Commit

Permalink
style: refactor environment variable handling for NVIDIA settings
Browse files Browse the repository at this point in the history
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: 陳鈞 <jim60105@gmail.com>
  • Loading branch information
jim60105 committed Aug 25, 2024
1 parent 6e10c76 commit 032afbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand Down Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions ubi.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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=
Expand Down

0 comments on commit 032afbc

Please sign in to comment.