报告关键 MACA 环境变量#279
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the environment variable collection in vllm_metax/collect_env.py to include MACA and MetaX-specific prefixes, prevents duplicate entries using a set, and adds corresponding unit tests. Feedback from the review highlights a potential security vulnerability where replacing the secret term 'api' with 'api_key' and 'apikey' could leak sensitive API keys (e.g., OPENAI_API). The reviewer suggests retaining 'api' in the secret terms list and instead explicitly exempting non-sensitive variables ending with _PYTHON_API from the secret filter.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| secret_terms = ("secret", "token", "api", "access", "password") | ||
| env_vars = [] | ||
| reported = set() | ||
| secret_terms = ("secret", "token", "api_key", "apikey", "access", "password") |
There was a problem hiding this comment.
将 secret_terms 中的 "api" 替换为 "api_key" 和 "apikey" 会降低对敏感环境变量的过滤强度。许多用户或第三方服务可能会使用包含 "api" 但不包含 "api_key" 的环境变量来存储敏感的 API 密钥(例如 HF_API、CLAUDE_API、OPENAI_API 等)。如果这些变量匹配到 report_prefix,它们可能会被意外泄露。
建议保留原有的 "api" 过滤项,并通过在循环中特判(例如排除以 _PYTHON_API 结尾的变量)来允许 MACA_VLLM_ENABLE_MCTLASS_PYTHON_API 被正常收集。
| secret_terms = ("secret", "token", "api_key", "apikey", "access", "password") | |
| secret_terms = ("secret", "token", "api", "access", "password") |
| if any(term in k.lower() for term in secret_terms): | ||
| continue |
There was a problem hiding this comment.
该 PR 在环境信息中补充关键 MACA 环境变量,方便复现沐曦推理环境并快速发现变量缺失或配置漂移。
这个修改面向沐曦 GPU 适配场景中比较容易影响开发、构建或验证稳定性的环节,把原来需要人工排查的问题前移到工具链、运行前检查或基准脚本中处理。实现上保持对现有默认行为的兼容,只在检测到明确配置、输入或环境异常时给出更直接的诊断,避免引入额外运行依赖,也方便维护者独立审阅该分支。
已在沐曦算力环境中完成对应分支验证,验证记录包含真实运行日志、命令输出和失败路径检查,本地归档目录为:E:/Documents/muxi/测试报告/vLLM-metax_real_env_validation_20260608。提交分支:
mengz/report-maca-env-vars,目标仓库:MetaX-MACA/vLLM-metax。