Skip to content

Commit 61905b8

Browse files
[docker] rayimg base deps lock files (ray-project#57073)
generating lock files for base-deps image Including setuptools in base-deps requirements due to https://buildkite.com/ray-project/release/builds/67063#019a7066-7935-4eea-ac7b-3bf62705b81d/142-3586 Copying lock file to image and uv pip installing the deps Hello world release test run: https://buildkite.com/ray-project/release/builds/67552 --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com>
1 parent 51ea4e8 commit 61905b8

File tree

15 files changed

+4714
-29
lines changed

15 files changed

+4714
-29
lines changed

.buildkite/_images.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ steps:
1414
- "3.12"
1515
env:
1616
PYTHON_VERSION: "{{matrix}}"
17+
REQUIREMENTS_FILE: "ray_base_deps_py{{matrix}}.lock"
1718
ARCH_SUFFIX: ""
1819

1920
- name: raycpubaseextra
@@ -56,6 +57,7 @@ steps:
5657
env:
5758
PYTHON_VERSION: "{{matrix.python}}"
5859
CUDA_VERSION: "{{matrix.cuda}}"
60+
REQUIREMENTS_FILE: "ray_base_deps_py{{matrix.python}}.lock"
5961
ARCH_SUFFIX: ""
6062

6163
- name: raycudabaseextra

.buildkite/linux_aarch64.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ steps:
3939
env:
4040
PYTHON_VERSION: "{{matrix}}"
4141
ARCH_SUFFIX: "-aarch64"
42+
REQUIREMENTS_FILE: "ray_base_deps_py{{matrix}}.lock"
4243

4344
- name: raycpubaseextra-aarch64
4445
label: "wanda: ray.py{{matrix}}.cpu.base-extra (aarch64)"
@@ -81,6 +82,7 @@ steps:
8182
PYTHON_VERSION: "{{matrix.python}}"
8283
CUDA_VERSION: "{{matrix.cuda}}"
8384
ARCH_SUFFIX: "-aarch64"
85+
REQUIREMENTS_FILE: "ray_base_deps_py{{matrix.python}}.lock"
8486

8587
- name: raycudabaseextra-aarch64
8688
label: "wanda: ray.py{{matrix.python}}.cu{{matrix.cuda}}.base-extra (aarch64)"

build-docker.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,16 @@ RAY_DEPS_BUILD_DIR="$(mktemp -d)"
6464
cp docker/base-deps/Dockerfile "${RAY_DEPS_BUILD_DIR}/."
6565
mkdir -p "${RAY_DEPS_BUILD_DIR}/python"
6666
cp python/requirements_compiled.txt "${RAY_DEPS_BUILD_DIR}/python/requirements_compiled.txt"
67+
PYTHON_DEPSET_FILE_NAME="ray_base_deps_py${PYTHON_VERSION}.lock"
68+
REQUIREMENTS_FILE_BASE_DEPS="python/deplocks/base_deps/${PYTHON_DEPSET_FILE_NAME}"
69+
70+
cp "${REQUIREMENTS_FILE_BASE_DEPS}" "${RAY_DEPS_BUILD_DIR}/."
6771

6872
BUILD_CMD=(
6973
docker build "${BUILD_ARGS[@]}"
70-
--build-arg BASE_IMAG="$BASE_IMAGE"
74+
--build-arg BASE_IMAGE="$BASE_IMAGE"
7175
--build-arg PYTHON_VERSION="${PYTHON_VERSION}"
76+
--build-arg PYTHON_DEPSET="${PYTHON_DEPSET_FILE_NAME}"
7277
-t "rayproject/base-deps:dev$GPU" "${RAY_DEPS_BUILD_DIR}"
7378
)
7479

ci/raydepsets/configs/rayimg.depsets.yaml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ depsets:
8888
- ray_img_depset_${PYTHON_SHORT}
8989
output: release/ray_release/byod/ray_base_extra_testdeps_gpu_py${PYTHON_VERSION}.lock
9090
append_flags:
91-
- --unsafe-package ray
9291
- --extra-index-url https://download.pytorch.org/whl/cu128
92+
- --unsafe-package ray
9393
- --python-version=${PYTHON_VERSION}
9494
- --python-platform=linux
9595
build_arg_sets:
@@ -135,6 +135,25 @@ depsets:
135135
- py39
136136
- py310
137137

138+
# First layer of the ray release images. Contains all base layer python dependencies
139+
# and is a subset of the base extra test deps defined above (release image depset)
140+
- name: ray_base_deps_${PYTHON_SHORT}
141+
operation: subset
142+
source_depset: ray_base_extra_testdeps_${PYTHON_SHORT}
143+
requirements:
144+
- docker/base-deps/requirements.in
145+
output: python/deplocks/base_deps/ray_base_deps_py${PYTHON_VERSION}.lock
146+
append_flags:
147+
- --unsafe-package ray
148+
- --python-version=${PYTHON_VERSION}
149+
- --python-platform=linux
150+
build_arg_sets:
151+
- py39
152+
- py310
153+
- py311
154+
- py312
155+
include_setuptools: true
156+
138157
# Second layer of the ray release images. Contains anyscale cli deps (and others)
139158
# and is a subset of the base extra test deps defined above (release image depset)
140159
- name: ray_base_extra_${PYTHON_SHORT}

ci/raydepsets/tests/test_workspace.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ def test_invalid_build_arg_set_in_config():
172172
workspace = Workspace(dir=tmpdir)
173173
with unittest.TestCase().assertRaises(KeyError) as e:
174174
workspace.load_config(config_path=Path(tmpdir) / "test.depsets.yaml")
175-
print(str(e.exception))
176175
assert (
177176
"Build arg set invalid_build_arg_set not found in config test.depsets.yaml"
178177
in str(e.exception)

docker/base-deps/Dockerfile

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/usr/local/nvidia/lib64"
2525
ARG DEBIAN_FRONTEND=noninteractive
2626
ARG PYTHON_VERSION=3.9
2727

28+
ARG PYTHON_DEPSET
29+
2830
ARG RAY_UID=1000
2931
ARG RAY_GID=100
3032

@@ -68,6 +70,7 @@ ENV HOME=/home/ray
6870
WORKDIR /home/ray
6971

7072
COPY python/requirements_compiled.txt /home/ray/requirements_compiled.txt
73+
COPY "$PYTHON_DEPSET" /home/ray/python_depset.lock
7174

7275
SHELL ["/bin/bash", "-c"]
7376

@@ -100,27 +103,6 @@ $HOME/anaconda3/bin/conda install -y libgcc-ng python=$PYTHON_VERSION
100103
$HOME/anaconda3/bin/conda install -y -c conda-forge libffi=3.4.2
101104
$HOME/anaconda3/bin/conda clean -y --all
102105

103-
PIP_PKGS=(
104-
# Required a recent version of setuptools to be compatible with python 3.12+.
105-
setuptools==80.9.0
106-
107-
flatbuffers
108-
cython
109-
numpy # Necessary for Dataset to work properly.
110-
psutil
111-
112-
# For the ease to submit jobs on various cloud providers.
113-
"smart_open[s3,gcs,azure,http]"
114-
115-
six
116-
boto3
117-
pyopenssl
118-
cryptography
119-
google-api-python-client
120-
google-oauth
121-
"adlfs[abfs]"
122-
)
123-
124106
# Install uv
125107
wget -qO- https://astral.sh/uv/install.sh | sudo -E env UV_UNMANAGED_INSTALL="/usr/local/bin" sh
126108

@@ -130,9 +112,8 @@ export PATH=$HOME/anaconda3/bin:$PATH
130112
# Some packages are on PyPI as well as other indices, but the latter
131113
# (unhelpfully) take precedence. We use `--index-strategy unsafe-best-match`
132114
# to ensure that the best match is chosen from the available indices.
133-
uv pip install --system --no-cache-dir --index-strategy unsafe-best-match \
134-
-c $HOME/requirements_compiled.txt \
135-
"${PIP_PKGS[@]}"
115+
uv pip install --system --no-cache-dir --no-deps --index-strategy unsafe-best-match \
116+
-r $HOME/python_depset.lock
136117

137118
# We install cmake temporarily to get psutil
138119
sudo apt-get autoremove -y cmake zlib1g-dev

docker/base-deps/cpu.wanda.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ froms: ["ubuntu:22.04"]
33
dockerfile: docker/base-deps/Dockerfile
44
srcs:
55
- python/requirements_compiled.txt
6+
- python/deplocks/base_deps/$REQUIREMENTS_FILE
67
build_args:
78
- PYTHON_VERSION
89
- BASE_IMAGE=ubuntu:22.04
10+
- PYTHON_DEPSET=python/deplocks/base_deps/$REQUIREMENTS_FILE
911
tags:
1012
- cr.ray.io/rayproject/ray-py$PYTHON_VERSION-cpu-base$ARCH_SUFFIX

docker/base-deps/cuda.wanda.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ froms: ["nvidia/cuda:$CUDA_VERSION-devel-ubuntu22.04"]
33
dockerfile: docker/base-deps/Dockerfile
44
srcs:
55
- python/requirements_compiled.txt
6+
- python/deplocks/base_deps/$REQUIREMENTS_FILE
67
build_args:
78
- PYTHON_VERSION
89
- BASE_IMAGE=nvidia/cuda:$CUDA_VERSION-devel-ubuntu22.04
10+
- PYTHON_DEPSET=python/deplocks/base_deps/$REQUIREMENTS_FILE
911
tags:
1012
- cr.ray.io/rayproject/ray-py$PYTHON_VERSION-cu$CUDA_VERSION-base$ARCH_SUFFIX

docker/base-deps/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
setuptools==80.9.0
12
flatbuffers
23
cython
34
numpy # Necessary for Dataset to work properly.

0 commit comments

Comments
 (0)