feat(worker): 实现集群限流与自适应负载

保留平台模型 RPM、TPM 和并发策略语义,增加 PostgreSQL 集群级租约、饱和候选重选和多平台自动负载,避免突发任务固定等待首个平台。\n\n新增 Worker 实时负载采样、自适应 active/heavy 容量、心跳与管理端指标,并扩展本地 acceptance runner,覆盖三 Worker、同模型三平台 2/4/6 并发和 48 个带图视频突发任务。\n\n验证:go test ./...、go vet ./...、PostgreSQL 跨 Store 集成测试、gofmt、bash -n、ShellCheck 及本地集群 provider-burst 验收通过;48/48 成功,无越限、重复提交、重复计费、重复回调或终态资源泄漏。
This commit is contained in:
2026-08-03 00:13:46 +08:00
parent 9a01fd4657
commit c28bf74230
52 changed files with 3700 additions and 272 deletions
+3 -2
View File
@@ -61,11 +61,12 @@ verify_local_node_capacity() {
elif endswith("Gi") then rtrimstr("Gi") | tonumber * 1024
else 0 end;
([.items[] | select(.metadata.labels["easyai.io/workload"] == "true") |
select(.metadata.labels["easyai.io/worker"] == "true") |
select((.status.allocatable.cpu | cpu_m) == 3000 and
(.status.allocatable.memory | memory_mi) == 6656)] | length) == 2 and
(.status.allocatable.memory | memory_mi | floor) == 6656)] | length) == 2 and
([.items[] | select(.metadata.labels["easyai.io/site"] == "los-angeles") |
select((.status.allocatable.cpu | cpu_m) == 1000 and
(.status.allocatable.memory | memory_mi) == 2560)] | length) == 1 and
(.status.allocatable.memory | memory_mi | floor) == 2560)] | length) == 1 and
([.items[] | select(any(.status.conditions[]; .type == "Ready" and .status == "True"))] | length) == 3 and
([.items[] | select(any(.status.conditions[]; .type == "MemoryPressure" and .status == "True"))] | length) == 0
' >/dev/null