Skip to content

Commit 4b15d69

Browse files
authored
Replace conda with uv in dstackai/base images (#2649)
Closes: #2625
1 parent 20de4c7 commit 4b15d69

File tree

2 files changed

+14
-19
lines changed

2 files changed

+14
-19
lines changed

docker/base/Dockerfile

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
FROM nvidia/cuda:12.1.0-base-ubuntu20.04
22

33
ARG PYTHON
4-
ENV PYTHON=$PYTHON
4+
ARG _UV_HOME="/opt/uv"
5+
ENV UV_PYTHON="${PYTHON}"
6+
ENV UV_INSTALL_DIR="${_UV_HOME}/bin"
7+
ENV UV_PYTHON_INSTALL_DIR="${_UV_HOME}/python"
8+
ENV UV_PYTHON_BIN_DIR="${UV_PYTHON_INSTALL_DIR}/bin"
9+
ENV UV_MANAGED_PYTHON=1
510
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
6-
ENV PIP_ROOT_USER_ACTION=ignore
711

8-
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \
12+
ENV PATH="${UV_INSTALL_DIR}:${UV_PYTHON_BIN_DIR}:${PATH}"
13+
14+
RUN export DEBIAN_FRONTEND=noninteractive && \
15+
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub && \
916
apt-get update --fix-missing && \
10-
apt upgrade -y && \
11-
export DEBIAN_FRONTEND=noninteractive && \
17+
apt-get upgrade -y && \
1218
ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
1319
apt-get install -y tzdata && \
1420
dpkg-reconfigure --frontend noninteractive tzdata && \
1521
apt-get install -y bzip2 ca-certificates curl build-essential git libglib2.0-0 libsm6 libxext6 libxrender1 mercurial openssh-server subversion wget && \
1622
sed -i "s/.*PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config && mkdir /run/sshd && \
1723
mkdir ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && rm /etc/ssh/ssh_host_*
1824

19-
RUN wget -O Miniforge3.sh "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \
20-
bash Miniforge3.sh -b -p "/opt/conda" && \
21-
rm Miniforge3.sh && \
22-
ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \
23-
chmod +x /opt/conda/etc/profile.d/conda.sh && \
24-
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \
25-
/opt/conda/condabin/conda update conda --all -y && \
26-
/opt/conda/condabin/conda create --name workflow python=${PYTHON} -y && \
27-
/opt/conda/condabin/conda config --prepend channels "nvidia/label/cuda-12.1.0" && \
28-
/opt/conda/condabin/conda config --set always_yes true && \
29-
/opt/conda/condabin/conda clean --all && \
30-
echo "conda activate workflow" >> ~/.bashrc
25+
RUN curl -LsSf https://astral.sh/uv/install.sh | INSTALLER_NO_MODIFY_PATH=1 sh && \
26+
uv python install --preview --default

docker/base/devel.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ ARG VERSION
33

44
FROM dstackai/base:py$PYTHON-$VERSION-cuda-12.1
55

6-
RUN /opt/conda/condabin/conda install --name workflow cuda -y && \
7-
/opt/conda/condabin/conda clean --all
6+
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y cuda-12-1

0 commit comments

Comments
 (0)