You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bugSomething that is supposed to be working; but isn'tkuberayIssues for the Ray/Kuberay integration that are tracked on the Ray sideP1Issue that should be fixed within a few weeksserveRay Serve Related Issue
Serve deployment graphs use async handles. This requires two await statements. However, RayServices on KubeRay raise an error when attempting to use the double await statements.
Versions / Dependencies
Ray 2.0.0
Reproduction script
Example 1: This script runs locally on Ray 2.0.0 but fails on KubeRay:
importrayfromrayimportservefromray.serve.driversimportDAGDriverfromray.serve.deployment_graphimportInputNode# These imports are used only for type hints:fromtypingimportDict, Listfromstarlette.requestsimportRequestfromray.serve.deployment_graphimportClassNodefromray.serve.handleimportRayServeDeploymentHandle@serve.deployment(num_replicas=2)classFruitMarket:
def__init__(
self,
mango_stand: RayServeDeploymentHandle,
orange_stand: RayServeDeploymentHandle,
pear_stand: RayServeDeploymentHandle,
):
self.directory= {
"MANGO": mango_stand,
"ORANGE": orange_stand,
"PEAR": pear_stand,
}
asyncdefcheck_price(self, fruit: str, amount: float) ->float:
iffruitnotinself.directory:
return-1else:
fruit_stand=self.directory[fruit]
returnawait (awaitfruit_stand.check_price.remote(amount))
@serve.deployment(user_config={"price": 3})classMangoStand:
DEFAULT_PRICE=1def__init__(self):
# This default price is overwritten by the one specified in the# user_config through the reconfigure() method.self.price=self.DEFAULT_PRICEdefreconfigure(self, config: Dict):
self.price=config.get("price", self.DEFAULT_PRICE)
defcheck_price(self, amount: float) ->float:
returnself.price*amount@serve.deployment(user_config={"price": 2})classOrangeStand:
DEFAULT_PRICE=0.5def__init__(self):
# This default price is overwritten by the one specified in the# user_config through the reconfigure() method.self.price=self.DEFAULT_PRICEdefreconfigure(self, config: Dict):
self.price=config.get("price", self.DEFAULT_PRICE)
defcheck_price(self, amount: float) ->float:
returnself.price*amount@serve.deployment(user_config={"price": 4})classPearStand:
DEFAULT_PRICE=0.75def__init__(self):
# This default price is overwritten by the one specified in the# user_config through the reconfigure() method.self.price=self.DEFAULT_PRICEdefreconfigure(self, config: Dict):
self.price=config.get("price", self.DEFAULT_PRICE)
defcheck_price(self, amount: float) ->float:
returnself.price*amountasyncdefjson_resolver(request: Request) ->List:
returnawaitrequest.json()
withInputNode() asquery:
fruit, amount=query[0], query[1]
mango_stand=MangoStand.bind()
orange_stand=OrangeStand.bind()
pear_stand=PearStand.bind()
fruit_market=FruitMarket.bind(mango_stand, orange_stand, pear_stand)
net_price=fruit_market.check_price.bind(fruit, amount)
deployment_graph=DAGDriver.bind(net_price, http_adapter=json_resolver)
The original working_dir points to this file, which uses a single await. The above working_dir URL points to this file, which uses two awaits.
Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered:
shrekris-anyscale
added
bug
Something that is supposed to be working; but isn't
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
serve
Ray Serve Related Issue
kuberay
Issues for the Ray/Kuberay integration that are tracked on the Ray side
P1
Issue that should be fixed within a few weeks
and removed
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
Sep 29, 2022
This is the PR that added the double await to Ray 2.0. I exec’d into a worker pod on K8s, and I used the Python interpreter to successfully import some functions/classes that the PR added. So it looks like the functionality that requires the double await does exist in the KubeRay pods, but for some reason it’s not being used.
bugSomething that is supposed to be working; but isn'tkuberayIssues for the Ray/Kuberay integration that are tracked on the Ray sideP1Issue that should be fixed within a few weeksserveRay Serve Related Issue
What happened + What you expected to happen
Serve deployment graphs use async handles. This requires two
await
statements. However, RayServices on KubeRay raise an error when attempting to use the doubleawait
statements.Versions / Dependencies
Ray 2.0.0
Reproduction script
Example 1: This script runs locally on Ray 2.0.0 but fails on KubeRay:
Example 2:
This KubeRay config runs as expected. You can test it with
However, it fails if you replace the
working_dir
with this URL:The original
working_dir
points to this file, which uses a singleawait
. The aboveworking_dir
URL points to this file, which uses twoawaits
.Issue Severity
Medium: It is a significant difficulty but I can work around it.
The text was updated successfully, but these errors were encountered: