@@ -43,12 +43,14 @@ RUN apt-get install -y ffmpeg libsm6 libxext6 libgl1
4343
4444# Utils
4545RUN apt-get install -y vim git bzip2 tmux wget tar htop curl
46- RUN add-apt-repository ppa:deadsnakes/ppa && apt-get install -y python3.12 python3.12-dev python3.12-venv
4746
48- RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1
49- RUN update-alternatives --set python3 /usr/bin/python3.12
50- RUN ln -sf /usr/bin/python3.12-config /usr/bin/python3-config
51- RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.12
47+ RUN add-apt-repository ppa:deadsnakes/ppa && apt-get install -y python${PY_VERSION} python${PY_VERSION}-dev python${PY_VERSION}-venv
48+ RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PY_VERSION} 1
49+ RUN update-alternatives --set python3 /usr/bin/python${PY_VERSION}
50+ RUN ln -sf /usr/bin/python${PY_VERSION}-config /usr/bin/python3-config
51+ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python${PY_VERSION}
52+
53+ RUN apt-get install -y python3-setuptools python3-dev libpython${PY_VERSION}-dev
5254
5355RUN curl -LsSf https://astral.sh/uv/0.8.14/install.sh | sh
5456
@@ -67,9 +69,9 @@ VISION_VER=\$2
6769CUDA_VER=\$ 3
6870BASE_DIR=/ddiff-base/py\$ {PY_VERSION}-torch\$ {TORCH_VER}
6971mkdir -p "\$ BASE_DIR" && cd "\$ BASE_DIR"
70- uv venv --python "\$ {PY_VERSION}" --system-site-packages
72+ uv venv --python "\$ {PY_VERSION}" --system-site-packages --seed
7173uv pip install --no-cache torch=="\$ {TORCH_VER}" torchvision=="\$ {VISION_VER}" torchaudio=="\$ {TORCH_VER}" --index-url "https://download.pytorch.org/whl/\$ {CUDA_VER}"
72- echo "ln -sfn \$ {BASE_DIR}/.venv ./.venv && echo Created uv virtual environment with torch==\$ {TORCH_VER}" > /usr/local/bin/uv_init_torch\$ {TORCH_VER}
74+ echo "ln -sfn \$ {BASE_DIR}/.venv ./.venv && uv add torch== \$ {TORCH_VER} torchvision== \$ {VISION_VER} torchaudio== \$ {TORCH_VER} && echo Created uv virtual environment with torch==\$ {TORCH_VER}" > /usr/local/bin/uv_init_torch\$ {TORCH_VER}
7375chmod +x /usr/local/bin/uv_init_torch\$ {TORCH_VER}
7476EOF
7577RUN chmod +x /usr/local/bin/install_torch_env
0 commit comments