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

[Doc] Add improved 'ray start --resources' help #41009

Merged

Conversation

peytondmurray
Copy link
Contributor

Why are these changes needed?

This PR clarifies usage of ray start --resources and gives an example of valid usage on Windows.

Related issue number

Closes #34818.

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

@mattip
Copy link
Contributor

mattip commented Nov 8, 2023

Maybe a triple-quoted string could be used to preserve line formatting, and with a touch of dedent to make it pretty? Also, note this is for the windows cmd command prompt. For powershell, additional escaping is needed. Maybe all this should only be added to the help text for windows, to give posix users less of an opportunity to laugh at windows users.

ray start --head --resources="{\""special_hardware\"":1, \""custom_label\"":1}"

@peytondmurray peytondmurray added the docs An issue or change related to documentation label Nov 8, 2023
@peytondmurray peytondmurray force-pushed the improve-ray-start-resources-help branch from de10038 to 254fc3d Compare December 6, 2023 19:21
@peytondmurray peytondmurray self-assigned this Dec 6, 2023
@peytondmurray peytondmurray added the P2 Important issue, but not time-critical label Dec 6, 2023
@peytondmurray peytondmurray force-pushed the improve-ray-start-resources-help branch from 254fc3d to 8e26289 Compare December 6, 2023 19:53
Copy link
Contributor

@mattip mattip left a comment

Choose a reason for hiding this comment

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

LGTM. I confirmed the change only happens on windows. FWIW, the help looks like

 --resources TEXT                A JSON serialized dictionary mapping
                                  resource name to resource quantity.
                                  
                                  Windows command prompt users must ensure to
                                  double quote command line arguments; since
                                  JSON requires the use of double quotes these
                                  must be escaped as well, e.g.
                                  
                                      ray start --head
                                      --resources="{\"special_hardware\":1,
                                      \"custom_label\":1}"
                                  
                                  Windows powershell users need additional
                                  escaping:
                                  
                                      ray start --head
                                      --resources="{\""special_hardware\"":1,
                                      \""custom_label\"":1}"

@peytondmurray peytondmurray added the core Issues that should be addressed in Ray Core label Dec 19, 2023
Copy link
Contributor

@angelinalg angelinalg left a comment

Choose a reason for hiding this comment

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

Some style nits.

python/ray/scripts/scripts.py Outdated Show resolved Hide resolved
python/ray/scripts/scripts.py Outdated Show resolved Hide resolved
Signed-off-by: pdmurray <peynmurray@gmail.com>
@peytondmurray peytondmurray force-pushed the improve-ray-start-resources-help branch from f4d145d to c104901 Compare December 20, 2023 17:03
@peytondmurray peytondmurray requested a review from jjyao January 4, 2024 20:00
@peytondmurray
Copy link
Contributor Author

@jjyao Would you be able to merge this?

@jjyao jjyao merged commit 6241d5c into ray-project:master Jan 8, 2024
9 checks passed
vickytsang pushed a commit to ROCm/ray that referenced this pull request Jan 12, 2024
This PR clarifies usage of ray start --resources and gives an example of valid usage on Windows.

Signed-off-by: pdmurray <peynmurray@gmail.com>
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 docs An issue or change related to documentation P2 Important issue, but not time-critical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ray Core.: ray start --resource not parsed correctly (Windows)
4 participants