mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Experimental Pre-fork Pool: Recycle net ns (#890)
* fn: experimental prefork recycle and other improvements
*) Recycle and do not use same pool container again option.
*) Two state processing: initializing versus ready (start-kill).
*) Ready state is exempt from rate limiter.
* fn: experimental prefork pool multiple network support
In order to exceed 1023 container (bridge port) limit, add
multiple networks:
for i in fn-net1 fn-net2 fn-net3 fn-net4
do
docker network create $i
done
to Docker startup, (eg. dind preentry.sh), then provide this
to prefork pool using:
export FN_EXPERIMENTAL_PREFORK_NETWORKS="fn-net1 fn-net2 fn-net3 fn-net4"
which should be able to spawn 1023 * 4 containers.
* fn: fixup tests for cfg move
* fn: add ipc and pid namespaces into prefork pooling
* fn: revert ipc and pid namespaces for now
Pid/Ipc opens up the function container to pause container.
This commit is contained in:
@@ -8,13 +8,21 @@ import (
|
||||
"github.com/fnproject/fn/api/agent/drivers"
|
||||
)
|
||||
|
||||
func getDefaultCfg() *drivers.Config {
|
||||
cfg := &drivers.Config{
|
||||
PreForkImage: "busybox",
|
||||
PreForkCmd: "tail -f /dev/null",
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
||||
func TestRunnerDockerPool(t *testing.T) {
|
||||
if runtime.GOOS != "linux" {
|
||||
t.Skip("prefork only supported on Linux")
|
||||
return
|
||||
}
|
||||
|
||||
cfg := &drivers.Config{}
|
||||
cfg := getDefaultCfg()
|
||||
|
||||
// shouldn't spin up a pool since cfg is empty
|
||||
drv := NewDocker(*cfg)
|
||||
@@ -95,7 +103,7 @@ func TestRunnerDockerPoolFaulty(t *testing.T) {
|
||||
return
|
||||
}
|
||||
|
||||
cfg := &drivers.Config{}
|
||||
cfg := getDefaultCfg()
|
||||
|
||||
// shouldn't spin up a pool since cfg is empty
|
||||
drv := NewDocker(*cfg)
|
||||
|
||||
Reference in New Issue
Block a user