Commit 31498a94 authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch 'oomkill' into 'master'

Add OomKillDisable option to Docker executor

See merge request gitlab-org/gitlab-runner!1042
parents b9e53794 f1a3a45c
......@@ -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"`
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"`
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"`
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"`
......@@ -487,6 +488,10 @@ func (c *DockerConfig) GetMemoryReservation() int64 {
return c.getMemoryBytes(c.MemoryReservation, "memory_reservation")
}
func (c *DockerConfig) GetOomKillDisable() *bool {
return &c.OomKillDisable
}
func (c *KubernetesConfig) GetHelperImage() string {
if len(c.HelperImage) > 0 {
return c.HelperImage
......
......@@ -185,6 +185,7 @@ This defines the Docker Container parameters.
| `memory` | String value containing the memory limit |
| `memory_swap` | String value containing the total memory 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 |
| `cpus` | Number of CPUs (available in docker 1.13 or later) |
| `dns` | A list of DNS servers for the container to use |
......@@ -224,6 +225,7 @@ Example:
memory = "128m"
memory_swap = "256m"
memory_reservation = "64m"
oom_kill_disable = false
cpuset_cpus = "0,1"
dns = ["8.8.8.8"]
dns_search = [""]
......
......@@ -889,6 +889,7 @@ func (e *executor) createContainer(containerType string, imageDefinition common.
CpusetCpus: e.Config.Docker.CPUSetCPUs,
NanoCPUs: nanoCPUs,
Devices: e.devices,
OomKillDisable: e.Config.Docker.GetOomKillDisable(),
},
DNS: e.Config.Docker.DNS,
DNSSearch: e.Config.Docker.DNSSearch,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment