hi, I’m playing with the nightly built version of ray. I got an error, when I tried ‘serve start’ from the command line:
'RuntimeError: serve.start(detached=True) should not be called in anonymous Ray namespaces because you won’t be able to reconnect to the Serve instance after the script exits. If you want to start a long-lived Serve instance, provide a namespace when connecting to Ray. See the documentation for more details: Using Namespaces — Ray v2.0.0.dev0
But it seems no place for me to pass a namespace from this interface.
Any thought?
My ray version is: ray, version 2.0.0.dev0, and my python version is 3.8
Thanks,
-BS
Thanks for reporting this @blshao84 ! I filed a bug to track it on GitHub and we should be able to fix it soon:
opened 03:56PM - 07 Jun 21 UTC
P1
bug
serve
Reported here:
https://discuss.ray.io/t/serve-start-from-command-line-fails/242… 5
Repro:
```
ray start --head
serve start
2021-06-07 10:55:06,424 INFO worker.py:726 -- Connecting to existing Ray cluster at address: 192.168.0.124:6379
Traceback (most recent call last):
File "/Users/eoakes/anaconda3/bin/serve", line 33, in <module>
sys.exit(load_entry_point('ray', 'console_scripts', 'serve')())
File "/Users/eoakes/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/Users/eoakes/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/Users/eoakes/anaconda3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/eoakes/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/eoakes/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/Users/eoakes/code/ray/python/ray/serve/scripts.py", line 47, in start
serve.start(
File "/Users/eoakes/code/ray/python/ray/serve/api.py", line 654, in start
raise RuntimeError(
RuntimeError: serve.start(detached=True) should not be called in anonymous Ray namespaces because you won't be able to reconnect to the Serve instance after the script exits. If you want to start a long-lived Serve instance, provide a namespace when connecting to Ray. See the documentation for more details: https://docs.ray.io/en/master/namespaces.html?highlight=namespace#using-namespaces.
```
I notice this bug was fixed a few days ago, but after I upgrade ray to the latest nightly build, there’s still such an error. Here’s the way I did my upgrade:
pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/latest/ray-2.0.0.dev0-cp38-cp38-manylinux2014_x86_64.whl
I also tried install from a specific commit like this:
pip install -U https://s3-us-west-2.amazonaws.com/ray-wheels/master/8d56a36d28535fb64961327b037d8553700d7e4f/ray-2.0.0.dev0-cp38-cp38-manylinux2014_x86_64.whl , but still no luck.
Am I doing something wrong?
aha, I figure it out. I have to pip uninstall ray first. Probably it worth mentioning on the documentation.