Fission workflow env integration (#336)

Add a flag to the environment to control multiple specialization -- the max number of functions per container. This can be set to 1 or infinity. 

Add an api proxy to workflow apiserver from the controller.

Add function metadata to FunctionLoadRequest; every v2 environment now knows which function it's loading (but can ignore that information if it wants to).

Add function identity headers to router. This is useful for multiple specialization, so the router can disambiguate between different function calls. (If this turns out to be a non-trivial perf overhead, we could add these headers conditionally, but for now they are always added.)
This commit is contained in:
Erwin van Eyk
2017-09-26 18:36:07 -07:00
committed by Soam Vasani
parent 3f58247b59
commit 33f967b61b
8 changed files with 115 additions and 20 deletions
+8 -2
View File
@@ -23,6 +23,7 @@ import (
"k8s.io/client-go/1.5/kubernetes"
"k8s.io/client-go/1.5/pkg/api"
"github.com/fission/fission"
"github.com/fission/fission/tpr"
)
@@ -86,9 +87,14 @@ func (gpm *GenericPoolManager) service() {
var err error
pool, ok := gpm.pools[tpr.CacheKey(&req.env.Metadata)]
if !ok {
var poolSize int32 = 3 // TODO configurable/autoscalable
switch req.env.Spec.AllowedFunctionsPerContainer {
case fission.AllowedFunctionsPerContainerInfinite:
poolSize = 1
}
pool, err = MakeGenericPool(
gpm.fissionClient, gpm.kubernetesClient, req.env,
3, // TODO configurable/autoscalable
gpm.fissionClient, gpm.kubernetesClient, req.env, poolSize,
gpm.namespace, gpm.fsCache, gpm.instanceId)
if err != nil {
req.responseChannel <- &response{error: err}