Skip to content

Commit 4a7d861

Browse files
Update to latest containerization@0.47.0 (#2301)
Signed-off-by: Kathryn Baldauf <k_baldauf@apple.com>
1 parent eafe6b8 commit 4a7d861

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

‎Package.resolved‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Package.swift‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import PackageDescription
2323
let releaseVersion = ProcessInfo.processInfo.environment["RELEASE_VERSION"] ?? "0.0.0"
2424
let gitCommit = ProcessInfo.processInfo.environment["GIT_COMMIT"] ?? "unspecified"
2525
let builderShimVersion = "0.13.1"
26-
let scVersion = "0.45.0"
26+
let scVersion = "0.47.0"
2727

2828
let package = Package(
2929
name: "container",

‎Sources/Services/RuntimeLinux/Server/RuntimeService.swift‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,13 @@ public actor RuntimeService {
263263

264264
let id = config.id
265265
let rootfs = try bundle.containerRootfs.asMount
266-
let container = try LinuxContainer(id, rootfs: rootfs, vmm: vmm, logger: self.log) { czConfig in
266+
// Give the VM headroom beyond the container's cgroup limits for the guest kernel,
267+
// vminitd, and the overhead configured via `config.resources.cpuOverhead`.
268+
let vmResources = VMResources(
269+
cpus: config.resources.cpus + config.resources.cpuOverhead,
270+
memoryInBytes: config.resources.memoryInBytes + VMResources.guestMemoryOverhead
271+
)
272+
let container = try LinuxContainer(id, rootfs: rootfs, vmm: vmm, vm: vmResources, logger: self.log) { czConfig in
267273
try Self.configureContainer(czConfig: &czConfig, config: config, dynamicEnv: dynamicEnv, log: self.log)
268274
czConfig.interfaces = interfaces
269275
czConfig.process.stdout = stdout
@@ -1116,7 +1122,6 @@ public actor RuntimeService {
11161122
log: Logger? = nil,
11171123
) throws {
11181124
czConfig.cpus = config.resources.cpus
1119-
czConfig.cpuOverhead = config.resources.cpuOverhead
11201125
czConfig.memoryInBytes = config.resources.memoryInBytes
11211126
// Overcommit memory and allow more memory mappings than the kernel default
11221127
// so workloads inside swap-less guest VMs hit limits less easily.

0 commit comments

Comments
 (0)