From 54f0131f1d44175f2822224ec438c117ad696912 Mon Sep 17 00:00:00 2001 From: Gene Su Date: Wed, 24 May 2023 17:59:54 -0700 Subject: [PATCH 1/3] [Serve] support -h to serve cli * also added serve symlink to setup-dev.py script issue: https://github.com/ray-project/ray/issues/35734 Signed-off-by: Gene Su --- python/ray/serve/scripts.py | 6 +++++- python/ray/setup-dev.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/ray/serve/scripts.py b/python/ray/serve/scripts.py index 87d2f207705a..f0ba1bfea50c 100644 --- a/python/ray/serve/scripts.py +++ b/python/ray/serve/scripts.py @@ -49,6 +49,7 @@ "http://localhost:52365). Can also be specified using the " "RAY_AGENT_ADDRESS environment variable." ) +CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) # See https://stackoverflow.com/a/33300001/11162437 @@ -122,7 +123,10 @@ def convert_args_to_dict(args: Tuple[str]) -> Dict[str, str]: return args_dict -@click.group(help="CLI for managing Serve applications on a Ray cluster.") +@click.group( + help="CLI for managing Serve applications on a Ray cluster.", + context_settings=CONTEXT_SETTINGS, +) def cli(): pass diff --git a/python/ray/setup-dev.py b/python/ray/setup-dev.py index e87cf6da8ac1..d9161ea3ba33 100755 --- a/python/ray/setup-dev.py +++ b/python/ray/setup-dev.py @@ -122,6 +122,7 @@ def do_link(package, force=False, skip_list=None, local_path=None): skip_list=args.skip, local_path="../../../dashboard", ) + do_link("serve", force=args.yes, skip_list=args.skip) print( "Created links.\n\nIf you run into issues initializing Ray, please " "ensure that your local repo and the installed Ray are in sync " From 8ed6643375d5f74bb56e5e9bbb5a7860921aaae1 Mon Sep 17 00:00:00 2001 From: Gene Su Date: Thu, 25 May 2023 09:02:58 -0700 Subject: [PATCH 2/3] drop symlink script change Signed-off-by: Gene Su --- python/ray/setup-dev.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/ray/setup-dev.py b/python/ray/setup-dev.py index d9161ea3ba33..e87cf6da8ac1 100755 --- a/python/ray/setup-dev.py +++ b/python/ray/setup-dev.py @@ -122,7 +122,6 @@ def do_link(package, force=False, skip_list=None, local_path=None): skip_list=args.skip, local_path="../../../dashboard", ) - do_link("serve", force=args.yes, skip_list=args.skip) print( "Created links.\n\nIf you run into issues initializing Ray, please " "ensure that your local repo and the installed Ray are in sync " From b266e6fcfee3d5eb5779ce8c844d73250512c601 Mon Sep 17 00:00:00 2001 From: Gene Su Date: Thu, 25 May 2023 09:38:10 -0700 Subject: [PATCH 3/3] move -CONTEXT_SETTINGS inline Signed-off-by: Gene Su --- python/ray/serve/scripts.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/ray/serve/scripts.py b/python/ray/serve/scripts.py index f0ba1bfea50c..b1c668114261 100644 --- a/python/ray/serve/scripts.py +++ b/python/ray/serve/scripts.py @@ -49,7 +49,6 @@ "http://localhost:52365). Can also be specified using the " "RAY_AGENT_ADDRESS environment variable." ) -CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) # See https://stackoverflow.com/a/33300001/11162437 @@ -125,7 +124,7 @@ def convert_args_to_dict(args: Tuple[str]) -> Dict[str, str]: @click.group( help="CLI for managing Serve applications on a Ray cluster.", - context_settings=CONTEXT_SETTINGS, + context_settings=dict(help_option_names=["-h", "--help"]), ) def cli(): pass