Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Sources/Containerization/LinuxContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,7 @@ extension LinuxContainer {
var modifiedRootfs = self.rootfs
modifiedRootfs.options.removeAll(where: { $0 == "ro" })

let mib: UInt64 = 1.mib()
let vmMemory = (self.memoryInBytes + self.config.memoryOverhead + mib - 1) & ~(mib - 1)
let vmMemory = self.memoryInBytes + self.config.memoryOverhead

let vmCpus = self.cpus + self.config.cpuOverhead

Expand Down
3 changes: 2 additions & 1 deletion Sources/Containerization/VZVirtualMachineInstance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,8 @@ extension VZVirtualMachineInstance.Configuration {
var config = VZVirtualMachineConfiguration()

config.cpuCount = self.cpus
config.memorySize = self.memoryInBytes
let mib: UInt64 = 1 << 20
config.memorySize = (self.memoryInBytes + mib - 1) & ~(mib - 1)
config.entropyDevices = [VZVirtioEntropyDeviceConfiguration()]
config.socketDevices = [VZVirtioSocketDeviceConfiguration()]

Expand Down
1 change: 1 addition & 0 deletions Sources/Integration/ContainerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ extension IntegrationSuite {
let bs = try await bootstrap(id)
let container = try LinuxContainer(id, rootfs: bs.rootfs, vmm: bs.vmm) { config in
config.process.arguments = ["/bin/true"]
config.memoryInBytes = 250_000_000
config.bootLog = bs.bootLog
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Integration/PodTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ extension IntegrationSuite {
let bs = try await bootstrap(id)
let pod = try LinuxPod(id, vmm: bs.vmm) { config in
config.cpus = 4
config.memoryInBytes = 1024.mib()
config.memoryInBytes = 1_000_000_000
config.bootLog = bs.bootLog
}

Expand Down
Loading