Btw, using http_options in serve.start() fails:
raystart.py:
subprocess.run(["ray", "start", "--head", "--port", "8787", "--num-cpus", "2", "--dashboard-host", "localhost", "--dashboard-port", "8265"], capture_output=True, text=True, shell=True)
main.py:
http_options = {}
http_options["host"] = "127.0.0.1"
http_options["port"] = 8787
http_options["location"] = "HeadOnly"
http_options["num_cpus"] = 2
ray.init(address="127.0.0.1:8787", namespace="serve")
serve.start(http_options=http_options)
ray::HTTPProxyActor.ready() (pid=13332, ip=127.0.0.1, repr=<ray.serve.http_proxy.HTTPProxyActor object at 0x00000200B5906FA0>)
File "python\ray\_raylet.pyx", line 656, in ray._raylet.execute_task
File "python\ray\_raylet.pyx", line 697, in ray._raylet.execute_task
File "python\ray\_raylet.pyx", line 663, in ray._raylet.execute_task
File "python\ray\_raylet.pyx", line 667, in ray._raylet.execute_task
File "python\ray\_raylet.pyx", line 609, in ray._raylet.execute_task.function_executor
File "python\ray\_raylet.pyx", line 2130, in ray._raylet.CoreWorker.run_async_func_in_event_loop
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 439, in result
return self.__get_result()
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\concurrent\futures\_base.py", line 391, in __get_result
raise self._exception
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\util\tracing\tracing_helper.py", line 494, in _resume_span
return await method(self, *_args, **_kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\serve\http_proxy.py", line 353, in ready
return await done_set.pop()
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\util\tracing\tracing_helper.py", line 494, in _resume_span
return await method(self, *_args, **_kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\ray\serve\http_proxy.py", line 373, in run
raise ValueError(
ValueError: Failed to bind Ray Serve HTTP proxy to '127.0.0.1:8787'.
Please make sure your http-host and http-port are specified correctly.