Unverified Commit 35e538d4 authored by Sayak Paul's avatar Sayak Paul Committed by GitHub
Browse files

fix dockerfile definitions. (#12424)

* fix dockerfile definitions.

* python 3.10 slim.

* up

* up

* up

* up

* up

* revert pr_tests.yml changes

* up

* up

* reduce python version for torch 2.1.0
parent 2dc31677
...@@ -72,7 +72,6 @@ jobs: ...@@ -72,7 +72,6 @@ jobs:
image-name: image-name:
- diffusers-pytorch-cpu - diffusers-pytorch-cpu
- diffusers-pytorch-cuda - diffusers-pytorch-cuda
- diffusers-pytorch-cuda
- diffusers-pytorch-xformers-cuda - diffusers-pytorch-xformers-cuda
- diffusers-pytorch-minimum-cuda - diffusers-pytorch-minimum-cuda
- diffusers-doc-builder - diffusers-doc-builder
......
...@@ -286,4 +286,3 @@ jobs: ...@@ -286,4 +286,3 @@ jobs:
with: with:
name: pr_main_test_reports name: pr_main_test_reports
path: reports path: reports
FROM ubuntu:20.04 FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1
LABEL maintainer="Hugging Face" LABEL maintainer="Hugging Face"
LABEL repository="diffusers" LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update \ RUN apt-get -y update && apt-get install -y bash \
&& apt-get install -y software-properties-common \ build-essential \
&& add-apt-repository ppa:deadsnakes/ppa git \
git-lfs \
RUN apt install -y bash \ curl \
build-essential \ ca-certificates \
git \ libsndfile1-dev \
git-lfs \ libgl1
curl \
ca-certificates \ ENV UV_PYTHON=/usr/local/bin/python
libsndfile1-dev \
python3.10 \
python3-pip \
libgl1 \
zip \
wget \
python3.10-venv && \
rm -rf /var/lib/apt/lists
# make sure to use venv
RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN pip install uv
python3.10 -m uv pip install --no-cache-dir \ RUN uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
invisible_watermark \ --extra-index-url https://download.pytorch.org/whl/cpu
--extra-index-url https://download.pytorch.org/whl/cpu && \
python3.10 -m uv pip install --no-cache-dir \ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
accelerate \
datasets \ # Extra dependencies
hf-doc-builder \ RUN uv pip install --no-cache-dir \
huggingface-hub \ accelerate \
Jinja2 \ numpy==1.26.4 \
librosa \ hf_transfer \
numpy==1.26.4 \ setuptools==69.5.1 \
scipy \ bitsandbytes \
tensorboard \ torchao \
transformers \ gguf \
matplotlib \ optimum-quanto
setuptools==69.5.1 \
bitsandbytes \ RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean
torchao \
gguf \
optimum-quanto
CMD ["/bin/bash"] CMD ["/bin/bash"]
FROM ubuntu:20.04 FROM python:3.10-slim
ENV PYTHONDONTWRITEBYTECODE=1
LABEL maintainer="Hugging Face" LABEL maintainer="Hugging Face"
LABEL repository="diffusers" LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update \ RUN apt-get -y update && apt-get install -y bash \
&& apt-get install -y software-properties-common \ build-essential \
&& add-apt-repository ppa:deadsnakes/ppa git \
git-lfs \
RUN apt install -y bash \ curl \
build-essential \ ca-certificates \
git \ libsndfile1-dev \
git-lfs \ libgl1
curl \
ca-certificates \ ENV UV_PYTHON=/usr/local/bin/python
libsndfile1-dev \
python3.10 \
python3.10-dev \
python3-pip \
libgl1 \
python3.10-venv && \
rm -rf /var/lib/apt/lists
# make sure to use venv
RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN pip install uv
python3.10 -m uv pip install --no-cache-dir \ RUN uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
invisible_watermark \ --extra-index-url https://download.pytorch.org/whl/cpu
--extra-index-url https://download.pytorch.org/whl/cpu && \
python3.10 -m uv pip install --no-cache-dir \ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
accelerate \
datasets \ # Extra dependencies
hf-doc-builder \ RUN uv pip install --no-cache-dir \
huggingface-hub \ accelerate \
Jinja2 \ numpy==1.26.4 \
librosa \ hf_transfer
numpy==1.26.4 \
scipy \ RUN apt-get clean && rm -rf /var/lib/apt/lists/* && apt-get autoremove && apt-get autoclean
tensorboard \
transformers matplotlib \
hf_transfer
CMD ["/bin/bash"] CMD ["/bin/bash"]
...@@ -2,11 +2,13 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04 ...@@ -2,11 +2,13 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
LABEL maintainer="Hugging Face" LABEL maintainer="Hugging Face"
LABEL repository="diffusers" LABEL repository="diffusers"
ARG PYTHON_VERSION=3.12
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update \ RUN apt-get -y update \
&& apt-get install -y software-properties-common \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa && add-apt-repository ppa:deadsnakes/ppa && \
apt-get update
RUN apt install -y bash \ RUN apt install -y bash \
build-essential \ build-essential \
...@@ -16,36 +18,31 @@ RUN apt install -y bash \ ...@@ -16,36 +18,31 @@ RUN apt install -y bash \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.10 \ python3 \
python3.10-dev \
python3-pip \ python3-pip \
python3.10-venv && \ && apt-get clean \
rm -rf /var/lib/apt/lists && rm -rf /var/lib/apt/lists/*
# make sure to use venv RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN python3.10 -m venv /opt/venv ENV PATH="/root/.local/bin:$PATH"
ENV PATH="/opt/venv/bin:$PATH" ENV VIRTUAL_ENV="/opt/venv"
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN uv pip install --no-cache-dir \
python3.10 -m uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio
invisible_watermark && \
python3.10 -m pip install --no-cache-dir \ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
# Extra dependencies
RUN uv pip install --no-cache-dir \
accelerate \ accelerate \
datasets \
hf-doc-builder \
huggingface-hub \
hf_transfer \
Jinja2 \
librosa \
numpy==1.26.4 \ numpy==1.26.4 \
scipy \ pytorch-lightning \
tensorboard \
transformers \
pytorch-lightning \
hf_transfer hf_transfer
CMD ["/bin/bash"] CMD ["/bin/bash"]
...@@ -2,6 +2,7 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04 ...@@ -2,6 +2,7 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
LABEL maintainer="Hugging Face" LABEL maintainer="Hugging Face"
LABEL repository="diffusers" LABEL repository="diffusers"
ARG PYTHON_VERSION=3.10
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ENV MINIMUM_SUPPORTED_TORCH_VERSION="2.1.0" ENV MINIMUM_SUPPORTED_TORCH_VERSION="2.1.0"
ENV MINIMUM_SUPPORTED_TORCHVISION_VERSION="0.16.0" ENV MINIMUM_SUPPORTED_TORCHVISION_VERSION="0.16.0"
...@@ -9,7 +10,8 @@ ENV MINIMUM_SUPPORTED_TORCHAUDIO_VERSION="2.1.0" ...@@ -9,7 +10,8 @@ ENV MINIMUM_SUPPORTED_TORCHAUDIO_VERSION="2.1.0"
RUN apt-get -y update \ RUN apt-get -y update \
&& apt-get install -y software-properties-common \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa && add-apt-repository ppa:deadsnakes/ppa && \
apt-get update
RUN apt install -y bash \ RUN apt install -y bash \
build-essential \ build-essential \
...@@ -19,35 +21,31 @@ RUN apt install -y bash \ ...@@ -19,35 +21,31 @@ RUN apt install -y bash \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.10 \ python3 \
python3.10-dev \
python3-pip \ python3-pip \
python3.10-venv && \ && apt-get clean \
rm -rf /var/lib/apt/lists && rm -rf /var/lib/apt/lists/*
# make sure to use venv RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN python3.10 -m venv /opt/venv ENV PATH="/root/.local/bin:$PATH"
ENV PATH="/opt/venv/bin:$PATH" ENV VIRTUAL_ENV="/opt/venv"
ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN uv pip install --no-cache-dir \
python3.10 -m uv pip install --no-cache-dir \
torch==$MINIMUM_SUPPORTED_TORCH_VERSION \ torch==$MINIMUM_SUPPORTED_TORCH_VERSION \
torchvision==$MINIMUM_SUPPORTED_TORCHVISION_VERSION \ torchvision==$MINIMUM_SUPPORTED_TORCHVISION_VERSION \
torchaudio==$MINIMUM_SUPPORTED_TORCHAUDIO_VERSION \ torchaudio==$MINIMUM_SUPPORTED_TORCHAUDIO_VERSION
invisible_watermark && \
python3.10 -m pip install --no-cache-dir \ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
# Extra dependencies
RUN uv pip install --no-cache-dir \
accelerate \ accelerate \
datasets \
hf-doc-builder \
huggingface-hub \
hf_transfer \
Jinja2 \
librosa \
numpy==1.26.4 \ numpy==1.26.4 \
scipy \ pytorch-lightning \
tensorboard \
transformers \
hf_transfer hf_transfer
CMD ["/bin/bash"] CMD ["/bin/bash"]
...@@ -2,50 +2,48 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04 ...@@ -2,50 +2,48 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
LABEL maintainer="Hugging Face" LABEL maintainer="Hugging Face"
LABEL repository="diffusers" LABEL repository="diffusers"
ARG PYTHON_VERSION=3.12
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get -y update \ RUN apt-get -y update \
&& apt-get install -y software-properties-common \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa && add-apt-repository ppa:deadsnakes/ppa && \
apt-get update
RUN apt install -y bash \ RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
curl \ curl \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.10 \ python3 \
python3.10-dev \ python3-pip \
python3-pip \ && apt-get clean \
python3.10-venv && \ && rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# make sure to use venv ENV PATH="/root/.local/bin:$PATH"
RUN python3.10 -m venv /opt/venv ENV VIRTUAL_ENV="/opt/venv"
ENV PATH="/opt/venv/bin:$PATH" ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py) # pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN uv pip install --no-cache-dir \
python3.10 -m pip install --no-cache-dir \ torch \
torch \ torchvision \
torchvision \ torchaudio
torchaudio \
invisible_watermark && \ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
python3.10 -m uv pip install --no-cache-dir \
accelerate \ # Extra dependencies
datasets \ RUN uv pip install --no-cache-dir \
hf-doc-builder \ accelerate \
huggingface-hub \ numpy==1.26.4 \
hf_transfer \ pytorch-lightning \
Jinja2 \ hf_transfer \
librosa \ xformers
numpy==1.26.4 \
scipy \
tensorboard \
transformers \
xformers \
hf_transfer
CMD ["/bin/bash"] CMD ["/bin/bash"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment