From c1b0f9c79d6ca3fd7ff99c9700ddbe904427bcb8 Mon Sep 17 00:00:00 2001 From: Sai-Suraj-27 Date: Sun, 29 Jun 2025 19:21:51 +0530 Subject: [PATCH] Updated Dockerfiles to install packages in a virtual environment. --- docker/consistency.dockerfile | 3 +-- docker/custom-tokenizers.dockerfile | 3 +-- docker/examples-tf.dockerfile | 3 +-- docker/examples-torch.dockerfile | 3 +-- docker/exotic-models.dockerfile | 3 +-- docker/jax-light.dockerfile | 3 +-- docker/pipeline-tf.dockerfile | 3 +-- docker/pipeline-torch.dockerfile | 3 +-- docker/quality.dockerfile | 3 +-- docker/tf-light.dockerfile | 3 +-- docker/torch-jax-light.dockerfile | 3 +-- docker/torch-light.dockerfile | 3 +-- docker/torch-tf-light.dockerfile | 3 +-- 13 files changed, 13 insertions(+), 26 deletions(-) diff --git a/docker/consistency.dockerfile b/docker/consistency.dockerfile index e569307f92d..a725661d3fa 100644 --- a/docker/consistency.dockerfile +++ b/docker/consistency.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 USER root ARG REF=main RUN apt-get update && apt-get install -y time git g++ pkg-config make git-lfs -ENV UV_PYTHON=/usr/local/bin/python -RUN pip install uv && uv pip install --no-cache-dir -U pip setuptools GitPython +RUN pip install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools GitPython RUN uv pip install --no-cache-dir --upgrade 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu # tensorflow pin matching setup.py RUN uv pip install --no-cache-dir pypi-kenlm diff --git a/docker/custom-tokenizers.dockerfile b/docker/custom-tokenizers.dockerfile index ceec0d87f3c..b1a750075c9 100644 --- a/docker/custom-tokenizers.dockerfile +++ b/docker/custom-tokenizers.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git cmake wget xz-utils build-essential g++5 libprotobuf-dev protobuf-compiler -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN wget https://github.com/ku-nlp/jumanpp/releases/download/v2.0.0-rc3/jumanpp-2.0.0-rc3.tar.xz RUN tar xvf jumanpp-2.0.0-rc3.tar.xz diff --git a/docker/examples-tf.dockerfile b/docker/examples-tf.dockerfile index b357821d045..fb6536dd700 100644 --- a/docker/examples-tf.dockerfile +++ b/docker/examples-tf.dockerfile @@ -4,8 +4,7 @@ ARG REF=main USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git RUN apt-get install -y g++ cmake -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv +RUN pip --no-cache-dir install uv && uv venv RUN uv pip install --no-cache-dir -U pip setuptools albumentations seqeval RUN uv pip install --upgrade --no-cache-dir "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[tf-cpu,sklearn,testing,sentencepiece,tf-speech,vision]" RUN uv pip install --no-cache-dir "protobuf==3.20.3" diff --git a/docker/examples-torch.dockerfile b/docker/examples-torch.dockerfile index 9177729ab9f..bb345df7f88 100644 --- a/docker/examples-torch.dockerfile +++ b/docker/examples-torch.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git g++ cmake pkg-config openssh-client git -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-deps timm accelerate --extra-index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir librosa "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[sklearn,sentencepiece,vision,testing]" seqeval albumentations jiwer diff --git a/docker/exotic-models.dockerfile b/docker/exotic-models.dockerfile index d42d34555cd..8fc8a1b0f2f 100644 --- a/docker/exotic-models.dockerfile +++ b/docker/exotic-models.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git libgl1-mesa-glx libgl1 g++ tesseract-ocr -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir --no-deps timm accelerate RUN pip install -U --upgrade-strategy eager --no-cache-dir pytesseract python-Levenshtein opencv-python nltk diff --git a/docker/jax-light.dockerfile b/docker/jax-light.dockerfile index eff17cd8bf1..32ae16bc32b 100644 --- a/docker/jax-light.dockerfile +++ b/docker/jax-light.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git g++ cmake -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir "scipy<1.13" "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[flax,testing,sentencepiece,flax-speech,vision]" RUN uv pip uninstall transformers RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean diff --git a/docker/pipeline-tf.dockerfile b/docker/pipeline-tf.dockerfile index 9e22c2a80f1..18e69d7bf59 100644 --- a/docker/pipeline-tf.dockerfile +++ b/docker/pipeline-tf.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git cmake g++ -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[sklearn,tf-cpu,testing,sentencepiece,tf-speech,vision]" RUN uv pip install --no-cache-dir "protobuf==3.20.3" tensorflow_probability RUN apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/docker/pipeline-torch.dockerfile b/docker/pipeline-torch.dockerfile index 708584378d4..c18ca96fbe1 100644 --- a/docker/pipeline-torch.dockerfile +++ b/docker/pipeline-torch.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git pkg-config openssh-client git -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-deps timm accelerate --extra-index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir librosa "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[sklearn,sentencepiece,vision,testing]" diff --git a/docker/quality.dockerfile b/docker/quality.dockerfile index 3915352c42f..0b07b859394 100644 --- a/docker/quality.dockerfile +++ b/docker/quality.dockerfile @@ -3,7 +3,6 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y time git -ENV UV_PYTHON=/usr/local/bin/python -RUN pip install uv +RUN pip install uv && uv venv RUN uv pip install --no-cache-dir -U pip setuptools GitPython "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[ruff]" urllib3 RUN apt-get install -y jq curl && apt-get clean && rm -rf /var/lib/apt/lists/* diff --git a/docker/tf-light.dockerfile b/docker/tf-light.dockerfile index 9c4bb5a96da..01d26f561fa 100644 --- a/docker/tf-light.dockerfile +++ b/docker/tf-light.dockerfile @@ -4,8 +4,7 @@ ARG REF=main USER root RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git g++ pkg-config openssh-client git RUN apt-get install -y cmake -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --upgrade --no-cache-dir "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[tf-cpu,sklearn,testing,sentencepiece,tf-speech,vision]" RUN uv pip install --no-cache-dir "protobuf==3.20.3" RUN uv pip uninstall transformers diff --git a/docker/torch-jax-light.dockerfile b/docker/torch-jax-light.dockerfile index 9c7835eca13..3abd44e199f 100644 --- a/docker/torch-jax-light.dockerfile +++ b/docker/torch-jax-light.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git g++ cmake pkg-config openssh-client git -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-deps accelerate RUN uv pip install --no-cache-dir 'torch' 'torchvision' 'torchaudio' --index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir "scipy<1.13" "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[flax,audio,sklearn,sentencepiece,vision,testing]" diff --git a/docker/torch-light.dockerfile b/docker/torch-light.dockerfile index 861290f361a..b9dc00ee67f 100644 --- a/docker/torch-light.dockerfile +++ b/docker/torch-light.dockerfile @@ -3,8 +3,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ARG REF=main USER root RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git g++ cmake pkg-config openssh-client git git-lfs -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-deps timm accelerate --extra-index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir librosa "git+https://github.com/huggingface/transformers.git@${REF}#egg=transformers[sklearn,sentencepiece,vision,testing,tiktoken,num2words,video]" diff --git a/docker/torch-tf-light.dockerfile b/docker/torch-tf-light.dockerfile index e1ad5535156..34c223b2bf6 100644 --- a/docker/torch-tf-light.dockerfile +++ b/docker/torch-tf-light.dockerfile @@ -4,8 +4,7 @@ ARG REF=main RUN echo ${REF} USER root RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git g++ cmake pkg-config openssh-client git git-lfs -ENV UV_PYTHON=/usr/local/bin/python -RUN pip --no-cache-dir install uv && uv pip install --no-cache-dir -U pip setuptools +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN uv pip install --no-cache-dir --no-deps accelerate --extra-index-url https://download.pytorch.org/whl/cpu RUN uv pip install --no-cache-dir 'torch' 'torchaudio' 'torchvision' --index-url https://download.pytorch.org/whl/cpu RUN git lfs install