Commit Graph
52 Commits
Author SHA1 Message Date
Soam VasaniandGitHub d836be88da Merge pull request #8 from platform9/controller-environment-api
API for environments
2016-09-21 23:47:35 -07:00
Soam Vasani 6b67bc0a61 API for environments
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.
2016-09-21 22:29:51 -07:00
Soam VasaniandGitHub 80e73f7f09 Merge pull request #7 from platform9/controller-httptriggerapi
Add HTTP trigger API and client
2016-09-21 17:10:12 -07:00
Soam Vasani f7757bdcc1 Add HTTP trigger API and client
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.
2016-09-21 15:56:29 -07:00
Soam Vasani fee2fb1d70 Helper func to connect to etcd 2016-09-20 21:58:53 -07:00
Soam Vasani 16a75c8887 Remove call to the validator function
(This will be better handled in a higher layer.)
2016-09-20 10:51:44 -07:00
Soam VasaniandGitHub d88e9837a3 Merge pull request #5 from platform9/controller
Controller
2016-09-20 00:58:13 -07:00
Soam Vasani 641cae0206 Fission error type 2016-09-20 00:55:31 -07:00
Soam Vasani 39ef1da415 Key methods for Resource types 2016-09-20 00:55:13 -07:00
Soam Vasani f02f58cd12 Controller API unit tests 2016-09-20 00:54:26 -07:00
Soam Vasani 72ff031624 Controller API client.
Just Functions so far.
2016-09-20 00:53:57 -07:00
Soam Vasani 14734f6435 HTTP API for Functions
So far, just Function create/read/update/delete/list.  FunctionApi
glues HTTP request/response to functionStore.
2016-09-20 00:45:13 -07:00
Soam Vasani be16c6a2aa Minor stuff: debug logs, unit test update 2016-09-20 00:44:19 -07:00
Soam Vasani a0cfadbd73 Fix deleteFile (missing deletes for etcd metadata)
Also move resource and serializer interfaces to types.go
2016-09-20 00:25:50 -07:00
Soam Vasani 66854ff286 Add fission.Error type; add JSON annotations 2016-09-20 00:16:15 -07:00
Soam Vasani 7963d7527c Wrap resourceStore for Functions, HTTPTriggers and Environments
FunctionStore uses fileStore for function code and resourceStore for
the Function's metadata.  Environment- and HTTPTrigger- Store are just
thin wrappers on resourceStore.

There is probably a better way to organize this code, maybe with
reflection.
2016-09-20 00:12:21 -07:00
Soam Vasani 94899a88a7 Some sort of generic etcd-backed store
- A generic Resource interface, which is serializable and has
  a key() method to get an identifying key.

- A resourceStore, which has create, read, update, delete and list.
  This wraps etcd key operations and serialization/deserialization in
  a convenient service.  Serialization is provided to the
  resourceStore as a 'serialization' interface.  This can be JSON or
  anything else.

