Unverified Commit 467a4f98 authored by Rui Qiao's avatar Rui Qiao Committed by GitHub
Browse files

[Misc] Redact ray runtime env before logging (#26302)


Signed-off-by: default avatarRui Qiao <ruisearch42@gmail.com>
parent e614ab78
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment