Skip to content

Conversation

aslonnie
Copy link
Collaborator

so that it is easier to detect the ray version in the image

so that it is easier to detect the ray version in the image

Signed-off-by: Lonnie Liu <[email protected]>
Copy link
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 adds version and commit hash labels to the Ray Docker image, which is a great improvement for traceability. The implementation is straightforward. I've suggested a minor improvement to make the version string parsing more robust.

@@ -7,6 +7,9 @@ CONSTRAINTS_FILE="$3"
DEST_IMAGE="$4"
PIP_FREEZE_FILE="$5"

RAY_VERSION="$(python python/ray/_version.py | cut -d' ' -f1)"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using cut -d' ' -f1 can be brittle if the output format of python/ray/_version.py changes. For example, if there are multiple spaces between the version and commit hash, cut might not extract the version correctly. Using awk '{print $1}' is more robust as it handles any amount of whitespace and will correctly extract the first field.

Suggested change
RAY_VERSION="$(python python/ray/_version.py | cut -d' ' -f1)"
RAY_VERSION="$(python python/ray/_version.py | awk '{print $1}')"

@ray-gardener ray-gardener bot added the core Issues that should be addressed in Ray Core label Sep 13, 2025
@aslonnie aslonnie added the go add ONLY when ready to merge, run all tests label Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant