Skip to content

[ci] add RayImage model and image type config (build_image.py)#61336

Merged
aslonnie merged 4 commits intomasterfrom
andrew/revup/master/build-image-model
Feb 28, 2026
Merged

[ci] add RayImage model and image type config (build_image.py)#61336
aslonnie merged 4 commits intomasterfrom
andrew/revup/master/build-image-model

Conversation

@andrew-anyscale
Copy link
Copy Markdown
Contributor

@andrew-anyscale andrew-anyscale commented Feb 26, 2026

Add core data model for local Docker image building: RayImage dataclass, IMAGE_TYPE_CONFIG loaded from ray-images.yaml, wanda spec path mapping, and validation logic.

Topic: build-image-model
Relative: ray-images-use
Signed-off-by: andrew andrew@anyscale.com

@andrew-anyscale
Copy link
Copy Markdown
Contributor Author

andrew-anyscale commented Feb 26, 2026

Reviews in this chain:
#61285 [ci] Add ray-images.yaml schema and validation test
 └#61286 [ci] Use ray-images.yaml for Docker image constants
  └#61336 [ci] add RayImage model and image type config (build_image.py)
   └#61337 [ci] add ImageBuildConfig and ImageBuilder for local Docker builds
    └#61338 [ci] add CLI for local Docker image builder (build_image.py)
     └#61042 [build] feat: add top-level build-image.sh

@andrew-anyscale
Copy link
Copy Markdown
Contributor Author

andrew-anyscale commented Feb 26, 2026

# head base diff date summary
0 d4af784e 4cdd0e0c diff Feb 25 17:43 PM 3 files changed, 242 insertions(+)
1 bdf50095 242338e8 diff Feb 25 17:45 PM 0 files changed
2 19bae4fa 242338e8 diff Feb 25 18:40 PM 2 files changed, 71 insertions(+), 14 deletions(-)
3 868d99de 8023fc7b rebase Feb 25 18:57 PM 0 files changed
4 e0dc1b6d 392777e4 rebase Feb 25 20:36 PM 0 files changed
5 b014c7e7 688d850d rebase Feb 25 20:38 PM 0 files changed
6 d11c348f fd1bdfb0 rebase Feb 25 20:42 PM 0 files changed
7 ef50e0f0 92554d19 diff Feb 25 20:53 PM 2 files changed, 13 insertions(+), 2 deletions(-)
8 dc1385e3 92554d19 diff Feb 26 6:40 AM 1 file changed, 1 insertion(+), 3 deletions(-)

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a core data model for local Docker image building, including the RayImage dataclass and configuration loading from ray-images.yaml. The changes are well-structured and include corresponding tests.

My review includes two main suggestions for ci/build/build_image.py:

  1. Improve the robustness of file path resolution by using the existing find_ray_root() utility.
  2. Enhance the design by encapsulating the logic for mapping an image platform to a Wanda spec file, which will make the module more self-contained and easier to use.

Overall, this is a good addition that sets a solid foundation for image building logic.

Comment thread ci/build/build_image.py Outdated

def _load_ray_images_yaml() -> dict:
"""Load ray-images.yaml from the repository root (relative to this file)."""
path = Path(__file__).resolve().parent.parent.parent / "ray-images.yaml"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Instead of hardcoding the relative path to the repository root (../../..), please use the find_ray_root() function from build_common. This makes path resolution more robust against file moves.

You'll also need to update the import on line 16 to include find_ray_root:
from ci.build.build_common import BuildError, find_ray_root

Suggested change
path = Path(__file__).resolve().parent.parent.parent / "ray-images.yaml"
path = find_ray_root() / "ray-images.yaml"

Comment thread ci/build/build_image.py
Comment thread ci/build/build_image.py Outdated
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/build-image-model branch 2 times, most recently from 19bae4f to 868d99d Compare February 26, 2026 02:57
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/ray-images-use branch from 242338e to 8023fc7 Compare February 26, 2026 02:57
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/build-image-model branch from 868d99d to e0dc1b6 Compare February 26, 2026 04:36
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/ray-images-use branch from 8023fc7 to 392777e Compare February 26, 2026 04:36
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/build-image-model branch from e0dc1b6 to b014c7e Compare February 26, 2026 04:38
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/ray-images-use branch 2 times, most recently from 688d850 to fd1bdfb Compare February 26, 2026 04:42
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/build-image-model branch from b014c7e to d11c348 Compare February 26, 2026 04:42
Comment thread ci/build/build_image.py
Add ray-images.yaml as a single source of truth for supported Ray Docker image configurations (ray, ray-ml, ray-llm). Each image type declares its defaults, supported python versions, platforms, and architectures.

Add a loader module (ci/ray_ci/supported_images.py) and a Bazel test (test_supported_images) that validates the YAML schema is well-formed and internally consistent.

Topic: ray-images-schema
Signed-off-by: andrew <andrew@anyscale.com>
Replace hardcoded Python/CUDA/architecture constants in ci/ray_ci/docker_container.py with values loaded from ray-images.yaml

Topic: ray-images-use
Relative: ray-images-schema
Signed-off-by: andrew <andrew@anyscale.com>
Add core data model for local Docker image building: RayImage dataclass, IMAGE_TYPE_CONFIG loaded from ray-images.yaml, wanda spec path mapping, and validation logic.

Topic: build-image-model
Relative: ray-images-use
Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/build-image-model branch from d11c348 to ef50e0f Compare February 26, 2026 04:54
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/ray-images-use branch from fd1bdfb to 92554d1 Compare February 26, 2026 04:54
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread ci/build/build_image.py
@ray-gardener ray-gardener bot added the community-contribution Contributed by the community label Feb 26, 2026
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/master/build-image-model branch from ef50e0f to dc1385e Compare February 26, 2026 14:40
Base automatically changed from andrew/revup/master/ray-images-use to master February 28, 2026 03:27
@buildkite-limited-access buildkite-limited-access bot requested a review from a team as a code owner February 28, 2026 03:27
@aslonnie aslonnie enabled auto-merge (squash) February 28, 2026 03:49
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Feb 28, 2026
@aslonnie aslonnie merged commit 958a6eb into master Feb 28, 2026
6 of 8 checks passed
@aslonnie aslonnie deleted the andrew/revup/master/build-image-model branch February 28, 2026 04:08
kamil-kaczmarek pushed a commit that referenced this pull request Mar 3, 2026
Add core data model for local Docker image building: RayImage dataclass,
IMAGE_TYPE_CONFIG loaded from ray-images.yaml, wanda spec path mapping,
and validation logic.

Signed-off-by: andrew <andrew@anyscale.com>
Co-authored-by: Lonnie Liu <95255098+aslonnie@users.noreply.github.com>
Signed-off-by: Kamil Kaczmarek <kamil@anyscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci community-contribution Contributed by the community go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants