:= attempts to declare as many of the variables on its left side as it
can, instead of re-using as many as it can. Consider this code:
a, ok := foo()
if !ok {
a, err := bar()
...
}
The inner 'a' is a different var from the outer one, and goes out of
scope at the }. The outer 'a' is left with whatever value foo()
returned.
fission-bundle is a single binary that can be run as one or more of
the router, controller and poolmgr. It's built into one docker image
which can then be run with different commands.
Router uses poolmgr to specialize pods when necessary.
Router uses controller to get the list of triggers to listen for. For
now this integration is pretty crappy -- we just poll the controller
every few seconds and cache the result. The right way would be to
have some sort of watch API on the controller and use that. Or maybe
share access to etcd directly.
Switch to client-go package instead of pulling the from kubernetes.
Use a versioned client with sensible compatiblity.
This change breaks 'go get'. For now you have to manually checkout
the 'release-1.4' branch of the client-go package after 'go get'
fetches it. TODO: use one of the build tools to fix this.
GenericPool is a pool of generic containers for an environment.
GenericPoolManager keeps track of all GenericPools, creating them
on-demand.
The pool manager API is simply a "lookup" for the service URL of a
function. If one exists it is returned immediately; otherwise, a
generic pool is created, and then a pod is specialized from that pool.
poolmgr is designed to run from within the cluster, since it connects
to pod IP addresses directly.
This is a first cut with many pieces missing.
TODO:
* Use versioned kubernetes clients instead of the unversioned one
* Unit tests for GenericPoolMgr; improve unit test for GenericPool;
test for API.
* Handle cases where a service exists but pod backing it has failed.
* On start up, use existing deployments/pods/services if they exist;
in other words don't orphan resources on restart.
* Kill idle resources (services, pods, even generic pools)
* Autoscale generic pool (for example, by watching num ready pods)
Fetcher is a tool to download functions from the controller. It is
meant to be run in a container in the same pod as the function run
container, with a shared volume.
Environments for functions. For now this is just the image URL for the
function run container. In the future, Environments will also have
build container image URLs, and perhaps parameters to those
containers.
Create/read/update/delete/list. Versioning will be added later. For
now, only the latest update is stored.
This implemenents create/read/update/delete/list for http triggers.
This isn't quite the final implementation: you can't look up old
versions by UUID since it only stores the latest update. I'll get to
that later.