You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-11-23 21:44:44 +02:00
Move docker resource limit settings from server to agent (#3174)
so you can set it per agent and not per server
This commit is contained in:
@@ -68,20 +68,20 @@ func toContainerName(step *types.Step) string {
|
||||
}
|
||||
|
||||
// returns a container host configuration.
|
||||
func toHostConfig(step *types.Step) *container.HostConfig {
|
||||
func toHostConfig(step *types.Step, conf *config) *container.HostConfig {
|
||||
config := &container.HostConfig{
|
||||
Resources: container.Resources{
|
||||
CPUQuota: step.CPUQuota,
|
||||
CPUShares: step.CPUShares,
|
||||
CpusetCpus: step.CPUSet,
|
||||
Memory: step.MemLimit,
|
||||
MemorySwap: step.MemSwapLimit,
|
||||
CPUQuota: conf.resourceLimit.CPUQuota,
|
||||
CPUShares: conf.resourceLimit.CPUShares,
|
||||
CpusetCpus: conf.resourceLimit.CPUSet,
|
||||
Memory: conf.resourceLimit.MemLimit,
|
||||
MemorySwap: conf.resourceLimit.MemSwapLimit,
|
||||
},
|
||||
ShmSize: conf.resourceLimit.ShmSize,
|
||||
LogConfig: container.LogConfig{
|
||||
Type: "json-file",
|
||||
},
|
||||
Privileged: step.Privileged,
|
||||
ShmSize: step.ShmSize,
|
||||
}
|
||||
|
||||
if len(step.NetworkMode) != 0 {
|
||||
|
||||
Reference in New Issue
Block a user