Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve ray/serve/generated when creating softlink for serve package #48793

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions python/ray/setup-dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,27 @@ def do_link(package, force=False, skip_list=None, local_path=None):
print("You don't have write permission " f"to {package_home}, using sudo:")
sudo = ["sudo"]
print(f"Creating symbolic link from \n {local_home} to \n {package_home}")

# Preserve ray/serve/generated
if package == "serve":
# Copy generated folder to a temp dir
generated_folder = os.path.join(package_home, "generated")
temp_dir = "/tmp/ray/_serve/"
if not os.path.exists(temp_dir):
os.makedirs(temp_dir)
subprocess.check_call(["cp", "-r", generated_folder, temp_dir])

subprocess.check_call(sudo + ["rm", "-rf", package_home])
subprocess.check_call(sudo + ["ln", "-s", local_home, package_home])

# Move generated folder to local_home
if package == "serve":
tmp_generated_folder = os.path.join(temp_dir, "generated")
package_generated_folder = os.path.join(package_home, "generated")
subprocess.check_call(
["mv", tmp_generated_folder, package_generated_folder]
)


if __name__ == "__main__":
parser = argparse.ArgumentParser(
Expand Down
Loading