GPU 风扇控制台 + 部署手册 + CI/打包 - #3
Merged
Merged
Conversation
…式,支持被外部调度工具调用 -重构风扇控制逻辑,分离循环和单次执行模式 - 添加详细的运行时统计和性能监控 - 支持 YAML 配置文件格式 - 优化 Dell 730 服务器初始化流程- 添加温度变化趋势分析和间隔统计 - 实现失败次数统计和告警防抖机制
- 基类统一「读」: get_fan_rotational_speed / get_cpu_temperature 收归基类, 经 utils/prometheus_client.py 查询(ipmi_exporter / node_exporter / DCGM) - 各机型子类只保留「写」: set_fan_speed / 手动与自动模式切换 - 新增 fanController/epycd8_controller.py: 永擎 EPYCD8 的 8 字节全量写 (raw 0x3a 0x01,0x00 即交回 BMC 自动),温度源覆盖为 GPU 温度(DCGM) - 入口增加 CONTROLLER_TYPES 机型绑定表;配置模板与 CLAUDE.md 同步 - 修复: max(空列表) ValueError 空值保护
app/ 为跑在 pve02 本机的单机应用(观测走 exporter,调控走 ipmitool raw): - controller.py 闭环控制: 「散热源(GPU/CPU) → 风扇位」分配驱动, 分段曲线 + 降温滞回 + 紧急全速(含滞回解除);分配未配置时兜底 跟随最热卡,不掉进 BMC 失明档 - safety.py 安全护栏: SIGTERM/SIGINT/atexit 全路径交回 BMC 自动, 心跳文件供独立看门狗兜底 - ipmi.py 8 字节全量 payload 编解码(少一字节 BMC 静默忽略) - sensors.py 多源读取: DCGM 端点 / nvidia-smi 兜底 / ipmi_exporter / node_exporter hwmon(k10temp 按语义标签 Tctl 关联) - store.py SQLite 持久化: 分配关系 + 运行时设置 + 操作审计 (谁在什么时候改了风扇,查 audit_log) - api.py REST + WebSocket 实时快照;api/history 代理 Prometheus query_range(浏览器不直连监控栈) - 设置与分配双向打通: 未纳入管控的 GPU 不能持有分配;取消管控 联动清除分配;启动恢复先设置后分配 + 脏数据自愈 - 掉卡语义: 该风扇位交回 BMC 自动(不狂转),卡恢复后自动接管 - deploy/: systemd 服务(开机自启 + TimeoutStopSec 保证退出回落) 与独立心跳看门狗(timer 每 2 分钟检查) - 54 个单元测试(payload 编解码 / 曲线滞回 / 分配校验 / 传感器解析)
- 布局: 侧边栏导航(概览 / 风扇控制 / 设置)+ 毛玻璃 sticky 顶栏, 窄屏自动折叠为顶部横条 - 概览页: GPU 指标卡(温度/功耗/显存/分到的风扇)、CPU Tctl 与 BMC 板载温度、Prometheus 历史趋势(15m~3h 分段切换,双 Y 轴) - 风扇控制页: 「GPU → 风扇接口」分配面板(下拉单选、跨源互斥自动 转移、未管控卡置灰禁用)、手动调速滑块(0 = 交回 BMC)、控制曲线图 - 设置页: 管控 GPU 勾选(与分配双向联动)、控制开关/周期、曲线折点 编辑、紧急阈值 —— 全部落 SQLite,保存即生效 - 实时链路: WebSocket 为主、断线自动降级 5s 轮询 + 3s 重连 - 图表统一主题(theme.ts),数字等宽字形,54 项单测覆盖的后端配合
- set_mode 切换后落库(此前只在内存,重启静默变回 auto, 控制器突然按曲线调档导致风扇行为突变) - 启动恢复: 先应用库里的设置(含 control.mode),再把最终生效值 全量回写 —— config.yaml 降级为首次初始化的种子, 不存在「回退到配置文件」的暗路径 - 设置页新增「控制模式」选择;模式切换写入审计日志 - 附带: 手动占空比入/出库时的曲线档位重置
- safety.close() 补清心跳:正常退出后看门狗不再做多余回落 - _run_fallback 温度只取受管控的卡(移出管控的卡不驱动兜底) - update_assignments 校验 kind=cpu 的 key 必须 'cpu'(防界面上 不可见却实际驱动风扇的幽灵源) - SettingsPanel dirty=false 时跟随快照(否则顶栏切模式后设置页 显示旧值,保存会覆盖外部操作) - BindingWizard 签名含 managed(取消管控后立即清残留选择)
- 风扇面板: 每个位加三态徽章 —— 自动调档(程序按温度算)/ 手动定速 (锁定你设的值,温度涨不提速)/ BMC 自动档(程序未接管,读不到 GPU) - 设置页: 控制总开关文案不再说「按曲线自动调档」(那是模式的事), 模式改为「自动调档 / 手动定速」并说明差异 - 顶栏: 模式按钮文案明确化 + tooltip 说明后果 - 面板底部加一行三态对照说明
…动发 Release)+ 冻结运行路径兼容 - app/runtime.py: 统一资源定位(源码 = app/ 包目录;PyInstaller 冻结 = exe 旁), config/data/static/heartbeat 四处路径接入,临时解包目录不再承载可变状态 - entry_console.py + packaging/: 控制台 onedir 与旧脚本 onefile 的跨平台构建脚本 - fancontroller(.once).py: 配置/日志目录在冻结运行时取 exe 所在目录 - 本地已验证: 70 单测通过;控制台 exe(API/静态页/SQLite 落位)与旧脚本 exe (缺配置报错、空配置正常退出)均实测通过
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
内容
合并 feature/monitoring-dashboard 分支累积的工作到 main:
v*tag:自动 GitHub Release 附全部产物本地已验证:70 单测通过;Windows 下控制台 exe 与旧脚本 exe 均实测可运行。