ray-project / ray

Ray is a unified framework for scaling AI and Python applications. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.05k stars 5.59k forks source link

[SERVE] tracing_startup_hook doesn't work #46357

Closed stan1astrumu closed 1 week ago

stan1astrumu commented 2 months ago

What happened + What you expected to happen

enabling tracing_startup_hook causes ingress deployment to fail 'got an unexpected keyword argument '_ray_trace_ctx''

related: https://github.com/ray-project/ray/issues/46252

Versions / Dependencies

ray == 2.30.0 python == 3.9.18

Reproduction script

from fastapi import FastAPI
from ray import serve

app = FastAPI()

@serve.deployment
@serve.ingress(app)
class APIIngress:

   @app.post("/test")
   def test(data: List[int]) -> List[int]:
        return data

entry = APIIngress.bind()
ray start --head --tracing-startup-hook="ray.util.tracing.setup_local_tmp_tracing:setup_tracing"
serve run my_file:entry

make a call to the API

Issue Severity

High: It blocks me from completing my task.

anyscalesam commented 2 weeks ago

p2 because tracing-startup-hook is an experimental feature on Core side...

itsparth commented 2 weeks ago

Is there any workaround? To let tracing work in ray core, but disable it for ray serve?

jjyao commented 1 week ago

Duplicate of https://github.com/ray-project/ray/issues/46252

jjyao commented 1 week ago

Is there any workaround? To let tracing work in ray core, but disable it for ray serve?

I'm actually not aware of a way now.