ray-project / ray

Ray is an AI compute engine. 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.72k stars 5.73k forks source link

[Core]: Prevent remote worker STDOUT log to add the name/pid decorator #47354

Open simenandresen opened 2 months ago

simenandresen commented 2 months ago

Description

Give the option to remove the name/pid prefix from STDOUT logs using an environment variable. One could, turn off the prefix with, say, RAY_REMOVE_PID_PREFIX="true"

Use case

When running ray in e.g. Google Cloud Platform, it's very convenient to have full control over STDOUT in order to structure the logs as JSON (e.g. by setting a formatter in the python logger). For example, this can be parsed as json by GCP loggin: {"severity": "INFO", "message": "Hello from ray worker"}, but when running this in ray, we get: "(foobar pid=139, ip=10.116.3.3) {"severity": "INFO", "message": "Hello from ray worker"} which then can only be parsed as normal text.

tobiasdekker92 commented 2 months ago

We are having the same issue, we would really appreciate if this issue is solved!

anyscalesam commented 1 month ago

Straightforward enhancement that would give good QOL. Reviewing to see if we have bandwidth here - @simenandresen @tobiasdekker92 would either of you be interested in contributing a PR to add this?