A-batch admin-plane fixes: rusage unit name, XCE_JOBID identity, select WARN, CLI env, docs
rusage collection (merge cb0c7fe9 regression, root cause of 0 counters):
- collect_job_rusages builds the systemd unit name with
make_job_sd_unit_name (four-segment fmt_jobid_ex form) instead of a bare
%lu of the packed uint64, so the D-Bus property lookups hit the real
per-job unit again. E2E on t1: DONE job reports max_mem/avg_mem/cpu_time
non-zero (previously all 0).
XCE_JOBID written identity:
- exdata sets XCE_JOBID via fmt_jobid (four-segment
cluster-apiserver-timestamp-seq) instead of a bare packed decimal;
XCE_JOBINDEX handling unchanged.
- xrun parses XCE_JOBID with parse_jobid (accepts the four-segment form);
a bare decimal no longer round-trips through the written identity.
- E2E on t1: job sees XCE_JOBID=<submit id>; xrun remote-start round-trip
to another host matches the job.
select WARN (silent degradation):
- parse_resreq_primary WARNs when a select references an unregistered
resource ("...references an unregistered resource -- dropping the select
and skipping any rusage[] clause of this primary") instead of failing
silently; scheduler log shows the WARN on t1 and the job schedules
without the constraint.
CLI env handling (unit-tested; subEnvVars is not flag-bound so this is
not reachable from the production CLI):
- getEnvironmentVariables keeps B=b=c (split at first '=') and warns +
drops a bare key or an '=value' fragment instead of silently mis-parsing.
Docs:
- src/docs/xce.md: document the dead-clause semantics (select/rusage
primary drop behavior) matching the WARN.
bug-1972 (test-only UAF): test_job_live_gc asserted job destruction by
reading refcount from the freed job; rewrite the assertion to observe
destruction without touching freed memory. controller_unit_test is green
again (1354 tests).
Regenerate 3 repl_trace_baseline fixtures whose baselines shifted with the
select-WARN logging; replay tests green.
Spec naming: external-license-resources design.md/brief.md fix the
self-referential daemon-name note (old drafts said xceextresd/extresd).
Verified on t1: rusage_burn job (counters non-zero in DONE), echo_env job
(four-segment XCE_JOBID), select[nosuchres] job (WARN + schedules),
xrun t2 remote-start round-trip, CLI env unit tests, xcelib 762 /
controller 1354 / worker exdata 8+11 / sched repl_trace 4+14+4+10+17
tests green.
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
68eabd8a4a
commit
f780a1660a
17 changed files with 329 additions and 44 deletions
|
|
@ -12,7 +12,7 @@ XCE 无法调度依赖外部 license server(FlexLM/lmstat 等)的 EDA 应用
|
|||
XCE_RESF_EXTERNAL 是死 flag)。
|
||||
|
||||
## Desired Outcome
|
||||
- **xceextresd**:独立采集 daemon(避免 lmstat 阻塞连坐 controller),
|
||||
- **xceesd**:独立采集 daemon(避免 lmstat 阻塞连坐 controller),
|
||||
以新 `HostRole` 成员 join controller,采集器插件:flexlm(lmstat)、
|
||||
script(任意外部资源)。wire 零 schema 变更(复用 ResValList 管线),
|
||||
唯一变更是 HostRole 加成员。
|
||||
|
|
@ -38,7 +38,7 @@ share 机制)。
|
|||
- **elastic-shared-resources**:同管线两种记账模式按资源分流
|
||||
(EXTERNAL=server-authoritative,无 flag=elastic base+borrowed)——
|
||||
opupd 守卫"SHARED 即收"预留其写入路径。即对其决策日志 P9 的回答。
|
||||
- **PR-2 proxy**(resource-questions.md):xceextresd 定位为该 proxy 的
|
||||
- **PR-2 proxy**(resource-questions.md):xceesd 定位为该 proxy 的
|
||||
第一片(只读 report 能力),HostRole 只加一个成员。
|
||||
- **project-config**:per-app 配额→per-project share(project tree 是
|
||||
唯一并发上限处,limits.yaml 退役)。需要其扩展:集群级 pool location。
|
||||
|
|
@ -48,7 +48,7 @@ share 机制)。
|
|||
## Boundary Candidates
|
||||
- HostRole_extres join/leave + opupd 准入守卫(controller)
|
||||
- unsatisfy_ EXTERNAL 分支(scheduler)
|
||||
- xceextresd daemon 与采集器插件(新 src/extresd/)
|
||||
- xceesd daemon 与采集器插件(新 src/esd/)
|
||||
- mapping.py `location: [external]` 路由
|
||||
|
||||
## Out of Boundary
|
||||
|
|
@ -64,6 +64,7 @@ share 机制)。
|
|||
provisioning-demand(headroom 需求源)、project-config(集群级池)
|
||||
|
||||
## Open(待用户/跨团队决策)
|
||||
1. 命名:xceextresd(推荐)vs xcelsd。
|
||||
1. ~~命名~~ 已定(2026-10-27):**xceesd**(src/esd/,esd.yaml;HostRole
|
||||
枚举成员 extres)。
|
||||
2. 断联策略:fail-open(推荐)vs fail-closed。
|
||||
3. P9 模式拆分与三个扩展点需与 Rongsong 确认(design §3.6)。
|
||||
|
|
|
|||
|
|
@ -110,17 +110,23 @@ license 服务器的"当前空闲数"是外部真值;本地只需补一个窗
|
|||
|
||||
### 3.1 架构决策:独立 daemon + 采集器插件
|
||||
|
||||
**xceextresd(外部资源守护进程)**,新 `src/extresd/`,C 实现,
|
||||
照 scheduler 的 join 方式以新 `HostRole_extres` 角色接入 controller。
|
||||
内部采集器插件接口:
|
||||
**xceesd(外部资源守护进程;XCE External-resources Daemon)**,新
|
||||
`src/esd/`,C 实现,照 scheduler 的 join 方式以新 `HostRole_extres`
|
||||
角色接入 controller。内部采集器插件接口:
|
||||
|
||||
```
|
||||
xceextresd
|
||||
xceesd
|
||||
├─ collector/flexlm.c — lmstat -c port@host -f feature 解析(EDA license 主路径)
|
||||
├─ collector/script.c — 用户脚本输出 key=value/JSON(任意外部资源:云配额、网络带宽…)
|
||||
└─ collector/http.c —(预留)
|
||||
```
|
||||
|
||||
> **命名**(2026-10-27 定):daemon 名 `xceesd`,目录 `src/esd/`,二进制
|
||||
> `xceesd`,配置 `esd.yaml`,代码标识符 `esd`。wire 层 HostRole 枚举成员
|
||||
> 仍用 `extres`(角色语义,与 reporter/provisioner 讨论对齐)。
|
||||
> 注意 `esd` 是高频子串(closed/parsed…),全文检索认准全名。
|
||||
> 旧稿中的 `xceextresd`/`extresd` 均指本 daemon(改名前写法)。
|
||||
|
||||
- **为什么不是 controller 内插件**:lmstat 是秒级阻塞调用,违反 controller
|
||||
async I/O 红线(delaymgr/vtask 不得阻塞,HA/心跳会被连坐);license server
|
||||
故障必须与 controller 故障域隔离。
|
||||
|
|
@ -133,7 +139,7 @@ xceextresd
|
|||
### 3.2 数据流(wire 零 schema 变更,除 HostRole 加成员)
|
||||
|
||||
```
|
||||
xceextresd (join: HostRole_extres)
|
||||
xceesd (join: HostRole_extres)
|
||||
│ OPCode_update / Update_data_resvals(现 wire:ResourceVal{name, host:"", val})
|
||||
▼
|
||||
opupd.c do_update_resvals ── 放行 extres 角色;flag 守卫只许 SHARED 资源(§3.6)
|
||||
|
|
@ -185,7 +191,7 @@ EXTERNAL:F ≥ uncomit + wanted(unsatisfy_ 循环内一个 flag 分支;
|
|||
与 Slurm `_handle_consumed` 的 deficit 算法同构(都是"避开外部消费者份额"),
|
||||
但更简:不需要 LastConsumed/external 推导,因为 lmstat 直接给 free。
|
||||
|
||||
### 3.3b elim(LSF load index)兼容性 —— 已盘点,归 xcecd 不归 extresd
|
||||
### 3.3b elim(LSF load index)兼容性 —— 已盘点,归 xcecd 不归 esd
|
||||
|
||||
**LSF elim 模型**:用户在主机上部署脚本,周期 echo `资源名 数量`,lim 收集后
|
||||
变成可调度资源。per-host 语义。License Scheduler 历史上正是从 elim 派生——
|
||||
|
|
@ -217,15 +223,15 @@ posix_spawn 路径;读 stdout `name value` 行 elim 原格式;调现有 regi
|
|||
API 进 registry;脚本超时看门狗 kill)。MAX_LOAD_INDICES=64 够用。
|
||||
工作量 D 类(中型),与 E2 独立可并行。
|
||||
|
||||
**归属决策:elim 支持放 xcecd,不放 xceextresd**。理由:
|
||||
**归属决策:elim 支持放 xcecd,不放 xceesd**。理由:
|
||||
1. 作用域——elim 值 per-host("这台机器有多少"),license 值集群全局
|
||||
("全池还剩多少");worker 本来就站在每台主机上,让 extresd 管主机值
|
||||
("全池还剩多少");worker 本来就站在每台主机上,让 esd 管主机值
|
||||
是数据绕远路。
|
||||
2. 故障域——elim 脚本挂只影响一台主机上报;license server 断联影响全集群
|
||||
准入。xcecd 采集器继承前者的隔离性。
|
||||
3. LSF 自己也是分开的(lim vs lsld/blcollect),复刻这个分界。
|
||||
4. XCE 架构两条腿天然对齐:worker→per-worker resvals→host 判式;
|
||||
extresd→sharedinst→全局判式。同一资源模型(定义/rusage/pend reason/
|
||||
esd→sharedinst→全局判式。同一资源模型(定义/rusage/pend reason/
|
||||
CLI 展示)。
|
||||
|
||||
**统一记账规则(两条腿共享,同一 flag 位决定)**:EXTERNAL 资源的满足性
|
||||
|
|
@ -252,13 +258,13 @@ count) 聚合——无法判定 A=2/B=3 还是 A=3/B=2。LSF License Scheduler
|
|||
daemon 每轮对账:Σ(派发中) vs 服务器 used,差值 = 外部消费者 + 泄漏,
|
||||
异常 alert。漂移有界且方向安全:少拿→配额保守不超卖;多拿→服务器
|
||||
total 暴露。
|
||||
3. **报告层 = 证据分级 + 残差桶**(matcher 为 extresd 插件,不猜、显式
|
||||
3. **报告层 = 证据分级 + 残差桶**(matcher 为 esd 插件,不猜、显式
|
||||
化"不知道"):
|
||||
- Tier 0:派发记账(app→授予数),精确,永远可用;
|
||||
- Tier 1:vendor checkout 属性(如 Synopsys LM_PROJECT 类,lmstat 可见;
|
||||
XCE 作业 env 已注入 XCE_JOBID,vendor 走 env 即可盖入),精确;
|
||||
- Tier 1':PID 匹配(部分 vendor daemon 报客户端 PID)——jobPidInfo
|
||||
已有 jobid→pid 映射(3545aa0d),extresd 从 controller 拉即可,精确;
|
||||
已有 jobid→pid 映射(3545aa0d),esd 从 controller 拉即可,精确;
|
||||
- Tier 2:(user, host) + checkout start 时间窗 匹配作业记录(LSF 基线
|
||||
法升级:两个独立 XCE 作业通常可按 start 时间拆开),user+host 相同时
|
||||
只能给出"这批作业合计持有 K"的界;
|
||||
|
|
@ -287,7 +293,7 @@ resources:
|
|||
```
|
||||
|
||||
```yaml
|
||||
# extresd.yaml(daemon 侧:操作)
|
||||
# esd.yaml(daemon 侧:操作)
|
||||
poll_interval: 30s
|
||||
resources:
|
||||
- name: Verilog_XL # 必须与 resources.yaml 同名(控制器侧 unknown-resource 拒)
|
||||
|
|
@ -300,7 +306,7 @@ resources:
|
|||
stale_limit: 150s # 连续取不到 → WARN 保旧值(fail-open,可配 fail-closed 清零)
|
||||
```
|
||||
|
||||
职责分界:resources.yaml 管声明(作业能否 rusage),extresd.yaml 管采集
|
||||
职责分界:resources.yaml 管声明(作业能否 rusage),esd.yaml 管采集
|
||||
(值从哪来)。`seed_sharedinst_from_config` 对 EXTERNAL 资源**不播种**
|
||||
(值只来自 daemon;daemon 未上线时 get_resvals 读 0 → PEND NO_RESOURCE
|
||||
detail 带资源名)。
|
||||
|
|
@ -317,7 +323,7 @@ detail 带资源名)。
|
|||
3. resource.c unsatisfy_:EXTERNAL 跳过 inuse 项(+trace 行)
|
||||
4. cluster.c seed:EXTERNAL 不播种
|
||||
5. mapping.py:`location: [external]` 路由
|
||||
6. xceextresd 骨架:join/rejoin/failover 重连即全量重推(worker 状态补报
|
||||
6. xceesd 骨架:join/rejoin/failover 重连即全量重推(worker 状态补报
|
||||
9d7628e 同款语义)+ script/flexlm 采集器 + 轮询去抖
|
||||
7. TDD:testsuite 红→绿(opupd 守卫、unsatisfy_ 分支、采集器解析);
|
||||
t1 E2E 用 script 采集器 + 假 license 脚本(不必有真 FlexLM)
|
||||
|
|
@ -335,7 +341,7 @@ PEND detail 含 lic 名);daemon kill/重启后值全量补推;controller
|
|||
daemon 重新 join 新主并补推;`--sim` 录制含 daemon 推送事件且回放一致。
|
||||
|
||||
**elim 归属(与 E2 并行的独立 D 类项)**:LSF elim(per-host 外部资源脚本)
|
||||
归 xcecd(worker)不归 xceextresd——详见 §3.3b。license(全局)与 elim
|
||||
归 xcecd(worker)不归 xceesd——详见 §3.3b。license(全局)与 elim
|
||||
(主机)是两条腿、同一资源模型、同一记账规则(EXTERNAL 跳 inuse)。
|
||||
|
||||
### 3.6 与 Rongsong 统一资源模型 spec 群的合并性审查(2026-10-26)
|
||||
|
|
@ -379,13 +385,13 @@ daemon 推 free 直接覆盖 sharedInst。两套各写各的 → 同一资源 sh
|
|||
唯一并发上限处,limits.yaml 退役"(332f86ea);§3.3c Tier-0 配额写成
|
||||
project share/member_quota 由 limit plugin 编译,不发明新机制。
|
||||
- staleness/interval 进**资源描述符**(其 Phase 1 descriptor 字段
|
||||
interval/last_report 已预留),不放 extresd.yaml;daemon 只执行。
|
||||
interval/last_report 已预留),不放 esd.yaml;daemon 只执行。
|
||||
- 持久化分级:daemon 推的 F 是 dynamic reported value → 非 WAL fact、
|
||||
进 scheduler snapshot + daemon 重连全量补推即安全;将来 elastic 模式
|
||||
的 total 才是 WAL fact。与 persistence.md 一致。
|
||||
- 角色收敛:PR-2 proxy(leaning)统一 reporter+provisioner 为一个 daemon
|
||||
role;**HostRole 只加一个成员**(避免将来再出现第二个同义 enum),
|
||||
xceextresd 定位为 PR-2 proxy 的第一片(只读 report 能力)。
|
||||
xceesd 定位为 PR-2 proxy 的第一片(只读 report 能力)。
|
||||
- 归因 Tier 1' PID 匹配引用其 jobPidInfo(我们已实施,3545aa0d)。
|
||||
|
||||
**我们的设计对其 spec 的三个扩展点**(他目前装不下,需带回讨论):
|
||||
|
|
@ -407,8 +413,8 @@ daemon 推 free 直接覆盖 sharedInst。两套各写各的 → 同一资源 sh
|
|||
"or reuse the provisioner role")。
|
||||
|
||||
### 3.7 提请决策(未决)
|
||||
1. daemon 命名:`xceextresd`(通用外部资源,推荐)vs `xcelsd`(贴 LSF
|
||||
license 语义);定位为 PR-2 proxy 第一片(见 §3.6)。
|
||||
1. ~~daemon 命名~~ 已定(2026-10-27):`xceesd` / `src/esd/` / `esd.yaml`;
|
||||
HostRole 枚举成员仍为 `extres`;定位为 PR-2 proxy 第一片(见 §3.6)。
|
||||
2. 断联默认策略:fail-open(保旧值+stale WARN,推荐)vs fail-closed(清零停派)。
|
||||
3. P9 模式拆分与三个扩展点需与 Rongsong 确认(§3.6)。
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue