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

[Core] Add ~/.local/bin to make which ray work if ray is installed in ~/.local #3368

Merged
merged 12 commits into from
Apr 15, 2024

Conversation

Michaelvll
Copy link
Collaborator

@Michaelvll Michaelvll commented Mar 26, 2024

To reproduce:

  1. docker build -t mydockerrepo/image-name:v1 .; docker push mydockerrepo/image-name:v1
FROM berkeleyskypilot/skypilot-k8s

# Use a RUN command to modify PATH and write to a temporary file
RUN echo "export PATH=$(echo $PATH | sed -e 's|/home/sky/.local/bin:||g' -e 's|:/home/sky/.local/bin||g')" > ~/.bashrc
  1. sky launch -c test --image-id docker:mydockerrepo/image-name:v1 echo hi

Another Dockerfile to test:

FROM berkeleyskypilot/skypilot-k8s

# Use a RUN command to modify PATH and write to a temporary file
RUN echo "export PATH=$(echo $PATH | sed -e 's|/home/sky/.local/bin:||g' -e 's|:/home/sky/.local/bin||g')" > ~/.bashrc

RUN pip uninstall ray -y

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)
    • Reproducible code above.
  • All smoke tests: pytest tests/test_smoke.py (except TPU tests [Examples] TPU example fail examples/tpu/tpuvm_mnist.yaml #3425)
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@Michaelvll Michaelvll changed the title [Core] Add ~/.local/bin for making which ray work if installed in ~/.local [Core] Add ~/.local/bin to make which ray work if ray is installed in ~/.local Mar 26, 2024
@Michaelvll Michaelvll marked this pull request as ready for review March 29, 2024 19:46
Copy link
Member

@concretevitamin concretevitamin left a comment

Choose a reason for hiding this comment

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

LGTM with a question, thanks @Michaelvll.

@@ -121,12 +123,18 @@
# latest ray port 6380, but those existing cluster launched before #1790
# that has ray cluster on the default port 6379 will be upgraded and
# restarted.
'echo PATH=$PATH; '
Copy link
Member

Choose a reason for hiding this comment

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

Is this for debugging? Worth a comment.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, just added the comment.

# previous ray installation happens in user's `~/.local` directory.
# ~/.local/bin is added to the end of PATH to avoid conflicts with ray just
# installed in the conda environment.
'export PATH=$PATH:$HOME/.local/bin; '
Copy link
Member

Choose a reason for hiding this comment

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

Do I understand correctly:

  • The issue is in some envs, our own Ray is by default installed into ~/.local/bin
  • In that env, this path is not in $PATH by default
  • So, previously we touch the SKY_RAY_PATH_FILE file, which is empty
  • Bug is, later on when we do our_ray start, our_ray is basically empty string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, this is exactly the issue. Tried to elaborate the comments a bit. PTAL : )

@Michaelvll Michaelvll merged commit 91d6d1b into master Apr 15, 2024
20 checks passed
@Michaelvll Michaelvll deleted the ray_path branch April 15, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants