Commit Graph
107 Commits
Author SHA1 Message Date
Soam Vasani 094da5c69a Add expiry time to cache
MakeCache() now takes a time.Duration after which entries are
considered invalid, and not returned from a Get().
2016-11-04 23:05:29 -07:00
Soam Vasani f639bc3558 Use fission.Cache for functionServiceMap 2016-11-04 23:05:29 -07:00
Soam Vasani 5cfe4b7c1d Log and ignore errors on eager pool creation 2016-11-04 23:05:29 -07:00
Soam Vasani f3eba4b825 Call poolmgr from router while using a cached service
Poolmgr needs to know usage statistics for a function's pod.  This
change asynchronously taps poolmgr API when router uses a service.
Poolmgr can use this information to control pod expiry.  It may also
be useful later as one of the metrics for autoscaling.
2016-11-04 23:05:29 -07:00
Soam VasaniandGitHub 22583481a4 Merge pull request #19 from platform9/fission-cli
Fission CLI
2016-11-04 23:04:58 -07:00
Soam Vasani 96616507fd Fission CLI
fission (function|httptrigger|environment) (create|get|update|delete|list)

TODO: Commands for getting status, logs, perf stats.  Commands for
changing configuration.  Add examples.
2016-11-04 22:59:52 -07:00
Soam Vasani a5ae7688ce Make *Update functions consistently return fission.Metadata 2016-11-04 22:57:11 -07:00
Soam Vasani f775806405 Add HTTP method to HTTPTrigger 2016-11-04 22:56:44 -07:00
Soam Vasani a6cd6e99fe Eagerly create generic pools
Poolmgr now watches the controller's list of environments and eagerly
creates a generic pool for each environment, if one doesn't already exist.
2016-11-03 15:08:06 -07:00
Soam Vasani c978efa1d9 Return bare pod IPs to router, instead of creating services
Even though the K8s api returns quickly after creating a service, that
service doesn't seem usage until about a second or two later.  We need
to investigate this and see if there's something we can do to make it
faster.  If there isn't we'll remove the svc code entirely; for now
it's behind a useSvc flag that's set to false.
2016-11-03 15:07:26 -07:00
Soam Vasani 59cc772b89 Add retries to router's proxy
Create an implementation of http.RoundTrip which does retries --
RetryingRoundTripper.  K8s services seem to timeout for about ~1-2 sec
after they're created even when the pods being routed to are ready to
serve requests.
2016-11-03 14:59:41 -07:00
Soam Vasani 1b76cdf200 Remove request path when routing
Route all requests to / on the function run container.  It doesn't
need to do any routing since it has only one function.
2016-11-03 10:11:43 -07:00
Soam Vasani bbaa766fe1 Poolmgr -- add retries to specialize call
If the pool is new or very busy, we may call the chosen container's
specialize endpoint before it's actually up -- handle the case by
retrying a few times.

