Comments (4)
@edoakes question: above I've only described how it would work for
serve.run
. I haven't looked at the code yet, but I assume that it'll need be to allowed in more places, like from a static Serve config file?
We can do the same in the config file:
route_prefix: null
from ray.
@edoakes question: above I've only described how it would work for serve.run
. I haven't looked at the code yet, but I assume that it'll need be to allowed in more places, like from a static Serve config file?
from ray.
Great news! As far as I can tell, this actually already works, and is sort-of documented here:
ray/python/ray/serve/schema.py
Lines 979 to 981 in e4cb2fe
And indeed, passing route_prefix=None
to serve.run
or setting route_prefix: null
in a Serve config file does the right thing:
import time
import requests
from ray import serve
@serve.deployment()
class D:
async def __call__(self, *args, **kwargs):
return "Hello, world!"
d = D.bind()
if __name__ == "__main__":
serve.run(d, route_prefix=None)
time.sleep(5)
print(requests.get("http://localhost:8000/-/routes").json()) # {}
print('sleeping...')
time.sleep(100000)
proxy_location: EveryNode
http_options:
host: 0.0.0.0
port: 8000
applications:
- name: d
route_prefix: null
import_path: serve:d
It looks like the join point between the controller state and what the proxy ends up seeing is
ray/python/ray/serve/_private/application_state.py
Lines 344 to 361 in 7e315fe
route_prefix
es, not caring whether they are ingress deployments or not.
Perhaps this was done for gRPC support? So that gRPC ingress didn't also imply an HTTP ingress route?
ray/doc/source/serve/advanced-guides/grpc-guide.md
Lines 141 to 142 in b3b79d2
It's even tested!
ray/python/ray/serve/tests/test_http_routes.py
Lines 74 to 86 in b074a2f
The main thing that's wrong seems to be the typing of the route_prefix
argument - I'll take care of that, and poke around for any docs adjacent to the route_prefix
that should discuss this.
from ray.
Great news! As far as I can tell, this actually already works, and is sort-of documented here:
ray/python/ray/serve/schema.py
Lines 979 to 981 in e4cb2fe
And indeed, passing
route_prefix=None
toserve.run
or settingroute_prefix: null
in a Serve config file does the right thing:import time import requests from ray import serve @serve.deployment() class D: async def __call__(self, *args, **kwargs): return "Hello, world!" d = D.bind() if __name__ == "__main__": serve.run(d, route_prefix=None) time.sleep(5) print(requests.get("http://localhost:8000/-/routes").json()) # {} print('sleeping...') time.sleep(100000)proxy_location: EveryNode http_options: host: 0.0.0.0 port: 8000 applications: - name: d route_prefix: null import_path: serve:d
It looks like the join point between the controller state and what the proxy ends up seeing is
ray/python/ray/serve/_private/application_state.py
Lines 344 to 361 in 7e315fe
, and it implicitly handles deployments without
route_prefix
es, not caring whether they are ingress deployments for not.
Perhaps this was done for gRPC support? So that gRPC ingress didn't also imply an HTTP ingress route?ray/doc/source/serve/advanced-guides/grpc-guide.md
Lines 141 to 142 in b3b79d2
It's even tested!
ray/python/ray/serve/tests/test_http_routes.py
Lines 74 to 86 in b074a2f
The main thing that's wrong seems to be the typing of the
route_prefix
argument - I'll take care of that, and poke around for any docs adjacent to theroute_prefix
that should discuss this.
Ah yes I believe you're right, I vaguely recall a conversation with @GeneDer about this when he was adding gRPC support :)
Let's clean up the API ref and document this then!
from ray.
Related Issues (20)
- [Core | Ray on Spark] Allow cluster_mode='yarn' for Ray on Spark
- [Core] Raylet may crash when the job exits HOT 2
- CI test windows://python/ray/tests:test_network_failure_e2e is consistently_failing HOT 2
- [Ray Serve] Running experimental multiple application in different containers on EKS HOT 3
- [core][accelerated DAGs] Assertion check fails when driver exits during teardown
- Serve: Add support for Podman 5.x for multi-container applications
- [Core] shall we document `__ray_call__` as a public API?
- Serialization Issue HOT 12
- CI test linux://rllib:TestLearnerGroupAsyncUpdate is consistently_failing HOT 4
- CI test linux://rllib:learning_tests_carpole_dqn_envrunner is consistently_failing HOT 9
- [Serve] Exited containers not cleaned up HOT 3
- [Air] ray.air.callbacks.wandb still exists, but fails on import due to `warn_structure_refactor` no longer existing
- [Core] Temporary folder per worker process HOT 5
- [RLlib] ray.tune.error.TuneError: Stopping criteria num_env_steps_sampled_lifetime not provided in result dict. HOT 1
- [data] autodoc mishandling type annotations HOT 1
- [Rllib] Rllib provides wrong state batch size during "bug check" batches on torch custom model
- Release test chaos_torch_batch_inference_16_gpu_300gb_raw.aws failed HOT 2
- [RLlib] PPO does not respect `sample_timeout_s` with old and hybrid API stacks
- Ray Cluster: Failed to create a ray cluster using running container HOT 1
- [RLlib|Tune] - Video results do not log correctly in wandb
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ray.