mirror of
https://github.com/vllm-project/vllm.git
synced 2025-10-20 14:53:52 +08:00
[Misc] Redact ray runtime env before logging (#26302)
Signed-off-by: Rui Qiao <ruisearch42@gmail.com>
This commit is contained in:
@ -1327,7 +1327,13 @@ class EngineArgs:
|
||||
import ray
|
||||
|
||||
ray_runtime_env = ray.get_runtime_context().runtime_env
|
||||
logger.info("Using ray runtime env: %s", ray_runtime_env)
|
||||
# Avoid logging sensitive environment variables
|
||||
sanitized_env = ray_runtime_env.to_dict() if ray_runtime_env else {}
|
||||
if "env_vars" in sanitized_env:
|
||||
sanitized_env["env_vars"] = {
|
||||
k: "***" for k in sanitized_env["env_vars"]
|
||||
}
|
||||
logger.info("Using ray runtime env (env vars redacted): %s", sanitized_env)
|
||||
|
||||
# Get the current placement group if Ray is initialized and
|
||||
# we are in a Ray actor. If so, then the placement group will be
|
||||
|
Reference in New Issue
Block a user