mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #210] [MERGED] fix(tools-image): fall back to BusyBox ionice for minimal user images #255
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#255
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/210
Author: @dushulin
Created: 8/24/2026
Status: ✅ Merged
Merged: 9/10/2026
Merged by: @yingdi-shan
Base:
main← Head:feat/tools-image-ionice-fallback📝 Commits (1)
dff156afix(tools-image): fall back to BusyBox ionice for minimal user images📊 Changes
2 files changed (+12 additions, -4 deletions)
View changed files
📝
tools-image/Dockerfile(+5 -1)📝
tools-image/pivot-init(+7 -3)📄 Description
背景
envd 的进程 wrapper 硬编码调用
/usr/bin/ionice -c 2 -n 4 /usr/bin/nice -n N ...(packages/envd/internal/services/process/handler/handler.go),只要用户 rootfs 里没有/usr/bin/ionice,每一次进程 spawn 都会立刻失败并报/usr/bin/ionice: not found。这在 Alpine/musl、distroless、FROM scratch、以及各类不带 util-linux 的 slim 镜像上都能稳定复现——envd 自身能起来,用户在 sandbox 里跑任何命令都会立刻挂掉。相关上游 issue / PR:
/usr/bin/ionice和/usr/bin/nice方案
复用现有
nice(1)兜底思路(tools-image/pivot-init):/usr/bin/ionice,就把它软链到/agentenv/bin/busybox。BusyBox 是 multi-call binary,通过argv[0]=ionice直接走ioniceapplet。[ ! -x /usr/bin/ionice ]guard 保证自带 util-linux 的镜像原样保留自己的ionice,不会被覆盖。nice/ionice。nice+ionice),万一以后 upstream BusyBox 改默认配置或有人重编 BusyBox,能在镜像构建阶段就报错,不至于到 guest 里才发现。与 util-linux ionice 的能力对齐
envd 调用的形式是
ionice -c 2 -n 4 <cmd>,用到的是-c/-n以及 exec 新进程的能力。BusyBox 的 ionice applet 覆盖-c/-n/-p/-t与 exec 语义,与 util-linux 落到同一个ioprio_set(2)syscall,语义完全一致。util-linux 独有的-P PGID、-u UIDenvd 用不到;如果 sandbox 内部用户脚本自己在 fallback 镜像里手动调这两个 flag 会拿到 unknown option,这跟现有nicefallback 面临的情况完全对称。兼容性
[ ! -x ]guard 短路,/usr/bin/ionice保留镜像原有实现,零回退。Test plan
docker build tools-image/通过,BusyBox applet 断言不报错ionice -c 2 -n 4 echo ok通过 envd wrapper 能正常输出okreadlink /usr/bin/ionice仍指向镜像原有二进制(不是/agentenv/bin/busybox)echo $?返回 0🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.