mirror of
https://github.com/vale981/ray
synced 2025-03-09 04:46:38 -04:00
24 lines
390 B
Python
24 lines
390 B
Python
# __start_monitoring__
|
|
# File name: monitoring.py
|
|
|
|
from ray import serve
|
|
|
|
import logging
|
|
import requests
|
|
|
|
logger = logging.getLogger("ray.serve")
|
|
|
|
|
|
@serve.deployment
|
|
class SayHello:
|
|
async def __call__(self, request):
|
|
logger.info("Hello world!")
|
|
return "hi"
|
|
|
|
|
|
say_hello = SayHello.bind()
|
|
|
|
serve.run(say_hello)
|
|
|
|
requests.get("http://localhost:8000/")
|
|
# __end_monitoring__
|