fix(web): make first wasm load work on remote deployment
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

- Correct engine-manifest single wasm SHA and reuse cache for verification.
- Remove duplicate main-thread wasm fetch; raise init timeout to 300s.
- Record production deployment details and verification evidence.

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
mes123456
2026-11-12 22:38:04 +08:00
parent d5dd647881
commit c92cd933c5
6 changed files with 45 additions and 12 deletions

View File

@@ -98,6 +98,31 @@ HQ 2048(10.8 MB 库,67,633,152 bytes 解码);`check-re-pbr-limits.mjs`
- `web/tests/e2e/re-pbr-render-workflow.spec.ts` 仍按旧文案“打开图文教案”查找链接;面板现为
“打开图文/视频教案”。已改为正则 `/打开图文/`,主流程用例重跑通过(3.6 分钟)。
## 生产部署(2026-11-12)
| 项目 | 值 |
| --- | --- |
| 公网地址 | `https://49.232.250.35:58014/`(Let's Encrypt 证书,`curl` 校验 `ssl_verify_result=0`) |
| 入口 | nginx 58014 → `upstream blender_web_58014_backend 127.0.0.1:58114` |
| 服务 | `blender-web-58014.service`,www-data 运行 `deployment-http-server.mjs current/app` |
| 新 release | `/var/www/blender-web/releases/20261112-re-pbr-d5dd647`(`current` 指向) |
| 回滚 release | `/var/www/blender-web/releases/731af06aee6a2d2b61b902db9fd4b7bd5b04474e4689c48baf213fd5fcb3769f` |
| 部署工具 | `current/tools/web/deployment-http-server.mjs` + 8 个本地依赖模块(闭包 9 个),`current/docs/web/deployment-contract.json` |
| 静态产物 | `web/dist`(599MB;`assets/web_engine-*.wasm` 在服务器以符号链接指向 `vendor/blender/web_engine.wasm`,避免重复占盘) |
| wasm 传输 | nginx 58014 server 块启用 gzip(`application/wasm`);实测 241,949,523 → 79,395,379 bytes |
| 首次初始化 | 154 秒(gzip wasm 单次下载;`init` 超时已从 30 秒提高到 300 秒) |
| 部署证据 | `/home/mes123456/workinf_Blender_Wasm/tests/golden/RE-PBR-RENDER-001/deployed-app.png` |
部署期间修复的发布问题:
1. `web/app/public/engine-manifest.json` 的 single wasm SHA-256 仍是旧值 `551a86…`;主线程 `verifyWasmResource`
会额外下载 241MB 并失败。已改为实际 `31550b…`,并把校验 fetch 改为 `force-cache`。
2. 主线程重复校验与 worker 加载各下载一次 241MB;远程首次加载必然超过 30 秒 `init` 超时。
已移除主线程 wasm 字节重复下载(worker 的 `WasmModuleLoader` 仍做 SHA-256 校验),
`init` 超时改为 300 秒。
3. 241MB wasm 直接传输在服务器上行带宽下超过 300 秒;已在 nginx 58014 server 块启用 gzip
(仅 `application/wasm` 等文本类型,视频不压缩),压缩后 79.4MB。
## 验证结果
| 检查 | 结果 |
@@ -114,6 +139,10 @@ HQ 2048(10.8 MB 库,67,633,152 bytes 解码);`check-re-pbr-limits.mjs`
| 生产构建 | `npm run build` PASS(typecheck + vite build;`web/dist` 含视频、字幕、poster、13 张章节截图、新 wasm) |
| 教案页面冒烟(生产 dist + 部署服务) | 56 张图片全部解码、视频 667.04 s、VTT 13 cues、无 4xx |
| 视频音频 | AAC 单声道 48 kHz;`volumedetect` mean −23.4 dB、max −2.6 dB(非静音) |
| 线上首次加载 | `init` 154 s;wasm 仅 1 次 200(`Content-Encoding: gzip`,79.4MB);无 pageerror/console error |
| 线上场景流程 | 启动 General 3 对象 → studio 6 对象 → `猴头.glb` 7 对象(`Engine: GLB imported r2`) |
| 线上 PBR 渲染 | 512×512,`data-texture-status=ready:1:0:`,产物写入 OPFS(截图见 `deployed-app.png`) |
| 线上教案 | 56 张图片全部解码、视频 `duration=667.04`、VTT 200 + 13 cues、0 个 4xx |
## 未验证 / 限制