Skip to content

[Build] Supports repeated execution of setup-dev.py#61357

Merged
edoakes merged 4 commits intoray-project:masterfrom
summaryzb:master
Mar 4, 2026
Merged

[Build] Supports repeated execution of setup-dev.py#61357
edoakes merged 4 commits intoray-project:masterfrom
summaryzb:master

Conversation

@summaryzb
Copy link
Copy Markdown
Contributor

Description

When setup-dev.py is executed again, it's very likely encounter a many symbolic link error or a problem where the /tmp/ray/_serve/ directory already exists.

If symbolic link exists just skip it

Related issues

Additional information

@summaryzb summaryzb requested a review from a team as a code owner February 26, 2026 13:39
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 improves the idempotency of the setup-dev.py script by adding a check to skip symlinking if it's already done, and by ensuring the temporary directory for ray.serve is cleaned up on each run. The changes are good, but there is a potential permission issue with directory creation that could cause the script to fail when run with sudo. I've left a comment with a suggestion to fix it.

Comment thread python/ray/setup-dev.py Outdated
@ray-gardener ray-gardener bot added the community-contribution Contributed by the community label Feb 26, 2026
Comment thread python/ray/setup-dev.py Outdated
@summaryzb summaryzb force-pushed the master branch 2 times, most recently from ec11644 to 6d0e9d8 Compare February 27, 2026 02:33
Comment thread python/ray/setup-dev.py Outdated
Signed-off-by: summaryzb <summaryzb@gmail.com>
Signed-off-by: summaryzb <summaryzb@gmail.com>
Comment thread python/ray/setup-dev.py
@summaryzb
Copy link
Copy Markdown
Contributor Author

gentle ping @bveeramani @myandpr

Signed-off-by: summaryzb <summaryzb@gmail.com>
Comment thread python/ray/setup-dev.py
Signed-off-by: summaryzb <summaryzb@gmail.com>
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.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread python/ray/setup-dev.py
if os.path.exists(serve_temp_dir):
subprocess.check_call(sudo + ["rm", "-rf", serve_temp_dir])
subprocess.check_call(sudo + ["mkdir", "-p", serve_temp_dir])
subprocess.check_call(sudo + ["mv", generated_folder, serve_temp_dir])
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sudo inconsistency between temp dir operations and move-back

Medium Severity

The new code creates /tmp/ray/_serve/ and moves files into it using sudo (lines 91–94), making the directory root-owned. However, the move-back operation at line 111 does not use sudo. When sudo is active, mv without elevated permissions will fail because the user lacks write permission on the root-owned temp directory to remove the entry. The old code was consistent — it never used sudo for temp dir operations, so the directory was always user-owned and the move-back worked.

Additional Locations (1)

Fix in Cursor Fix in Web

@edoakes edoakes added the go add ONLY when ready to merge, run all tests label Mar 2, 2026
@edoakes edoakes requested a review from aslonnie March 2, 2026 08:04
Copy link
Copy Markdown
Member

@bveeramani bveeramani left a comment

Choose a reason for hiding this comment

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

High-level changes seems reasonable to me.

Will defer to @aslonnie for actual review

Copy link
Copy Markdown
Collaborator

@aslonnie aslonnie left a comment

Choose a reason for hiding this comment

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

we do not really own this file... reef team wants to remove this..

@edoakes edoakes merged commit 20925a3 into ray-project:master Mar 4, 2026
7 checks passed
bittoby pushed a commit to bittoby/ray that referenced this pull request Mar 6, 2026
## Description
When setup-dev.py is executed again, it's very likely encounter a `many
symbolic link error` or a problem where the `/tmp/ray/_serve/ directory
already exists`.

If symbolic link exists just skip it
## Related issues

## Additional information

---------

Signed-off-by: summaryzb <summaryzb@gmail.com>
Signed-off-by: bittoby <bittoby@users.noreply.github.com>
ryanaoleary pushed a commit to ryanaoleary/ray that referenced this pull request Mar 13, 2026
## Description
When setup-dev.py is executed again, it's very likely encounter a `many
symbolic link error` or a problem where the `/tmp/ray/_serve/ directory
already exists`.

If symbolic link exists just skip it
## Related issues

## Additional information

---------

Signed-off-by: summaryzb <summaryzb@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

4 participants