Open
docs(guide): add template storage compression configuration #283
docs(guide): add template storage compression configuration #283
Open
xhmljaAdd on 1 day ago
xhmlja
xhmlja
1 day ago

当前PR是否有AI参与:

[x] 否

[ ] 是
__1. AI Agent 平台:
__2. AI 模型:
__3. Prompt上下文 :

参考:openEuler社区《生成式AI工具使用与开源贡献政策》

PR功能描述 / 为什么需要这个合入**:

该PR关联的issue

(格式为fixes #<issue号>, 或者resolves #<issue号>): fixes #

希望检视人员了解:

likedislike
Merge blocked
xhmljaxhmlja
1 day ago Created pull request, commit 06ffe709
atomgit-bot
atomgit-bot
1 day ago Comments:

变更摘要

本 PR 属于纯文档变更,在中文用户指南 docs/zh/e2b_user_guide.md 中新增“模板存储压缩配置(可选)”一节,用于说明平台对上传到存储后端的模板与沙箱快照(memfile、rootfs.ext4)按 2 MiB 分帧压缩、读取时透明解压写入节点本地缓存的能力,并文档化 COMPRESS_ENABLED、COMPRESS_TYPE、COMPRESS_LEVEL 三个配置项的含义、可选值与默认值,同时补充部署后开启或切换压缩的操作步骤与注意事项;文档目录与环境变量速查表也同步增加了对应条目。

主要改动

  • 新增压缩配置章节: 增加 4.8 模板存储压缩配置(可选),说明压缩适用于 MinioBucket、MooncakeBucket、Local 等存储后端,并给出三个 COMPRESS_* 变量的说明表格与 .env 示例(lz4 推荐、zstd 可选)。
  • 约束取值与失败行为: 明确 COMPRESS_ENABLED 需为严格布尔值、COMPRESS_TYPE 区分大小写且非法值静默按不压缩处理、COMPRESS_LEVEL 为非整数会导致 orchestrator 启动解析失败,且 zstd 下必须显式设为 1–4。
  • 部署后生效操作指引: 给出修改配置前用 pgrep -c firecracker 确认无运行中沙箱、按 ORCHESTRATOR_TYPE=systemd / K8S + DaemonSet / nomad 分别执行 systemctl restart e2b-orchestrator、bash deploy.sh --type k8s(含 kubectl rollout status ds/template-manager、e2b-webhook 重启)或 bash deploy.sh --type nomad 的流程,并可通过 /proc/${pid}/environ 校验进程已读取新配置。
  • 生效范围与兼容性要点: 说明压缩仅对开启或切换后新上传的对象生效、不重压历史对象,同一条模板或快照链可混用不压缩 / lz4 / zstd 层并自动透明解压,写入压缩对象后不可回退旧版本,多节点部署时 template-manager 与各 orchestrator 节点需保持一致配置。
  • 目录与环境变量速查同步: 在文档开头的目录列表中加入 4.8 条目,并在环境变量参考表的存储相关表格后新增“模板存储压缩”小表,汇总三个变量的说明与默认值。
likedislike
Incorrect?
atomgit-bot
atomgit-bot
1 day ago Comments:

代码审查

审查结论

变更文件核查

  • docs/zh/e2b_user_guide.md:已逐段审阅新增的 4.8 节(638–690 行)、目录锚点(31 行)与附录 A 新增压缩变量表(2258–2264 行)。发现 4 个问题,无 P0/P1。

问题清单(按优先级)

  • P2 × 2
    1. 第 672–673 行 bash deploy.sh --type k8s / --type nomad 与全文档既有重部署入口(./build.sh --deploy services,第 1971、2088、2207 行;./build.sh --nomad-job deploy ...,第 1944–1946 行)不一致,且 deploy.sh 在附录 C 中被定义为「K8S 部署执行脚本」,--type 参数全文仅此一处出现;Nomad 场景下照做会导致 .env 未被重新渲染、压缩实际未生效而用户误以为已生效。
    2. 第 661–665 行把宿主机 pgrep -c firecracker 作为重启前的安全前置条件,但 K8S 模式 orchestrator 为 DaemonSet 容器(文档第 620 行自述),宿主机会恒输出 0,形成假性通过,用户可能在满负载沙箱节点上触发滚动重建并截断进行中的快照/构建。
  • P3 × 2
    3. 第 678–680 行验证片段未校验 $pid 为空,/proc//environ 报错或无输出时会被误读为「压缩未生效」;且该检查仅对宿主机承载(systemd / Nomad raw_exec)有效。
    4. 第 640 行举例的后端 MinioBucket 在文档其余位置与附录 A 的 STORAGE_PROVIDER 说明中均无定义,存在引导用户配置非法取值的风险。

总体风险判断:本次为纯文档新增,无安全类危险指令(未引入明文密钥、关闭 TLS/鉴权、chmod 777 等),无供应链或权限误导。主要风险集中在新章节给出的「重部署命令」和「生效验证手段」两条操作路径上——它们与文档既有约定及容器化承载事实存在偏差,属于会导致用户在 K8S/Nomad 生产环境误判配置已生效的可用性缺陷,建议合入前修正 P2 两项、并顺手澄清 P3 两项。

类型 数量
🔴 阻塞 0
🟡 建议 2

💬 仅评论

likedislike
Incorrect?
openeuler-ci-botopeneuler-ci-botCollaborators
1 day ago Set weibaohui,yangzhao_kl,jimmieme,duguhaotian,wonleing,zmr_2020,gaodaweiky,lu-wei-army,feijianqiang,zhaoyifan28 as approver
openeuler-ci-botopeneuler-ci-botCollaborators
1 day ago Added label: sig/sig-CloudNative
openeuler-ci-bot
openeuler-ci-botCollaborators
1 day ago Comments:

Welcome To openEuler Community

Hey @xhmlja , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: sig-CloudNative ,
and any of the maintainers: @duguhaotian, @feijianqiang, @gaodaweiky, @jimmieme, @lu-wei-army, @weibaohui, @wonleing, @yangzhao_kl, @zhaoyifan28, @zmr_2020 ,
and any of the committers: @feijianqiang, @fly_1997, @zhourenjianz .

likedislike
openeuler-ci-botopeneuler-ci-botCollaborators
1 day ago Added label: openeuler-cla/yes
openeuler-ci-bot
openeuler-ci-botCollaborators
1 day ago Comments:

CLA Signature Pass

xhmlja, thanks for your pull request. All authors of the commits have signed the CLA. 👍

likedislike
openeuler-botopeneuler-botCollaborators
1 day ago Added label: ci_processing
openeuler-bot
openeuler-botCollaborators
1 day ago Comments:

门禁正在运行, 您可以通过以下链接查看实时门禁检查结果.
若您对门禁结果含义不清晰或者遇到问题不知如何解决,可参考门禁指导手册
门禁入口及编码规范检查: multiarch/openeuler/trigger/KASandbox/653

likedislike
atomgit-bot
atomgit-bot1 day agoStart code review1
docs/zh/e2b_user_guide.md
@@ -636,0 +662,4 @@
662+ 
663+```bash
664+pgrep -c firecracker # 输出应为 0
665+```
atomgit-bot
atomgit-bot1 day agoComments:

🟡 Medium Priority

新增第 661–665 行把「pgrep -c firecracker 输出应为 0」作为重启前的安全前置条件(要求节点上没有运行中的沙箱)。

但按本文档自己的描述,K8S 模式下 orchestrator 是「DaemonSet hostNetwork 容器」(第 620 行),沙箱 Firecracker 进程是容器内 orchestrator 的子进程。容器默认使用私有 PID 命名空间,在节点宿主机上执行 pgrep -c firecracker 会恒返回 0(而 pgrep -c 计数为 0 时仅退出码为 1,输出仍是 0,用户很容易当作「已满足条件」)。

建议:为该前置检查补充适用范围说明,并给出容器承载模式(K8S DaemonSet)下在容器内执行 pgrep 的等价命令;若 DaemonSet 启用了 hostPID,则显式说明宿主机检查有效。

likedislike
Incorrect?
atomgit-bot
atomgit-bot1 day agoStart code review1
docs/zh/e2b_user_guide.md
@@ -637,0 +670,4 @@
670+|----------------|----------------------------------------|
671+| `ORCHESTRATOR_TYPE=systemd`(K8S / Nomad 均适用) | `systemctl restart e2b-orchestrator`(`orchestrator-run.sh` 启动时自动重读本机 `.env`,无需重跑部署脚本;多节点部署需在每个运行该服务的节点同步修改 `.env` 并重启) |
672+| K8S + DaemonSet(`ORCHESTRATOR_TYPE=k8s`) | `bash deploy.sh --type k8s`,再执行 `kubectl rollout status ds/template-manager -n e2b` 等待滚动重建完成;若集群启用了 `ENABLE_WEBHOOK=true`,执行后再补跑 `kubectl -n e2b rollout restart deployment e2b-webhook`(重跑 `deploy.sh` 会轮换 webhook 证书) |
673+| Nomad(`ORCHESTRATOR_TYPE=nomad`) | `bash deploy.sh --type nomad` |
atomgit-bot
atomgit-bot1 day agoComments:

🟡 Medium Priority

改动行(672–673)要求用户执行 bash deploy.sh --type k8s / bash deploy.sh --type nomad 使 COMPRESS_* 生效。

文档其余位置给出的部署/重部署入口与本处不一致,且 --type 参数在全文档中仅此一处出现:

  • 第 1971、2088、2207 行:K8S 模式重新部署(含 helm upgrade)统一写作 ./build.sh --deploy services;
  • 第 1975 行:./deploy.sh # 默认走完整部署,未提及任何 --type 参数;
  • 第 1944–1946 行:Nomad 模式更新组件写作 ./build.sh --nomad-job deploy template-manager;
  • 第 2390、2421 行(附录 C 目录结构):deploy.sh 被明确定义为「K8S 部署执行脚本」,因此 bash deploy.sh --type nomad 与该脚本定位本身矛盾。

建议:把两行改为文档既有的重部署命令;若要保留 --type,需同时在 10.9 节「重新部署服务」与附录 C 的 deploy.sh 说明中补上该参数,避免同一脚本出现两种互斥用法。

likedislike
Incorrect?
openeuler-botopeneuler-botCollaborators
1 day ago Removed label: ci_processing
openeuler-bot
openeuler-botCollaborators
1 day ago Comments:
Check Name Build Result 详情 Build Details
check_package_license ✅SUCCESS #653
check_sca ✅SUCCESS
x86_64 check_build ✅SUCCESS #656
aarch64 check_build ✅SUCCESS #672
DT check_build ✅SUCCESS #669
check_interface check_build ✅SUCCESS #106
likedislike
openeuler-botopeneuler-botCollaborators
1 day ago Added label: ci_successful
openeuler-bot
openeuler-botCollaborators
1 day ago Comments:
likedislike