[codex] Expose host CPU burst#273
Conversation
Assisted-by: Codex:GPT-5
|
Hi @vwxyzjn, thanks a lot for this PR — the implementation is quite complete, covering CLI / API / CubeMaster / Cubelet / cgroup v1 & v2 in one go, and the unit tests are nicely done. While reviewing it I have a few questions I'd like to align on, mainly to make sure we understand the actual benefit this feature delivers in cubebox's current form. 1. How host-level burst takes effect under the cubebox form factorLooking at the current implementation, This makes me unsure about the observable effect of burst on the guest side. For example, with
If you have a different understanding or any references on this, happy to align. 2. Validation dataThe Validation section in the PR description consists entirely of
This will help us evaluate the real value of the feature for users. 3. A small naming suggestionThe Overall I'd like to align on points 1 and 2 first. Looking forward to your reply, thanks! |
Summary
Adds an optional per-container
resources.host_burst.cpufield. CubeMaster aggregates the per-container burst ceilings intocube.master.instance.host_cpu_burstand leavesresources.cpuas the normal scheduler/request CPU.Cubelet stores the normal host quota in
HostCpuQ, stores the burst ceiling inHostCpuBurstQ, and converts the difference into the cgroup burst file:cpu.max.burstcpu.cfs_burst_usThe API validates
host_burst.cpu >= cpuandhost_burst.cpu <= 2 * cpu, matching cgroup burst credit limits. For example,cpu=2andhost_burst.cpu=4keeps average CPU at 2 while allowing bounded burst credit up to 4 CPUs.Also adds
cubemastercli tpl create-from-image --host-burst-cpuso template authors can set the burst ceiling when creating templates from images.Validation
go test ./pkg/service/sandbox -run 'TestCheckAndGetContainers'go test ./pkg/service/httpservice/cube -run '^$'GOOS=linux GOARCH=amd64 go test -c -o /tmp/cubelet-cgroup.test ./plugins/cube/internals/cgroupGOOS=linux GOARCH=amd64 go test -c -o /tmp/cubelet-cgroup-handle-v1.test ./plugins/cube/internals/cgroup/handle/v1GOOS=linux GOARCH=amd64 go test -c -o /tmp/cubelet-cgroup-handle-v2.test ./plugins/cube/internals/cgroup/handle/v2GOOS=linux GOARCH=amd64 go test -c -o /tmp/cubelet-services-cubebox.test ./services/cubeboxGOOS=linux GOARCH=amd64 go test -c -o /tmp/cubelet-store-cubebox.test ./pkg/store/cubeboxGOOS=linux GOARCH=amd64 go test -c -o /tmp/cubemastercli-cubebox.test ./cmd/cubemastercli/commands/cubeboxgit diff --checkNote:
go test ./cmd/cubemastercli/commands/cubebox -run 'TestParseContainerOverrides'does not compile on this Darwin/arm64 host because the package depends ongithub.com/agiledragon/gomonkey, which fails withundefined: buildJmpDirectivefor this local toolchain. The Linux compile check above passes.Assisted-by: Codex:GPT-5