fix(bundle): Pin urunc at the commit that sizes vCPUs from --cpus - #11
Merged
Merged
Conversation
Every guest the bundle boots had one vCPU, whatever `brig run --cpus` or the profile asked for (4 for the agent profiles). urunc never read the CPU resources in the container's OCI spec. It took the monitor's default_vcpus, which the bundle sets to 1, and cloud-hypervisor got `--cpus boot=1`. Memory was not affected: urunc already follows the container's memory limit. urunc 74dd0cc sizes a container boot's vCPUs from the CPU quota that `nerdctl run --cpus` sets, or from a cpuset, and caps the count at the host's CPUs. It is 0818ff1 plus that one commit, on the same branch, so the exec fixes stay as they were. default_vcpus = 1 stays as the fallback for a container with no CPU limit. Signed-off-by: Anastassios Nanos <ananos@nofire.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every guest the bundle boots has one vCPU, whatever
brig run --cpusor the profile asks for (4 for the agent profiles). urunc never read the CPU resources in the container's OCI spec. It took the monitor'sdefault_vcpus, which the bundle sets to 1, so cloud-hypervisor got--cpus boot=1. Memory was not affected, since urunc already follows the container's memory limit.This moves the urunc pin to
74dd0cc9e3028ea18c5daff69e4ba5452075f21donfeat/unchanged_containers-exec-fixes. That is0818ff1, the rc9 pin, plus one commit,feat(unikontainers): Size a container boot's vCPUs from its CPU limit:nerdctl run --cpussets) givesceil(quota/period)vCPUs;default_vcpus = 1stays as the fallback for a container with no CPU limit.Once this is merged, bundle rc10 is cut from
main, and brig'sinstall.shmoves its runtime pin fromv0.1.0-rc9to rc10 in a separate brig PR.Changes
scripts/build-bundle.sh:URUNC_REF_DEFAULTmoves from0818ff1to74dd0cc, and the comment says what the pin carries.README.md,DESIGN.md,docs/variants.md: the pinned commit, plus a line in the README's pins section on--cpus.Testing
The urunc commit's own unit tests pass on an Ubuntu 24.04 amd64 host:
TestMonitorVCPUs,TestCpusetCount,TestBuildMonitorSpecVCPUs, plus the existing monitor-spec and container-boot tests. With the line that applies the count removed,TestBuildMonitorSpecVCPUsfails.golangci-lint --new-from-revreports 0 new issues.This repo:
sh -nandshellcheckare clean, andtests/*.shall pass,source-pins.shincluded.CI built all four bundles, and each
pins.envnamesURUNC_REF=74dd0cc…withURUNC_PINNED=true.Live, on an Ubuntu 24.04 amd64 host (14 CPUs) with a rootless user install. This PR's
bundle-amd64-rootlessCI artifact was installed over rc9 withINSTALL_BRIG_BUNDLE(upgrade in place, no sudo), with brig main 3e5ae98. The cloud-hypervisor argument is read fromps:nproc--cpus boot=1--cpus boot=2--cpus boot=4--cpus 1--cpus boot=1--cpus 3--cpus boot=3--cpus 64--cpus boot=14(capped)--mem 1024still gives--memory size=1073Mand a MemTotal of about 1 GB.No regression on that host:
brig shcalls: none missing..clauderefusals.DOCKER_CONFIGunset.