Skip to content

Commit 1014fdd

Browse files
authored
[ci] use prebuilt ray core binaries and ray dashboard (#56903)
use core binary bits and dashboard builds from previous bits for testing. this caches c/c++ binary parts much more aggressively, and speeds up CI speed for python-only changes for about 15 minutes. Signed-off-by: Lonnie Liu <lonnie@anyscale.com>
1 parent ee59214 commit 1014fdd

File tree

14 files changed

+108
-26
lines changed

14 files changed

+108
-26
lines changed

.buildkite/core.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ group: core tests
22
depends_on:
33
- forge
44
- oss-ci-base_build
5+
- ray-core-build
6+
- ray-dashboard-build
57
steps:
68
# builds
79
- name: corebuild

.buildkite/data.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ group: data tests
22
depends_on:
33
- forge
44
- oss-ci-base_ml
5+
- ray-core-build
6+
- ray-dashboard-build
57
steps:
68
# builds
79
- name: data9build

.buildkite/llm.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
group: llm tests
22
depends_on:
33
- forge
4+
- ray-core-build
5+
- ray-dashboard-build
46
steps:
57
- name: llmbuild
68
wanda: ci/docker/llm.build.wanda.yaml

.buildkite/ml.rayci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
group: ml tests
2+
depends_on:
3+
- forge
4+
- ray-core-build
5+
- ray-dashboard-build
26
steps:
37
# builds
48
- name: minbuild-ml

.buildkite/others.rayci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ steps:
1818
--only-tags doctest
1919
--except-tags gpu
2020
--parallelism-per-worker 3
21-
depends_on: doctestbuild
21+
depends_on:
22+
- doctestbuild
23+
- ray-core-build
24+
- ray-dashboard-build
2225

2326
# java
2427
- label: ":java: java tests"

.buildkite/rllib.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
group: rllib tests
22
depends_on:
33
- forge
4+
- ray-core-build
5+
- ray-dashboard-build
46
steps:
57
# builds
68
- name: rllibbuild

.buildkite/serve.rayci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ group: serve tests
22
depends_on:
33
- forge
44
- oss-ci-base_build
5+
- ray-core-build
6+
- ray-dashboard-build
57
steps:
68
# builds
79
- name: servebuild

ci/ray_ci/docker_container.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ def __init__(
6666
upload: bool = False,
6767
) -> None:
6868
assert "RAYCI_CHECKOUT_DIR" in os.environ, "RAYCI_CHECKOUT_DIR not set"
69+
rayci_checkout_dir = os.environ["RAYCI_CHECKOUT_DIR"]
70+
71+
super().__init__(
72+
"forge" if architecture == "x86_64" else "forge-aarch64",
73+
python_version=python_version,
74+
volumes=[
75+
f"{rayci_checkout_dir}:/rayci",
76+
"/var/run/docker.sock:/var/run/docker.sock",
77+
],
78+
)
6979

7080
if image_type in [RayType.RAY_ML, RayType.RAY_ML_EXTRA]:
7181
assert python_version in PYTHON_VERSIONS_RAY_ML
@@ -81,22 +91,12 @@ def __init__(
8191
assert platform in PLATFORMS_RAY
8292
assert architecture in ARCHITECTURES_RAY
8393

84-
rayci_checkout_dir = os.environ["RAYCI_CHECKOUT_DIR"]
85-
self.python_version = python_version
8694
self.platform = platform
8795
self.image_type = image_type
8896
self.architecture = architecture
8997
self.canonical_tag = canonical_tag
9098
self.upload = upload
9199

92-
super().__init__(
93-
"forge" if architecture == "x86_64" else "forge-aarch64",
94-
volumes=[
95-
f"{rayci_checkout_dir}:/rayci",
96-
"/var/run/docker.sock:/var/run/docker.sock",
97-
],
98-
)
99-
100100
def _get_image_version_tags(self, external: bool) -> List[str]:
101101
"""
102102
Get version tags.

ci/ray_ci/linux_container.py

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import os
2+
import platform
23
import subprocess
34
import sys
45
from typing import List, Optional, Tuple
56

6-
from ci.ray_ci.container import Container
7+
from ci.ray_ci.configs import DEFAULT_ARCHITECTURE, DEFAULT_PYTHON_VERSION
8+
from ci.ray_ci.container import Container, get_docker_image
79

810
_DOCKER_CAP_ADD = [
911
"SYS_PTRACE",
@@ -18,17 +20,29 @@ def __init__(
1820
docker_tag: str,
1921
volumes: Optional[List[str]] = None,
2022
envs: Optional[List[str]] = None,
23+
python_version: Optional[str] = None,
2124
tmp_filesystem: Optional[str] = None,
25+
architecture: Optional[str] = None,
2226
privileged: bool = False,
2327
) -> None:
2428
super().__init__(docker_tag, volumes, envs)
2529

2630
if tmp_filesystem is not None:
2731
if tmp_filesystem != "tmpfs":
2832
raise ValueError("Only tmpfs is supported for tmp filesystem")
33+
34+
self.python_version = python_version or DEFAULT_PYTHON_VERSION
2935
self.tmp_filesystem = tmp_filesystem
3036
self.privileged = privileged
3137

38+
if architecture is None:
39+
architecture = platform.machine()
40+
if architecture.lower() == "amd64":
41+
architecture = "x86_64"
42+
if architecture == "arm64":
43+
architecture = "aarch64"
44+
self.architecture = architecture
45+
3246
def install_ray(
3347
self, build_type: Optional[str] = None, mask: Optional[str] = None
3448
) -> List[str]:
@@ -50,13 +64,21 @@ def install_ray(
5064
"--build-arg",
5165
f"BUILDKITE_CACHE_READONLY={cache_readonly}",
5266
]
67+
68+
if not build_type or build_type == "optimized":
69+
python_version = self.python_version
70+
core_image_tag = f"ray-core-py{python_version}"
71+
if self.architecture != DEFAULT_ARCHITECTURE:
72+
core_image_tag += f"-{self.architecture}"
73+
ray_core_image = get_docker_image(core_image_tag)
74+
build_cmd += ["--build-arg", f"RAY_CORE_IMAGE={ray_core_image}"]
75+
ray_dashboard_image = get_docker_image("ray-dashboard")
76+
build_cmd += ["--build-arg", f"RAY_DASHBOARD_IMAGE={ray_dashboard_image}"]
77+
5378
if mask:
5479
build_cmd += ["--build-arg", "RAY_INSTALL_MASK=" + mask]
55-
build_cmd += [
56-
"-f",
57-
"/ray/ci/ray_ci/tests.env.Dockerfile",
58-
"/ray",
59-
]
80+
81+
build_cmd += ["-f", "ci/ray_ci/tests.env.Dockerfile", "/ray"]
6082
subprocess.check_call(
6183
build_cmd,
6284
env=env,

ci/ray_ci/linux_tester_container.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ def __init__(
1616
shard_ids: Optional[List[int]] = None,
1717
skip_ray_installation: bool = False,
1818
build_type: Optional[str] = None,
19+
python_version: Optional[str] = None,
1920
install_mask: Optional[str] = None,
2021
tmp_filesystem: Optional[str] = None,
2122
privileged: bool = False,
@@ -28,6 +29,7 @@ def __init__(
2829
f"{os.environ.get('RAYCI_CHECKOUT_DIR')}:/ray-mount",
2930
"/var/run/docker.sock:/var/run/docker.sock",
3031
],
32+
python_version=python_version,
3133
tmp_filesystem=tmp_filesystem,
3234
privileged=privileged,
3335
)

0 commit comments

Comments
 (0)