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 reqMem = 128
} }
availableMemory, err := checkCgroup() var availableMemory uint64
if err != nil { if os.Getenv("IGNORE_MEMORY") == "1" {
logrus.WithError(err).Error("Error checking for cgroup memory limits, falling back to host memory available..") availableMemory = tooBig
} } else {
if availableMemory > tooBig || availableMemory == 0 { availableMemory, err := checkCgroup()
// Then -m flag probably wasn't set, so use max available on system if err != nil {
availableMemory, err = checkProc() logrus.WithError(err).Error("Error checking for cgroup memory limits, falling back to host memory available..")
}
if availableMemory > tooBig || availableMemory == 0 { 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 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_USERNAME \
-e TEST_DOCKER_PASSWORD \ -e TEST_DOCKER_PASSWORD \
-e CI="$CI" \ -e CI="$CI" \