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

upgrade to python 3.10 in the Dockerfiles (#7893)

* upgrade to python 3.10

* fix

* try https://askubuntu.com/questions/1459694/can-not-find-python3-10-after-apt-get-installation

* fix

* up

* yes

* okay

* up

* up

* up

* up

* up

* check

* okay

* up

* i[

* fix
parent b934215d
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,13 +16,13 @@ RUN apt update && \ ...@@ -13,13 +16,13 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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)
......
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,13 +16,13 @@ RUN apt update && \ ...@@ -13,13 +16,13 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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)
......
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,13 +16,13 @@ RUN apt update && \ ...@@ -13,13 +16,13 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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)
......
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,24 +16,24 @@ RUN apt update && \ ...@@ -13,24 +16,24 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
python3 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
"onnxruntime-gpu>=1.13.1" \ "onnxruntime-gpu>=1.13.1" \
--extra-index-url https://download.pytorch.org/whl/cu117 && \ --extra-index-url https://download.pytorch.org/whl/cu117 && \
python3 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
accelerate \ accelerate \
datasets \ datasets \
hf-doc-builder \ hf-doc-builder \
......
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,24 +16,23 @@ RUN apt update && \ ...@@ -13,24 +16,23 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.9 \ python3.10 \
python3.9-dev \
python3-pip \ python3-pip \
python3.9-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3.9 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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.9 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
python3.9 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
invisible_watermark && \ invisible_watermark && \
python3.9 -m pip install --no-cache-dir \ python3.10 -m pip install --no-cache-dir \
accelerate \ accelerate \
datasets \ datasets \
hf-doc-builder \ hf-doc-builder \
......
...@@ -4,33 +4,36 @@ LABEL repository="diffusers" ...@@ -4,33 +4,36 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
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 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
libgl1 \ libgl1 \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
python3 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
invisible_watermark \ invisible_watermark \
--extra-index-url https://download.pytorch.org/whl/cpu && \ --extra-index-url https://download.pytorch.org/whl/cpu && \
python3 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
accelerate \ accelerate \
datasets \ datasets \
hf-doc-builder \ hf-doc-builder \
......
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,23 +16,23 @@ RUN apt update && \ ...@@ -13,23 +16,23 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
python3 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
invisible_watermark && \ invisible_watermark && \
python3 -m pip install --no-cache-dir \ python3.10 -m pip install --no-cache-dir \
accelerate \ accelerate \
datasets \ datasets \
hf-doc-builder \ hf-doc-builder \
......
...@@ -4,8 +4,11 @@ LABEL repository="diffusers" ...@@ -4,8 +4,11 @@ LABEL repository="diffusers"
ENV DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && \ RUN apt-get -y update \
apt install -y bash \ && apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y bash \
build-essential \ build-essential \
git \ git \
git-lfs \ git-lfs \
...@@ -13,23 +16,23 @@ RUN apt update && \ ...@@ -13,23 +16,23 @@ RUN apt update && \
ca-certificates \ ca-certificates \
libsndfile1-dev \ libsndfile1-dev \
libgl1 \ libgl1 \
python3.8 \ python3.10 \
python3-pip \ python3-pip \
python3.8-venv && \ python3.10-venv && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# make sure to use venv # make sure to use venv
RUN python3 -m venv /opt/venv RUN python3.10 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH" 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 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \ RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
python3 -m pip install --no-cache-dir \ python3.10 -m pip install --no-cache-dir \
torch \ torch \
torchvision \ torchvision \
torchaudio \ torchaudio \
invisible_watermark && \ invisible_watermark && \
python3 -m uv pip install --no-cache-dir \ python3.10 -m uv pip install --no-cache-dir \
accelerate \ accelerate \
datasets \ datasets \
hf-doc-builder \ hf-doc-builder \
......
...@@ -112,7 +112,7 @@ pip install -e ".[flax]" ...@@ -112,7 +112,7 @@ pip install -e ".[flax]"
These commands will link the folder you cloned the repository to and your Python library paths. These commands will link the folder you cloned the repository to and your Python library paths.
Python will now look inside the folder you cloned to in addition to the normal library paths. Python will now look inside the folder you cloned to in addition to the normal library paths.
For example, if your Python packages are typically installed in `~/anaconda3/envs/main/lib/python3.8/site-packages/`, Python will also search the `~/diffusers/` folder you cloned to. For example, if your Python packages are typically installed in `~/anaconda3/envs/main/lib/python3.10/site-packages/`, Python will also search the `~/diffusers/` folder you cloned to.
<Tip warning={true}> <Tip warning={true}>
......
...@@ -106,7 +106,7 @@ pip install -e ".[flax]" ...@@ -106,7 +106,7 @@ pip install -e ".[flax]"
これらのコマンドは、リポジトリをクローンしたフォルダと Python のライブラリパスをリンクします。 これらのコマンドは、リポジトリをクローンしたフォルダと Python のライブラリパスをリンクします。
Python は通常のライブラリパスに加えて、クローンしたフォルダの中を探すようになります。 Python は通常のライブラリパスに加えて、クローンしたフォルダの中を探すようになります。
例えば、Python パッケージが通常 `~/anaconda3/envs/main/lib/python3.8/site-packages/` にインストールされている場合、Python はクローンした `~/diffusers/` フォルダも同様に参照します。 例えば、Python パッケージが通常 `~/anaconda3/envs/main/lib/python3.10/site-packages/` にインストールされている場合、Python はクローンした `~/diffusers/` フォルダも同様に参照します。
<Tip warning={true}> <Tip warning={true}>
......
...@@ -105,7 +105,7 @@ pip install -e ".[flax]" ...@@ -105,7 +105,7 @@ pip install -e ".[flax]"
이러한 명령어들은 저장소를 복제한 폴더와 Python 라이브러리 경로를 연결합니다. 이러한 명령어들은 저장소를 복제한 폴더와 Python 라이브러리 경로를 연결합니다.
Python은 이제 일반 라이브러리 경로에 더하여 복제한 폴더 내부를 살펴봅니다. Python은 이제 일반 라이브러리 경로에 더하여 복제한 폴더 내부를 살펴봅니다.
예를들어 Python 패키지가 `~/anaconda3/envs/main/lib/python3.8/site-packages/`에 설치되어 있는 경우 Python은 복제한 폴더인 `~/diffusers/`도 검색합니다. 예를들어 Python 패키지가 `~/anaconda3/envs/main/lib/python3.10/site-packages/`에 설치되어 있는 경우 Python은 복제한 폴더인 `~/diffusers/`도 검색합니다.
<Tip warning={true}> <Tip warning={true}>
......
...@@ -102,7 +102,7 @@ pip install -e ".[flax]" ...@@ -102,7 +102,7 @@ pip install -e ".[flax]"
Esses comandos irá linkar a pasta que você clonou o repositório e os caminhos das suas bibliotecas Python. Esses comandos irá linkar a pasta que você clonou o repositório e os caminhos das suas bibliotecas Python.
Python então irá procurar dentro da pasta que você clonou além dos caminhos normais das bibliotecas. Python então irá procurar dentro da pasta que você clonou além dos caminhos normais das bibliotecas.
Por exemplo, se o pacote python for tipicamente instalado no `~/anaconda3/envs/main/lib/python3.8/site-packages/`, o Python também irá procurar na pasta `~/diffusers/` que você clonou. Por exemplo, se o pacote python for tipicamente instalado no `~/anaconda3/envs/main/lib/python3.10/site-packages/`, o Python também irá procurar na pasta `~/diffusers/` que você clonou.
<Tip warning={true}> <Tip warning={true}>
......
...@@ -107,7 +107,7 @@ pip install -e ".[flax]" ...@@ -107,7 +107,7 @@ pip install -e ".[flax]"
这些命令将连接到你克隆的版本库和你的 Python 库路径。 这些命令将连接到你克隆的版本库和你的 Python 库路径。
现在,不只是在通常的库路径,Python 还会在你克隆的文件夹内寻找包。 现在,不只是在通常的库路径,Python 还会在你克隆的文件夹内寻找包。
例如,如果你的 Python 包通常安装在 `~/anaconda3/envs/main/lib/python3.8/Site-packages/`,Python 也会搜索你克隆到的文件夹。`~/diffusers/` 例如,如果你的 Python 包通常安装在 `~/anaconda3/envs/main/lib/python3.10/Site-packages/`,Python 也会搜索你克隆到的文件夹。`~/diffusers/`
<Tip warning={true}> <Tip warning={true}>
......
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