Skip to content
Snippets Groups Projects
Commit f1a3a45c authored by Marko Petric's avatar Marko Petric Committed by Kamil Trzciński
Browse files

Add OomKillDisable option to Docker executor

parent b9e53794
No related branches found
No related tags found
No related merge requests found
...@@ -66,6 +66,7 @@ type DockerConfig struct { ...@@ -66,6 +66,7 @@ type DockerConfig struct {
UsernsMode string `toml:"userns_mode,omitempty" json:"userns_mode" long:"userns" env:"DOCKER_USERNS_MODE" description:"User namespace to use"` UsernsMode string `toml:"userns_mode,omitempty" json:"userns_mode" long:"userns" env:"DOCKER_USERNS_MODE" description:"User namespace to use"`
CapAdd []string `toml:"cap_add" json:"cap_add" long:"cap-add" env:"DOCKER_CAP_ADD" description:"Add Linux capabilities"` CapAdd []string `toml:"cap_add" json:"cap_add" long:"cap-add" env:"DOCKER_CAP_ADD" description:"Add Linux capabilities"`
CapDrop []string `toml:"cap_drop" json:"cap_drop" long:"cap-drop" env:"DOCKER_CAP_DROP" description:"Drop Linux capabilities"` CapDrop []string `toml:"cap_drop" json:"cap_drop" long:"cap-drop" env:"DOCKER_CAP_DROP" description:"Drop Linux capabilities"`
OomKillDisable bool `toml:"oom_kill_disable,omitzero" json:"oom_kill_disable" long:"oom-kill-disable" env:"DOCKER_OOM_KILL_DISABLE" description:"Do not kill processes in a container if an out-of-memory (OOM) error occurs"`
SecurityOpt []string `toml:"security_opt" json:"security_opt" long:"security-opt" env:"DOCKER_SECURITY_OPT" description:"Security Options"` SecurityOpt []string `toml:"security_opt" json:"security_opt" long:"security-opt" env:"DOCKER_SECURITY_OPT" description:"Security Options"`
Devices []string `toml:"devices" json:"devices" long:"devices" env:"DOCKER_DEVICES" description:"Add a host device to the container"` Devices []string `toml:"devices" json:"devices" long:"devices" env:"DOCKER_DEVICES" description:"Add a host device to the container"`
DisableCache bool `toml:"disable_cache,omitzero" json:"disable_cache" long:"disable-cache" env:"DOCKER_DISABLE_CACHE" description:"Disable all container caching"` DisableCache bool `toml:"disable_cache,omitzero" json:"disable_cache" long:"disable-cache" env:"DOCKER_DISABLE_CACHE" description:"Disable all container caching"`
...@@ -487,6 +488,10 @@ func (c *DockerConfig) GetMemoryReservation() int64 { ...@@ -487,6 +488,10 @@ func (c *DockerConfig) GetMemoryReservation() int64 {
return c.getMemoryBytes(c.MemoryReservation, "memory_reservation") return c.getMemoryBytes(c.MemoryReservation, "memory_reservation")
} }
func (c *DockerConfig) GetOomKillDisable() *bool {
return &c.OomKillDisable
}
func (c *KubernetesConfig) GetHelperImage() string { func (c *KubernetesConfig) GetHelperImage() string {
if len(c.HelperImage) > 0 { if len(c.HelperImage) > 0 {
return c.HelperImage return c.HelperImage
......
...@@ -185,6 +185,7 @@ This defines the Docker Container parameters. ...@@ -185,6 +185,7 @@ This defines the Docker Container parameters.
| `memory` | String value containing the memory limit | | `memory` | String value containing the memory limit |
| `memory_swap` | String value containing the total memory limit | | `memory_swap` | String value containing the total memory limit |
| `memory_reservation` | String value containing the memory soft limit | | `memory_reservation` | String value containing the memory soft limit |
| `oom_kill_disable` | Do not kill processes in a container if an out-of-memory (OOM) error occurs |
| `cpuset_cpus` | String value containing the cgroups CpusetCpus to use | | `cpuset_cpus` | String value containing the cgroups CpusetCpus to use |
| `cpus` | Number of CPUs (available in docker 1.13 or later) | | `cpus` | Number of CPUs (available in docker 1.13 or later) |
| `dns` | A list of DNS servers for the container to use | | `dns` | A list of DNS servers for the container to use |
...@@ -224,6 +225,7 @@ Example: ...@@ -224,6 +225,7 @@ Example:
memory = "128m" memory = "128m"
memory_swap = "256m" memory_swap = "256m"
memory_reservation = "64m" memory_reservation = "64m"
oom_kill_disable = false
cpuset_cpus = "0,1" cpuset_cpus = "0,1"
dns = ["8.8.8.8"] dns = ["8.8.8.8"]
dns_search = [""] dns_search = [""]
......
...@@ -889,6 +889,7 @@ func (e *executor) createContainer(containerType string, imageDefinition common. ...@@ -889,6 +889,7 @@ func (e *executor) createContainer(containerType string, imageDefinition common.
CpusetCpus: e.Config.Docker.CPUSetCPUs, CpusetCpus: e.Config.Docker.CPUSetCPUs,
NanoCPUs: nanoCPUs, NanoCPUs: nanoCPUs,
Devices: e.devices, Devices: e.devices,
OomKillDisable: e.Config.Docker.GetOomKillDisable(),
}, },
DNS: e.Config.Docker.DNS, DNS: e.Config.Docker.DNS,
DNSSearch: e.Config.Docker.DNSSearch, DNSSearch: e.Config.Docker.DNSSearch,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment