Executor abstraction (#384)

This change adds a layer of abstraction over poolmgr. Poolmgr is now just one of the ways to turn a function into a service; other implementations will be added. The executor abstraction is a uniform API over all these implementations.

* Executor layer added on top of pool manager

* Removed the external server for executor

* Minor changes to keep existing semantics as much possible

* Separating the executor vs. poolmgr backend functionality and associated data members

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed references to poolmgr in tests

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Executor layer added on top of pool manager

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed podName to a generic objectReference in fscache (#391)

Changed podName to a generic objectReference in function service cache implementation.

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Merged from master with latest changes

* Removed stale executor service & deployment from previous merge

* Addressed review comments, still testing some areas
This commit is contained in:
Vishal
2017-11-20 20:51:14 -08:00
committed by Soam Vasani
parent 7bb397dfee
commit da820186f0
20 changed files with 476 additions and 458 deletions
+6 -6
View File
@@ -30,14 +30,14 @@ import (
"github.com/fission/fission"
"github.com/fission/fission/crd"
poolmgrClient "github.com/fission/fission/poolmgr/client"
executorClient "github.com/fission/fission/executor/client"
)
type HTTPTriggerSet struct {
*functionServiceMap
*mutableRouter
fissionClient *crd.FissionClient
poolmgr *poolmgrClient.Client
executor *executorClient.Client
resolver *functionReferenceResolver
crdClient *rest.RESTClient
triggers []crd.HTTPTrigger
@@ -49,12 +49,12 @@ type HTTPTriggerSet struct {
}
func makeHTTPTriggerSet(fmap *functionServiceMap, fissionClient *crd.FissionClient,
poolmgr *poolmgrClient.Client, crdClient *rest.RESTClient) (*HTTPTriggerSet, k8sCache.Store, k8sCache.Store) {
executor *executorClient.Client, crdClient *rest.RESTClient) (*HTTPTriggerSet, k8sCache.Store, k8sCache.Store) {
httpTriggerSet := &HTTPTriggerSet{
functionServiceMap: fmap,
triggers: []crd.HTTPTrigger{},
fissionClient: fissionClient,
poolmgr: poolmgr,
executor: executor,
crdClient: crdClient,
}
var tStore, fnStore k8sCache.Store
@@ -114,7 +114,7 @@ func (ts *HTTPTriggerSet) getRouter() *mux.Router {
fh := &functionHandler{
fmap: ts.functionServiceMap,
function: rr.functionMetadata,
poolmgr: ts.poolmgr,
executor: ts.executor,
}
muxRouter.HandleFunc(trigger.Spec.RelativeURL, fh.handler).Methods(trigger.Spec.Method)
if trigger.Spec.RelativeURL == "/" && trigger.Spec.Method == "GET" {
@@ -139,7 +139,7 @@ func (ts *HTTPTriggerSet) getRouter() *mux.Router {
fh := &functionHandler{
fmap: ts.functionServiceMap,
function: &m,
poolmgr: ts.poolmgr,
executor: ts.executor,
}
muxRouter.HandleFunc(fission.UrlForFunction(function.Metadata.Name), fh.handler)
}