mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
add IGNORE_MEMORY
This commit is contained in:
@@ -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 ...`")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
test.sh
4
test.sh
@@ -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" \
|
||||||
|
|||||||
Reference in New Issue
Block a user