hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
826 stars 129 forks source link

respect cpu and memory settings in spec #589

Closed bergwolf closed 7 years ago

bergwolf commented 7 years ago

For CPU, use Spec.Linux.Resources.CPU.Quota/Spec.Linux.Resources.CPU.Period.

For Memory, use Spec.Linux.Resources.Memory.Limit.

$docker run --rm -it --cpus 1.5 --memory 671088640 busybox sh
/ # cat /proc/cpuinfo |grep processor
processor       : 0
processor       : 1
/ # cat /proc/meminfo |grep MemTotal
MemTotal:         569512 kB

fixes https://github.com/hyperhq/runv/issues/586

bergwolf commented 7 years ago

@laijs updated.

laijs commented 7 years ago

LGTM