Skip to content

Commit

Permalink
bugfix: rm omitempty in resource fields
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
  • Loading branch information
allencloud committed Jun 11, 2018
1 parent a0ef39d commit 8f254e7
Show file tree
Hide file tree
Showing 2 changed files with 378 additions and 75 deletions.
44 changes: 34 additions & 10 deletions apis/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2237,19 +2237,17 @@ definitions:
Resources:
description: "A container's resources (cgroups config, ulimits, etc)"
type: "object"
required: [CPUShares, Memory, CgroupParent, BlkioWeight, CPUPeriod, CPUQuota, CpuRealtimePeriod,
CpuRealtimeRuntime, CpusetCpus, CpusetMems, DeviceCgroupRules, KernelMemory, MemoryReservation,
MemorySwap, MemorySwappiness, NanoCPUs, OomKillDisable, PidsLimit, CpuCount, CpuPercent,
IOMaximumIOps, IOMaximumBandwidth, IntelRdtL3Cbm, ScheLatSwitch, MemoryWmarkRatio, MemoryExtra,
MemoryForceEmptyCtl]
properties:
# Applicable to all platforms
CpuShares:
description: "An integer value representing this container's relative CPU weight versus other containers."
type: "integer"
Memory:
description: "Memory limit in bytes."
type: "integer"
default: 0
# Applicable to UNIX platforms
CgroupParent:
description: "Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist."
type: "string"
x-nullable: false
BlkioWeight:
description: "Block IO weight (relative weight), need CFQ IO Scheduler enable."
type: "integer"
Expand Down Expand Up @@ -2287,36 +2285,46 @@ definitions:
type: "array"
items:
$ref: "#/definitions/ThrottleDevice"
CpuPeriod:
CPUShares:
description: "An integer value representing this container's relative CPU weight versus other containers."
type: "integer"
x-nullable: false
CPUPeriod:
description: |
CPU CFS (Completely Fair Scheduler) period.
The length of a CPU period in microseconds.
type: "integer"
format: "int64"
minimum: 1000
maximum: 1000000
CpuQuota:
x-nullable: false
CPUQuota:
description: |
CPU CFS (Completely Fair Scheduler) quota.
Microseconds of CPU time that the container can get in a CPU period."
type: "integer"
format: "int64"
minimum: 1000
x-nullable: false
CpuRealtimePeriod:
description: "The length of a CPU real-time period in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
x-nullable: false
CpuRealtimeRuntime:
description: "The length of a CPU real-time runtime in microseconds. Set to 0 to allocate no time allocated to real-time tasks."
type: "integer"
format: "int64"
x-nullable: false
CpusetCpus:
description: "CPUs in which to allow execution (e.g., `0-3`, `0,1`)"
type: "string"
example: "0-3"
x-nullable: false
CpusetMems:
description: "Memory nodes (MEMs) in which to allow execution (0-3, 0,1). Only effective on NUMA systems."
type: "string"
x-nullable: false
Devices:
description: "A list of devices to add to the container."
type: "array"
Expand All @@ -2332,14 +2340,22 @@ definitions:
description: "Kernel memory limit in bytes."
type: "integer"
format: "int64"
x-nullable: false
Memory:
description: "Memory limit in bytes."
type: "integer"
default: 0
x-nullable: false
MemoryReservation:
description: "Memory soft limit in bytes."
type: "integer"
format: "int64"
x-nullable: false
MemorySwap:
description: "Total memory limit (memory + swap). Set as `-1` to enable unlimited swap."
type: "integer"
format: "int64"
x-nullable: false
MemorySwappiness:
description: "Tune a container's memory swappiness behavior. Accepts an integer between 0 and 100."
type: "integer"
Expand All @@ -2350,6 +2366,7 @@ definitions:
description: "CPU quota in units of 10<sup>-9</sup> CPUs."
type: "integer"
format: "int64"
x-nullable: false
OomKillDisable:
description: "Disable OOM Killer for the container."
type: "boolean"
Expand All @@ -2359,6 +2376,7 @@ definitions:
Tune a container's pids limit. Set -1 for unlimited. Only on Linux 4.4 does this parameter support.
type: "integer"
format: "int64"
x-nullable: false
Ulimits:
description: |
A list of resource limits to set in the container. For example: `{"Name": "nofile", "Soft": 1024, "Hard": 2048}`"
Expand All @@ -2372,23 +2390,28 @@ definitions:
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
x-nullable: false
CpuPercent:
description: |
The usable percentage of the available CPUs (Windows only).
On Windows Server containers, the processor resource controls are mutually exclusive. The order of precedence is `CPUCount` first, then `CPUShares`, and `CPUPercent` last.
type: "integer"
format: "int64"
x-nullable: false
IOMaximumIOps:
description: "Maximum IOps for the container system drive (Windows only)"
type: "integer"
format: "uint64"
x-nullable: false
IOMaximumBandwidth:
description: "Maximum IO in bytes per second for the container system drive (Windows only)"
type: "integer"
format: "uint64"
x-nullable: false
IntelRdtL3Cbm:
description: "IntelRdtL3Cbm specifies settings for Intel RDT/CAT group that the container is placed into to limit the resources (e.g., L3 cache) the container has available."
type: "string"
x-nullable: false

# applicable to AliKenerl 4.9
ScheLatSwitch:
Expand All @@ -2398,6 +2421,7 @@ definitions:
x-nullable: false
minimum: 0
maximum: 1
x-nullable: false
MemoryWmarkRatio:
description: |
MemoryWmarkRatio is an integer value representing this container's memory low water mark percentage.
Expand Down
Loading

0 comments on commit 8f254e7

Please sign in to comment.