Commit Graph
38 Commits
Author SHA1 Message Date
Soam VasaniandGitHub f2091d0d80 Move builds to package level (#297)
Introduce _Archives_ as a type to reference arbitrary blobs.

_Packages_ are a pair of Source and Deployment archives. Packages have an environment reference.

Functions reference a package. Multiple functions can reference the same package.
2017-09-08 14:19:39 -07:00
Moritz Grosch (LittleFox)andSoam Vasani 6142ac3648 Added perl environment (#311)
Perl runtime environment and example function.
2017-09-07 23:42:40 -07:00
Ta-Ching ChenandSoam Vasani 1b9fa5bc30 Unarchive zip file after fetcher downloads the package (#301)
Fetcher now uncompresses archive files. 

This is triggered by automatically detecting the file format, although maybe we should make that explicit or at least move the detection into the client.
2017-09-01 07:50:47 -07:00
Ta-Ching ChenandSoam Vasani 9d1b096bac Add Environment v2 Builder (#298)
Build server and client for environments.

This build server will run inside environment builders and invoke environment-specific scripts for doing builds. It provides a uniform language-independent API for builds to the fission build manager.

The change also includes an implementation of a builder for Python -- this "builder" acts on requirements.txt and runs `pip install` to collect all function deps.
2017-08-31 10:56:40 -07:00
Soam VasaniandGitHub d83c89df69 Storage service and client (#300)
A very rudimentary storage service for archives larger than what can
fit in TPR/CRD resources. The library used allows for using local
files, AWS S3, or other cloud storage APIs. For now only local paths
are set up.

The storage service doesn't know anything about functions or packages;
it can be used for arbitrary archives.

There's no CLI integration yet.
2017-08-31 00:44:25 -07:00
Soam VasaniandGitHub 6f017cf400 Split out the Package type into a first class Kubernetes resource (#295)
Split out the Package type into a first class Kubernetes resource. Before this change, packages were implicitly tied to functions.

This wasn't ideal because:
 * Functions will need to share packages
 * A package storage system may be more generally useful than just
   functions (for example, for storing static assets)

This change does the following:
* Updates the fission and tpr types to add a new Package and PackageSpec.  It also creates a PackageRef type, and a FunctionPackageRef type. The PackageRef simply references a package, but the FunctionPackageRef includes the name of a function within the package. This allows us to share packages between different functions.
* Updates fetcher and other components for first-class packages
* Allows customization of fetcher image pull policy in the helm charts
2017-08-25 13:40:45 -07:00
Soam VasaniandGitHub e238776bf7 V2 types and TPR (#266)
This changes the core fission function, environment and trigger types. It also changes Fission's storage to use ThirdPartyResources.

 - Functions are now specified by packages. Functions can also have both source and deployment packages. A package can be specified by a literal, or by a URL.
 - Environments have a build and runtime component.
 - Triggers reference functions by a FunctionReference. This is a layer of indirection between triggers and functions, and will allow things like incremental function upgrades in future releases.

See Documentation/wip/env-v2.md for design discussion about points 1 and 2.

Changes:

* V2 Types

All types now have a spec, following the pattern of K8s objects.

Functions now have source and deployment packages. A Package can be
specified by literal, or by URL.

Environments now have a builder and runtime component.

All triggers use a new FunctionReference to specify the function. This
for now only uses a function name, but in the future can be extended
to be more flexible.

A new FunctionLoadRequest type is added for specialization requests to
the environment runtime.

* TPR types, TPR init code, and a "fission client"

Implements TPR types using the spec types in fission/types.go.

Adds code for adding creating TPR types, and convenient types for crud
operations on each of our resource types.

Adds code for connecting to K8s API and configuring a REST client with
fission types set up.

* Change old stateful controller into a thin apiserver

This apiserver is now simply a stateless api layer on top of the TPR
types. At the moment it doesn't do anything that couldn't be done by
simply talking to the TPR types. In the future we can have better
validation and potentially some higher level APIs (like versioning for
example) in here.

* Split controller client into files and update for v2 types.

* Update CLI for v2 types.

As far as possible we keep the CLI flags the same. We'll have to add
flags for source/deploy packages and builder/runtime
environments. That will come in the next change.

* Update poolmgr and fetcher for v2 types.

Also adds a poolmgr_test.

* Update router for new types.

Also adds a function reference resolver, which separates out the job
of resolving a FunctionReference to a function.

* Update kubewatcher and timer for v2 types.

* Update Message Queue trigger type for v2 types.

* Minor odds and ends.

* Fission bundle CLI updates

Remove controllerUrl flag, since we don't need it any more.

* Remove etcd deployment (replaced by storing state in TPR)

Also update the poolmgr commandline, and use an env var for the
fetcher image URL.

* Explicit ChecksumType and consts

* Clarify separation of environment interface types
2017-08-05 01:18:30 -07:00
Erwin van EykandSoam Vasani 85983c91cd Binary Environment (#256)
Adds a fission environment for arbitrary linux binaries.
2017-07-26 12:29:54 -07:00
S. Brent FaulknerandSoam Vasani 51c84f3cfc Ruby logger (#251)
* Add logger for ruby environment

* Update readme and example for ruby logger

* ruby-env: log load time for user code
2017-07-07 18:05:11 -07:00
S. Brent FaulknerandSoam Vasani 0fd60eab3b include path parameters in params hash for ruby environment (#249)
* include path parameters in params hash for ruby environment

* Improve code organization and documentation for ruby environment.

* Document Ruby examples
2017-07-04 23:44:18 -07:00
S. Brent FaulknerandSoam Vasani a8e7ec534b Add Ruby environment (#223)
Adds a Ruby environment and examples.
2017-06-17 10:48:05 -07:00
Soam VasaniandGitHub 0207d13b23 Specify full golang version in Dockerfiles and build helper script (#227)
Addresses #222.

Plugins and the binaries loading them need to be built with the exact
same go version.

Also update README instructions.
2017-06-09 15:36:09 -07:00
syassamiandSoam Vasani 1abe961869 Lighten up the python3 base image (alpine) (#171)
Saves 241 MB from the base example image, bringing things down to 242MB in total.
2017-04-21 11:15:52 -07:00
Soam VasaniandGitHub a6eb4c6d31 Go build helper script (#163)
Create a docker container and a script to call it, to help people build go plugins for use with fission.
2017-03-27 23:26:59 -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
Soam Vasani a390c1baa8 Bugfixes in nodejs environment server and examples 2017-03-19 19:36:00 -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
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 d0ad377d72 Add README to NodeJS env 2017-02-08 16:43:19 -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
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
Klavs Madsen 760e021141 Added basic logging, just a facade for now
Added FissionContext class
Changed name on both class and function for input code to avoid namespace clashes when adding FissionContext
Updated README
Added section on how to develop/debug the code to README, might be obvious for some but not all
Changed code input from static function to method
2017-01-22 15:45:08 +01:00
Klavs Madsen f5270d97b1 Added support for running C# code in a dotnet core environment 2017-01-21 13:57:45 +01:00
Soam Vasani e0c7682996 Improve environment doc 2017-01-18 16:59:39 -08:00
Soam Vasani 4f9b36b042 Add README to python env 2017-01-18 16:53:03 -08:00
Soam Vasani 9ffba72c11 Add redis client to python env 2017-01-17 23:42:05 -08:00
Soam VasaniandGitHub f0b31564f0 Merge pull request #56 from platform9/kubewatcher
Kubewatcher: trigger functions from Kubernetes Watch callbacks
2016-12-20 14:30:32 -08:00
Soam Vasani 5e3adc0b59 Log on function exception 2016-12-11 19:58:04 -08:00
Kaustubh Phatak cfd503af8b removing stevedore and websocker-client libs from python env 2016-12-08 15:42:19 -08:00
Kaustubh Phatak 01249c2d4a adding commonly used python libraries 2016-12-08 15:27:04 -08:00
Soam Vasani 5f02f6c8ca Setup app logger in python environment
The user's functions can now use `current_app.logger`, and use
`kubectl logs` to see the logs that the function outputs.
2016-12-08 14:03:27 -08:00
Soam Vasani 640e65f35f Use Flask for Python environment
Flask gives us easy routing support, and simple interface for getting
at request data.
2016-11-19 20:04:46 -08:00
Soam Vasani 8a9559be1f Pass a valid context 2016-11-19 11:01:28 -08:00
Soam Vasani 1a86078fc0 Very rudimentary Python support
Create a python environment.  Only supports GET; doesn't support any
parameters etc. yet.  Basically just enough for a hello world demo.
2016-11-09 10:02:03 -08:00
Soam Vasani ddf279ed7d Add some useful packages to nodejs env 2016-11-07 10:41:29 -08: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