add IGNORE_MEMORY

This commit is contained in:
Pedro Nasser
2016-09-12 14:44:11 -03:00
parent 6f9432b7ea
commit e6d0079051
2 changed files with 16 additions and 9 deletions

View File

@@ -196,15 +196,20 @@ func dynamicSizing(reqMem uint64) int {
reqMem = 128
}
availableMemory, err := checkCgroup()
if err != nil {
logrus.WithError(err).Error("Error checking for cgroup memory limits, falling back to host memory available..")
}
if availableMemory > tooBig || availableMemory == 0 {
// Then -m flag probably wasn't set, so use max available on system
availableMemory, err = checkProc()
var availableMemory uint64
if os.Getenv("IGNORE_MEMORY") == "1" {
availableMemory = tooBig
} else {
availableMemory, err := checkCgroup()
if err != nil {
logrus.WithError(err).Error("Error checking for cgroup memory limits, falling back to host memory available..")
}
if availableMemory > tooBig || availableMemory == 0 {
logrus.WithError(err).Fatal("Your Linux version is too old (<3.14) then we can't get the proper information to . You must specify the maximum available memory by passing the -m command with docker run when starting the runner via docker, eg: `docker run -m 2G ...`")
// Then -m flag probably wasn't set, so use max available on system
availableMemory, err = checkProc()
if availableMemory > tooBig || availableMemory == 0 {
logrus.WithError(err).Fatal("Your Linux version is too old (<3.14) then we can't get the proper information to . You must specify the maximum available memory by passing the -m command with docker run when starting the runner via docker, eg: `docker run -m 2G ...`")
}
}
}

View File

@@ -1,5 +1,7 @@
export GO15VENDOREXPERIMENT=1
docker run --rm -it -m 2G -v /var/run/docker.sock:/var/run/docker.sock \
export IGNORE_MEMORY=1
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock \
-e TEST_DOCKER_USERNAME \
-e TEST_DOCKER_PASSWORD \
-e CI="$CI" \