Commit Graph
337 Commits
Author SHA1 Message Date
Ta-Ching ChenandSoam Vasani a13015e75a Add function logs support (#53) (#131)
Add function log aggregation and persistence using Fluentd and InfluxDB.

Fluentd and a helper sidecar run as a daemonset.  The poolmgr sets up logging for each function pod, using the helper sidecar. Fluentd forwards logs to InfluxDB, which is run as a deployment and service. The client CLI directly queries InfluxDB for logs.

Fluentd supports many outputs besides InfluxDB, so we aren't very tied to InfluxDB.

The setup is somewhat manual, which we should be able to improve by integrating this into the helm chart.

Diagram of component interactions: https://cloud.githubusercontent.com/assets/202578/23100399/b0e3ea00-f6ba-11e6-8f2f-6588cfef2e84.png
2017-03-22 15:59:42 -07:00
Valentin TjonckeandSoam Vasani 1665235c14 Golang runtime (#125)
Minimal golang runtime.  

Functions are built as Go plugins, and the plugin is uploaded to fission.

See `environments/go/README.md` for instructions and `examples/go` for a usage example.

For now, we're re-using the 'code' field of the function to store the binary plugin. With v2 environments, this will be stored separately as a binary package.
2017-03-21 17:13:29 -07:00
Lingxian KongandSoam Vasani a3f8016442 Set correct Content-Type in the http response (#147)
When the request is handled successfully, json data is returned, this
patch changes the response Content-Type header from text/plain to
application/json

Fixes: #144
2017-03-21 13:51:54 -07:00
Soam Vasani a390c1baa8 Bugfixes in nodejs environment server and examples 2017-03-19 19:36:00 -07:00
J. Gavin RayandGitHub b5b10a4a27 Merge pull request #157 from fission/travis-go-18
Drop Go 1.7, use Go 1.8
2017-03-16 09:25:19 -07:00
Soam Vasani aa77d8686f Drop Go 1.7, use Go 1.8 2017-03-16 09:18:49 -07:00
Robert HerholdandSoam Vasani 68c006cd33 Add README for Node.js examples (#155) 2017-03-14 17:32:13 -07:00
maxwellandSoam Vasani b561f7d948 use fmt.Errorf instead of error.New() (#149) 2017-03-14 16:23:32 -07:00
Robert HerholdandSoam Vasani 9bdaf3c74e Upgrade node environment to Node.js 7.6.0+ (#151)
Upgrades the node environment to NodeJS 7.6.0.  Functions can now use async/await and promises; they can return a promise instead of using a callback.  The change preserves compatibility with the callback style.  

* Upgrade node environment to Node.js 7.6.0+

* Bump package version

* Preserve compatibility for callbacks

* Cleanup

* Re-add hello callback example

* Make sure not returning won't blow everything up

* Update stock example with request promise
2017-03-14 16:00:26 -07:00
Robert HerholdandSoam Vasani e1cb5f6e09 Return HTTP status 201 for created resources (#148)
Have the controller return status 201 for created resources, and have the client check for 201 response on created resources.

#143
2017-03-12 20:05:19 -07:00
yang qfandSoam Vasani a6869ab746 Fix function delete with uid (#142)
If no uid is provided, all versions of function files and function metadata will be deleted.  If a uid is provided, only that specific version is deleted, and the "latest" version of the function moves back to the previous one.

Fixes #152
2017-03-12 13:04:56 -07:00
Robert HerholdandSoam Vasani 365eabb027 Make it more clear where to clone this repo (#145)
Make it clear that the repo should be cloned into the $GOPATH.
2017-03-08 15:30:41 -08:00
Ta-Ching ChenandSoam Vasani ad63ba63c8 Fixed pod has no ip (#139) (#141)
Fixes #139.  The code before this change was saving up pointers to the loop variable in a slice. So loop was useless and we always chose the last pod in the list, whether it was ready or not.  With this fix, choosePod should always return a ready pod.

Also adds a check for the pod phase, before looping over the containers in the pod, and discard pods that aren't running yet.
2017-03-05 11:01:47 -08:00
Simon DittlmannandSoam Vasani 6af605bfe8 fix kubeEventsSlack example: typo and wrong variable name (#140)
- change comma to semicolon
- change variable name `path` to `slackWebhookPath`
2017-03-04 14:08:23 -08:00
Robert HerholdandSoam Vasani 4d16a4be08 Fix Markdown table (#136) 2017-03-02 11:35:59 -08:00
Robert HerholdandSoam Vasani 6e5b1cf8db Ignore the vendor folder (#137) 2017-03-02 11:33:11 -08:00
Soam VasaniandGitHub ca3bf8e83e Symlink user function's node_modules to server's node_modules (#133)
Fixes #132
2017-02-23 10:19:42 -08:00
Soam Vasani 92cd5334ec Add a default handler for the / route
Before this change, if the user doesn't define a route for /, the
router happily 404s at that path.  This breaks GKE Ingress, which uses
that request as a health check.  So this change adds a handler for
"GET /", unless the user already has one.

Also, log the delay for slow requests.
2017-02-20 23:57:40 -08:00
Sanket SudakeandSoam Vasani f4b6558e79 Remove redundant hello.js from charts directory (#130) 2017-02-20 15:14:56 -08:00
Soam Vasani 3b75a86773 Instructions in the README were leading to a malformed file
Switch to using a curl command to download sample code, instead of
dealing with nested quotes and stuff.

Addresses #128.
2017-02-17 15:34:02 -08:00
Soam VasaniandGitHub 8cf382c2b3 Handle errors in filestore init (#127)
Fixes issue #108
2017-02-17 15:21:36 -08:00
Toby CrawleyandSoam Vasani ab6e2e8021 Improve command-line client error output (#122)
Motivation: The output when an error occurs shows an integer error code,
which isn't very helpful. And in the case of an error when creating a
resource, you also get a redundant log message from the controller
client.

Modifications:
* the controller client no longer logs errors
* the generated String() allows for the enum name to be displayed in the
  error output
* each errorCode enum member has a hand-generated description
* the format of the error message from the CLI client was modified to
  display the error description with the error message

Related to #112
2017-02-16 13:58:59 -08:00
Soam Vasani eae5150bff Initial test script
Test script that sets up fission on a cluster, runs tests and
uninstalls it.

Yet to come:

1. The actual tests
2. Builds (for fission-bundle, client, and envs)
3. Automation with github pull requests
2017-02-16 12:55:38 -08:00
Soam Vasani d4dc166039 Use Helm's built-in support for namespaces
Remove our non-standard namespace variable and use .Release.Namespace
to put fission deployments and services into.

(We still need the functionNamespace parameter, to customize what
namespace fission puts functions into.)
2017-02-16 12:01:26 -08:00
Soam Vasani 41baa7b6bf Add fission and fission-function namespaces to template variables
Also, update readme.
2017-02-16 11:08:47 -08:00
Soam Vasani 6e4115cb5d Update use cases, talk a bit about implementation 2017-02-15 11:21:51 -08:00
Kaustubh PhatakandSoam Vasani 9e5db82cc9 Check for unique HTTP route & method (#102) (#111)
Check for uniqueness in HTTP routes, returning error 409 when a route + method combination is duplicated.
2017-02-13 15:58:19 -08:00
Matt RickardandSoam Vasani 6be861afc8 Upgrade minikube version in docs to v0.16.0 (#120) 2017-02-13 14:17:33 -08:00
Toby CrawleyandSoam Vasani 430639a1cf Report KeyNotFound from etcd as a 404 (#121)
This allows for proper classification of the error on the client side.
2017-02-13 13:16:12 -08:00
Toby CrawleyandSoam Vasani c8b5bb2972 Better convey duplicate name errors to client (#116)
Motivation: Creating duplicate resources currently results in a 500
error being displayed by the client, with no information about the true
nature of the failure.

Modifications:
* ResourceStore now converts any errors from the etcd client into
  fission errors, capturing the reason for the error in the case of a
  duplicate key (as ErrorNameExists)
* ErrorNameExists errors are signaled to the client with a
  409 (Conflict) HTTP status
* MakeErrorFromHTTP() now reads the body of the error response to
  retrieve the actual error message instead of using the HTTP status
  message
* the controller client now uses MakeErrorFromHTTP() to centralize
  status code -> error code mapping
* tests for all of the resources now check that duplicate resources are
  reported properly

Result: The client can now provide more context when a duplicate name is
given

related to #112
2017-02-13 08:58:52 -08:00
Sanket SudakeandSoam Vasani 99d6a95bc1 Helm chart for fission (#90)
Helm Chart for Fission.  See NOTES.txt for usage.
2017-02-12 00:13:24 -08:00
Ta-Ching ChenandSoam Vasani 14c55912f5 Fix failure to delete function when function's file doesn't exist (#118) 2017-02-10 23:38:13 -08:00
Soam VasaniandGitHub 858fe9f62b Merge pull request #117 from tobias/gitignore-updates
Update gitignore to include dev artifacts
2017-02-10 14:10:50 -08:00
Toby Crawley 25afe7bd78 Update gitignore to include dev artifacts 2017-02-10 13:53:46 -05:00
Soam VasaniandGitHub 3420a614bb Merge pull request #114 from fission/issue-113
Don't wait for ready pod in MakeGenericPool
2017-02-09 16:27:17 -08:00
Soam Vasani d4d917ad04 Don't wait for ready pod in MakeGenericPool
Addresses issue #113.  poolmgr.MakeGenericPool does not need to wait
for a ready pod.  Kubernetes already retries image fetching, so
there's no need to repeat the task in fission.  And if it's a
non-retriable error (like the image URL being wrong), then the
deployment will stay broken, and the user can fix the environment with
'fission env update' (or 'fission env delete' followed by 'fission env
create').
2017-02-09 15:27:57 -08:00
Soam Vasani d0ad377d72 Add README to NodeJS env 2017-02-08 16:43:19 -08:00
Soam VasaniandGitHub 4046c811b1 Merge pull request #109 from tobias/build-sh-as-sh
Make build an actual sh script
2017-02-06 18:02:25 -08:00
Soam VasaniandGitHub 8127a1f57f Merge pull request #110 from tobias/readme-updates
Minor improvements to build instructions in README
2017-02-06 18:01:23 -08:00
Toby Crawley 20cac31635 Minor improvements to build instructions in README 2017-02-06 15:33:46 -05:00
Toby Crawley fd07a8a75e Make build an actual sh script
This allows it to be executed from alternative shells (fish, for
example).
2017-02-06 15:28:46 -05:00
Soam VasaniandGitHub 0d4d2e32a8 Merge pull request #106 from kaustubhvp/fix-func-validations
Fixing validations of fn actions
2017-02-06 09:12:43 -08:00
Soam VasaniandGitHub 436057e15b Merge pull request #105 from ktrance/master
Http request support
2017-02-06 09:12:00 -08:00
Kaustubh Phatak 33f7647ea7 Fixing validations of fn actions 2017-02-05 12:51:52 -08:00
Klavs Madsen a1d255f038 Added usage examples
* Cleaned up project.json

* Updated README with example on how to deserialize json request body

* Added reference to System.Runtime.Serialization.Json as this would seems a common usage

* Added C# example files to the /Examples directory
2017-02-05 12:57:49 +01:00
Klavs Madsen c9ea73786b Http request support
Added support for accessing basic http request information
2017-02-04 17:58:03 +01:00
Kaustubh PhatakandSoam Vasani 76d4ea7b04 function code download using HTTP URL (#100)
* function code download using HTTP URL

* Addressing review comments

* Updating help-text for function
2017-02-02 15:14:00 -08:00
Damien GoujardandSoam Vasani 2725da6b1b Add initial support for PHP7 (#97)
* Add initial support for PHP7

* Update PHP env with now an PSR3 logger (Monolog). Now you can also create a handler function with PSR7 Http message and PSR3 logger in parameter.

* Add examples for PHP7 environement

* For development you can create a function in this path /app/userfuncdev.php it will be loaded

* Switch to alpine base image

* handler now receive an array with request, response and logger object
2017-02-02 11:28:28 -08:00
Laurent CrisciandSoam Vasani c353e7f230 Error when env name/image not provided (#98)
I also renamed image to envImg for consistency
2017-02-02 10:23:16 -08:00
Soam VasaniandGitHub 7b58ef389d kubewatcher example: send watch updates to slack (#96)
This example sends change events from a watch to a Slack webhook.
2017-01-31 12:23:45 -08:00