Skip to content

Commit b32c5b8

Browse files
authored
Add uv to Docker image (#51675)
Ray has recently added uv support but it's not shipped with base images. This changes adds uv into ray's base image. Closes #51592 Signed-off-by: Dom Miketa <dominik.miketa@recursion.com>
1 parent 055e8e2 commit b32c5b8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docker/base-deps/Dockerfile

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ wget --quiet \
7878
/bin/bash /tmp/miniforge.sh -b -u -p $HOME/anaconda3
7979

8080
$HOME/anaconda3/bin/conda init
81-
echo 'export PATH=$HOME/anaconda3/bin:$PATH' >> /home/ray/.bashrc
81+
echo 'export PATH=$HOME/anaconda3/bin:$PATH' >> $HOME/.bashrc
8282
rm /tmp/miniforge.sh
8383
$HOME/anaconda3/bin/conda install -y libgcc-ng python=$PYTHON_VERSION
8484
$HOME/anaconda3/bin/conda install -y -c conda-forge libffi=3.4.2
@@ -105,13 +105,22 @@ if [[ "$AUTOSCALER" == "autoscaler" ]]; then
105105
)
106106
fi
107107

108-
$HOME/anaconda3/bin/pip install --no-cache-dir \
108+
# Install uv
109+
wget -qO- https://astral.sh/uv/install.sh | sudo env UV_UNMANAGED_INSTALL="/usr/local/bin" sh
110+
111+
# Set up Conda as system Python
112+
export PATH=$HOME/anaconda3/bin:$PATH
113+
114+
# Some packages are on PyPI as well as other indices, but the latter
115+
# (unhelpfully) take precedence. We use `--index-strategy unsafe-best-match`
116+
# to ensure that the best match is chosen from the available indices.
117+
uv pip install --system --no-cache-dir --index-strategy unsafe-best-match \
109118
-c $HOME/requirements_compiled.txt \
110119
"${PIP_PKGS[@]}"
111120

112121
# To avoid the following error on Jenkins:
113122
# AttributeError: 'numpy.ufunc' object has no attribute '__module__'
114-
$HOME/anaconda3/bin/pip uninstall -y dask
123+
uv pip uninstall --system dask
115124

116125
# We install cmake temporarily to get psutil
117126
sudo apt-get autoremove -y cmake zlib1g-dev

0 commit comments

Comments
 (0)