Skip to content

Commit

Permalink
[Doc] Add improved 'ray start --resources' help (ray-project#41009)
Browse files Browse the repository at this point in the history
This PR clarifies usage of ray start --resources and gives an example of valid usage on Windows.

Signed-off-by: pdmurray <peynmurray@gmail.com>
  • Loading branch information
peytondmurray authored and vickytsang committed Jan 12, 2024
1 parent 9fc7330 commit 68cbcc4
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion python/ray/scripts/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import logging
import os
import platform
import signal
import subprocess
import sys
Expand Down Expand Up @@ -386,7 +387,23 @@ def debug(address):
required=False,
default="{}",
type=str,
help="a JSON serialized dictionary mapping resource name to resource quantity",
help="A JSON serialized dictionary mapping resource name to resource quantity."
+ (
r"""
Windows command prompt users must ensure to double quote command line arguments. Because
JSON requires the use of double quotes you must escape these arguments as well, for
example:
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}"
"""
if platform.system() == "Windows"
else ""
),
)
@click.option(
"--head",
Expand Down

0 comments on commit 68cbcc4

Please sign in to comment.