Skip to content

fix(sync): 进度日志全局限频 + 下载总结步骤 + 去掉 6h 下载超时(#151) - #160

Merged
KadenZhang3321 merged 1 commit into
mainfrom
feat/dl-log-throttle-summary-timeout
Nov 27, 2026
Merged

KadenZhang3321 merged 1 commit into
mainfrom
feat/dl-log-throttle-summary-timeout

Conversation

@KadenZhang3321

Copy link
Copy Markdown
Collaborator

resolve https://github.com/opensourceways/backlog/issues/2647

背景

用户反馈两件事:①下载日志仍然偏多;②#151 的数百 GB 下载被 6 小时默认超时掐死。另要求 job 末尾给出成功/失败总结。

改动

  1. 进度日志全局限频(重写 throttle())
    • 旧实现 read -d $'\r' 只对 \r 分帧流有效;tqdm/hf 在 CI 非 TTY 下多 bar 并发、modelscope 逐行进度都是 \n 分帧——旧代码会把多行攒成一个 blob 在开闸时整段吐出,"每 30s 一行"不兑现(实测 20 帧 \r + 10 行 \n 的流,旧版整段吐、新版只放 3 行);
    • 新版 python 实现按 \r/\n 双分帧聚合,含 % 的进度行全局最多每 PROGRESS_INTERVAL 秒放行一行(默认 30,0 直通看全量),非进度行(ERROR/traceback/结果行)不受限、即时输出。
  2. Download summary 步骤(model-library.yml 的 download/download-arc + sync-models-datasets.yml 的 sync/sync-host,共 4 处,if: always()):汇总脚本写出的 /tmp/dl-counts-{model,dataset}.txt 计数,STEP_SUMMARY 输出 ✅ X 成功 / ❌ Y 失败;脚本侧同步新增 successes 计数、每批表格加"本批合计"行、末行日志 successes/failures 并列。
  3. 去掉下载超时:timeout-minutes: 4320(self-hosted 允许上限 3 天)。此前未显式设置,GHA 默认 360min——models: add download requests for vllm-ascend-recipes (A3 x4, A2 x1) #151 的 aiframe/mind3 数百 GB job 即死于此(mind3 4h22m 勉强过线,aiframe 被杀)。个别条目失败重跑 job 幂等续传(已下 blob 秒过)。
  4. README:入口一后新增"可观测性与超时"段 + 更新记录一条。

测试

  • bash -n 两个脚本/文件语法 ✓,两个 workflow YAML 解析 ✓;
  • throttle 单测:iv=0 全量直通 ✓;iv=2 时 30 帧混合流 → 3 行进度 + 错误行即时透传 ✓(旧版同流整段吐 blob);
  • counts 文件与汇总步骤:伪造 model/dataset 两份 counts → ✅ 3 成功 / ❌ 1 失败 ✓;bogus-platform 跳过路径不计数、counts 仍落盘 ✓。

影响面

…ob ceiling

- throttle(): old bash read -d $'\r' batched \n-delimited frames (parallel
  file bars, modelscope line progress) into blobs dumped whole at gate-open,
  so the one-line-per-interval promise never held. Python rewrite splits on
  both \r and \n, gates all progress to <=1 line per PROGRESS_INTERVAL
  (default 30s, 0=passthrough), passes non-progress lines through instantly.
- script counts successes+failures, writes /tmp/dl-counts-<type>.txt and a
  per-batch totals line; 4 download jobs gain an if:always() Download summary
  step printing OK/FAIL totals to the step summary.
- timeout-minutes: 4320 on all download jobs (default 360 killed #151's
  multi-hundred-GB host downloads; self-hosted ceiling is 3 days, reruns
  resume idempotently).

resolve https://github.com/opensourceways/backlog/issues/2647
@KadenZhang3321
KadenZhang3321 merged commit 8e18f28 into main Nov 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant