option to set global shm_size

This commit is contained in:
Brad Rydzewski
2020-04-15 13:00:56 -04:00
parent db5468f23b
commit 80c26bc5d9
6 changed files with 17 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ type Resources struct {
CPUPeriod int64
CPUShares int64
CPUSet []string
ShmSize int64
}
// Compiler compiles the Yaml configuration file to an
@@ -371,12 +372,15 @@ func (c *Compiler) Compile(ctx context.Context, args runtime.CompilerArgs) runti
// the resource limits defined in the yaml currently
// take precedence over global values. This is something
// we should re-think in a future release.
if step.MemSwapLimit != 0 {
if step.MemSwapLimit == 0 {
step.MemSwapLimit = c.Resources.MemorySwap
}
if step.MemLimit != 0 {
if step.MemLimit == 0 {
step.MemLimit = c.Resources.Memory
}
if step.ShmSize == 0 {
step.ShmSize = c.Resources.ShmSize
}
step.CPUPeriod = c.Resources.CPUPeriod
step.CPUQuota = c.Resources.CPUQuota
step.CPUShares = c.Resources.CPUShares