- The resourceStore also has file operations -- this has read, write
  and delete operations.  The general idea is to store metadata in
  etcd and data on the fileStore (which could also be an object store,
  we don't really use any file-specific properties).  Files are also
  versioned -- each writeFile writes to a new UUID and that UUID is
  stored in an etcd in-order list.  readFile can retrieve an arbitrary
  version by UUID, or just get the latest contents.
2016-09-10 01:01:27 -07:00
Soam Vasani 5c336043db Move /src/controller/ to /controller 2016-09-10 01:01:27 -07:00
Soam Vasani 60de12dfce Add delete command to fileStore 2016-09-10 01:01:27 -07:00
Soam Vasani 6ea465c67c Simple single-threaded file store service
Intended for storing function source code.
2016-09-10 01:01:27 -07:00
Soam Vasani 732634b53c Define main resource types
Functions, HTTPTriggers, Metadata, Environment.  Update the router to
use fission.Metadata, not fission.Function, to identify functions.
2016-09-10 00:59:39 -07:00
Soam VasaniandGitHub 405dd6fa0f Merge pull request #6 from platform9/top-level-package
Move some fission structs to top level package
2016-09-09 15:10:09 -07:00
Soam Vasani fb08d98037 Move Function and HTTPTrigger types to top level 'fission' package 2016-09-09 15:04:15 -07:00
Soam Vasani 796a9810a4 Capitalize type names to prepare for moving them to the top level package 2016-09-09 14:39:31 -07:00
Soam VasaniandGitHub 67ce88ebcc Merge pull request #4 from platform9/move-to-root-dir
Move packages to root dir from src/
2016-09-07 14:08:56 -07:00
Soam Vasani 2aa4c58556 Move packages to root dir from src/
This is supposed to work slightly better with go import paths. I think.
2016-09-07 14:07:26 -07:00
Soam VasaniandGitHub 3cd3dc37e1 Merge pull request #3 from platform9/router
Router, initial merge.

This doesn't yet talk to the Controller or PoolManager APIs.
2016-09-07 14:01:46 -07:00
Soam Vasani 993130d36b Router unit test 2016-09-07 14:00:18 -07:00
Soam Vasani b03e7bad2d HTTP trigger set
This is currently:
 1. A list of http triggers
 2. A method to generate a mux router from that list

This will be in the future:
 1. A way to keep the set of triggers up to date, by watching the controller API
 2. A way to update the router when the trigger set changes
2016-09-07 13:41:26 -07:00
Soam Vasani 8c56818e0a apply gofmt 2016-09-01 16:32:32 -07:00
Soam Vasani 2c872642f3 Put it all together 2016-09-01 14:38:47 -07:00
Soam Vasani 865a60110f Rename mutablemux updateRouter method 2016-09-01 14:37:33 -07:00
Soam Vasani 322ca405f6 Verify request success while testing http requests 2016-09-01 14:34:56 -07:00
Soam Vasani 9bd586ce61 Include PoolManager URL in function handler state and initializer 2016-09-01 14:34:33 -07:00
Soam Vasani 53eeff3c44 Build test utils only in 'go test' 2016-08-31 11:00:42 -07:00
Soam Vasani 2b0b2e28ae HTTP Handler for functions
The function handler will be the handler for each http trigger.  It
will look up the function service map to find a service for the
function (and call the pool manager to create a new service if one
doesn't already exist, though this isn't implemented yet).  It'll then
proxy the request to the service.
2016-08-30 16:41:16 -07:00
Soam Vasani a33f4e48e9 Simplify test a bit 2016-08-30 16:40:20 -07:00
Soam Vasani b9b7f9bbfc Function service map: cache parsed URLs instead of strings 2016-08-30 16:39:39 -07:00
Soam Vasani d990a0b9af Function (name, uid) -> service URL map
Concurrency-safe mapping from a function's (name, uid) identifier to a
URL.  This will be used to look up the service URL associated with a
given function.
2016-08-29 15:31:53 -07:00
Soam Vasani 828fa5f88c Fix test shutdown
Mutable mux test occasionally panics because the server is shut down
before the client goroutine.  Fix this by shutting down the client
goroutines before shutting down the server.
2016-08-29 15:30:04 -07:00
Soam Vasani ad961d4f4d Wrapper around mux to allow runtime route changes
We want to be able to update routes without restarting the http
server.  mutableRouter is a very thin wrapper around
github.com/gorilla/mux that enables safely switching to a new mux
router without pausing requests.
2016-08-26 13:50:51 -07:00
Soam VasaniandGitHub a45ec1448c Merge pull request #2 from platform9/nodejs-function-run-container
NodeJS Function Run Container
2016-08-24 13:52:07 -07:00
Soam Vasani 12f6a93352 Test other http verbs: get, put, post, delete, options, trace, head. 2016-08-24 13:49:45 -07:00
Soam Vasani 0ea5e2b05e Remove unused dependency
And we aren't using the 'start' command either.
2016-08-24 13:18:43 -07:00
Soam Vasani 7a316b14e6 Use require instead of eval to load user code 2016-08-24 13:10:35 -07:00
Soam Vasani 337843f5bc Test script bugfix 2016-08-24 13:10:17 -07:00
Soam Vasani 076b57c50a A very rudimentary test script
We should have real tests with mocha/chai etc. Until then, use this
little bash script.
2016-08-24 11:56:49 -07:00
Soam Vasani ef04ff83cb Use const where appropriate.
And log errors to stderr instead of stdout.
2016-08-24 11:55:40 -07:00
Soam Vasani 67be5a7b10 NodeJS Function Run Container
First cut of a function run container for NodeJS. So far, just the
simplest stuff: loads a user function and routes requests to it. The
user function is assumed to be in a file at a provided location. The
fission runtime is expected to place the file there securely (exactly
how we'll do that is TBD).

Doesn't handle path template params, query strings, etc. Will also
need to be extended later with some sort of hook for graceful
shutdown.
2016-08-23 17:23:20 -07:00
Bich C. LeandGitHub be0556f5e0 Merge pull request #1 from platform9/initial-documentation
Initial docs commit
2016-08-22 09:02:49 -07:00