Also namespace-qualify service hostname (since router and
functions run in different namespaces).
2016-11-03 10:11:25 -07:00
Soam Vasani f7ea5b99fd Namespace-qualify controller and poolmgr URLs 2016-11-03 10:05:06 -07:00
Soam Vasani 4cd3e65692 Another bug due to initialization/assignment confusion 2016-11-02 22:42:43 -07:00
Soam Vasani bb687d3e98 Don't use := when some vars are defined
:= 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.
2016-11-02 20:29:21 -07:00
Soam Vasani af8e5f360f Don't put internal fission error details in responses 2016-11-02 16:07:07 -07:00
Soam Vasani b1587551d5 Filestore - create path if it doesn't exist 2016-11-02 16:06:27 -07:00
Soam Vasani 91eb0ca3cd Poolmgr bugfix -- remove double response on the same channel 2016-11-02 15:47:32 -07:00
Soam Vasani f8a1fdf4c6 Improve logging in controller, fetcher, poolmgr
TODO: most of these should be in a debug loglevel.
2016-11-02 15:06:55 -07:00
Soam Vasani bfdd706b98 Rename 'function-run' dir to 'environments' 2016-11-02 11:22:20 -07:00
Soam Vasani 0805e5911d Use build.sh to build 2016-11-02 00:30:08 -07:00
Soam Vasani 5cacf9e90b Script to push to docker hub 2016-11-02 00:29:40 -07:00
Soam Vasani 3ca1191117 Make some router settings configurable; silence noisy logs 2016-11-02 00:28:07 -07:00
Soam VasaniandGitHub e19669b019 Merge pull request #18 from platform9/controller-emptydb-bug
Fix resource store errors on empty db
2016-11-02 00:26:40 -07:00
Soam Vasani 49acdc49eb Fix resource store errors on empty db 2016-11-02 00:23:06 -07:00
Soam VasaniandGitHub 320b56bd68 Merge pull request #17 from platform9/fission-bundle
fission-bundle: executable package for router, controller, poolmgr
2016-11-01 18:38:33 -07:00
Soam Vasani d124c1331c fission-bundle: executable package for router, controller, poolmgr
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.
2016-11-01 18:37:10 -07:00
Soam VasaniandGitHub c07311d214 Merge pull request #16 from platform9/router-poolmgr
Router integration with poolmgr and controller
2016-11-01 18:29:27 -07:00
Soam Vasani 3d5e52dc3d Router integration with poolmgr and controller
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.
2016-11-01 18:22:04 -07:00
Soam Vasani 2b15b726d4 Poolmgr client 2016-11-01 18:14:38 -07:00
Soam Vasani 6e86182e19 Poolmgr API tweaks + convenient Start function 2016-11-01 18:14:23 -07:00
Soam Vasani 1cf531038a fission.Error constructor from http response 2016-11-01 18:11:46 -07:00
Soam Vasani 8b8e8c6539 Trim server url in client init 2016-11-01 18:11:21 -07:00
Soam VasaniandGitHub e49f165ba2 Merge pull request #15 from platform9/poolmgr
Poolmgr -- manage generic containers and their specialization
2016-11-01 02:20:00 -07:00
Soam Vasani 01bfa8b082 Minor changes; remove noisy test logs 2016-11-01 01:32:02 -07:00
Soam Vasani 40dfba1a41 Switch to official Kubernetes Go client -- client-go/1.4
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.
2016-11-01 01:32:02 -07:00
Soam Vasani 7d1058d7be Pool Manager -- manage generic containers and their specialization
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)
2016-11-01 01:32:02 -07:00
Soam VasaniandGitHub 0cbd489cbf Merge pull request #14 from platform9/fetcher
Fetcher is a helper for function run containers
2016-11-01 01:31:27 -07:00
Soam Vasani 95e38203a9 Fetcher is a helper for function run containers
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.
2016-11-01 01:29:40 -07:00
Soam VasaniandGitHub 9f34fc3dd9 Merge pull request #13 from platform9/cache
Cache -- simple threadsafe map
2016-11-01 01:28:27 -07:00
Soam Vasani 1c32ce19fe Cache -- simple threadsafe map 2016-11-01 01:26:12 -07:00
Soam VasaniandGitHub ac440ac99f Merge pull request #12 from platform9/packaging-etc
Change controller and router exports to make them usable as libraries
2016-10-29 23:48:38 -07:00
Soam Vasani fbd76149f5 Add exports to make router usable as a library 2016-10-29 20:40:41 -07:00
Soam Vasani 83c995e019 Don't crash on user function exceptions 2016-10-29 20:39:41 -07:00
Soam Vasani a93c17548c Add exports that make controller usable 2016-10-29 20:38:50 -07:00
Soam VasaniandGitHub ff3efa3434 Merge pull request #11 from platform9/api-version-urls
Add API version to URLs
2016-09-29 22:33:27 -07:00
Soam Vasani 012a8de1ec Add API version to URLs 2016-09-29 21:41:52 -07:00
Soam VasaniandGitHub 3177c035c6 Merge pull request #10 from platform9/nodejs-improvements
Nodejs improvements
2016-09-24 12:17:54 -07:00
Soam Vasani 5d76ee8894 Remove outdated comment 2016-09-24 12:17:08 -07:00