[serve] Remove serve.link(), rename serve.split() -> serve.set_traffic() (#8072)

This commit is contained in:
Edward Oakes
2020-04-21 14:26:07 -05:00
committed by GitHub
parent 6799fbbd5e
commit 505f3a8714
22 changed files with 41 additions and 57 deletions
+4 -20
View File
@@ -246,28 +246,12 @@ def create_backend(func_or_class,
@_ensure_connected
def link(endpoint_name, backend_tag):
"""Associate a service endpoint with backend tag.
Example:
>>> serve.link("service-name", "backend:v1")
Note:
This is equivalent to
>>> serve.split("service-name", {"backend:v1": 1.0})
"""
split(endpoint_name, {backend_tag: 1.0})
@_ensure_connected
def split(endpoint_name, traffic_policy_dictionary):
def set_traffic(endpoint_name, traffic_policy_dictionary):
"""Associate a service endpoint with traffic policy.
Example:
>>> serve.split("service-name", {
>>> serve.set_traffic("service-name", {
"backend:v1": 0.5,
"backend:v2": 0.5
})
@@ -278,8 +262,8 @@ def split(endpoint_name, traffic_policy_dictionary):
to their traffic weights. The weights must sum to 1.
"""
ray.get(
master_actor.split_traffic.remote(endpoint_name,
traffic_policy_dictionary))
master_actor.set_traffic.remote(endpoint_name,
traffic_policy_dictionary))
@_ensure_connected