[Doc] [Serve] Fix README's quick_start and add to test suite (#22228)

This commit is contained in:
Jiao 2022-02-09 11:49:47 -08:00 committed by GitHub
parent 54a71e6c4f
commit 293e45c527
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 2 deletions

View file

@ -0,0 +1,5 @@
py_library(
name = "serve_doc_code",
srcs = glob(["**/*.py"]),
visibility = ["//python/ray/serve:__subpackages__", "//python/ray/serve:__pkg__"],
)

View file

@ -24,8 +24,8 @@ class BoostingModel:
self.label_list = iris_dataset["target_names"].tolist()
async def __call__(self, request):
payload = await request.json()["vector"]
print(f"Received flask request with data {payload}")
payload = (await request.json())["vector"]
print(f"Received http request with data {payload}")
prediction = self.model.predict([payload])[0]
human_name = self.label_list[prediction]

View file

@ -340,6 +340,13 @@ py_test(
deps = [":serve_lib"]
)
py_test(
name = "tutorial_sklearn_ray_overview",
size = "small",
main = "quick_start.py",
srcs = ["//doc/source/serve/_examples/doc_code:serve_doc_code"],
tags = ["exclusive", "team:serve"],
)
py_test(
name = "tutorial_rllib",