Commit Graph
46 Commits
Author SHA1 Message Date
Ta-Ching ChenandSoam Vasani 5f14b9b0ae Switch from ThirdPartyResources to CustomResourceDefinitions (#381)
Switch Fission's storage over to the new CustomResourceDefinitions, from the deprecated ThirdPartyResources. This allows us to be compatible with Kubernets 1.8 and onwards.

This also adds a CLI tool for dumping state from an old fission version and restoring state into new CRDs.

The storage service is unaffected by this change.
2017-11-04 14:55:16 -07:00
VishalandSoam Vasani 746c51901d Test functions 236 (#355)
A single CLI command to invoke a function, print results, and get logs if the function fails. Meant to be an easy way to do testing from the CLI.
2017-10-30 22:32:15 -07:00
Ta-Ching ChenandSoam Vasani a25c167d23 Update k8s client version to 4.0.0 (#351)
Move to client-go v4.0.0 from 1.5.
2017-09-29 07:37:36 -07:00
Soam Vasani e4d42797e6 set versions to 0.3.0 2017-09-28 23:44:53 -07:00
Soam Vasani d2f4be7a44 Set version to 0.3.0-rc 2017-09-26 23:35:08 -07:00
Ta-Ching ChenandSoam Vasani e587eca08f Add builder manager support (#308)
This change orchestrates function builds.

Environments (in v2) define a builder image, just like they do a runtime image. The builder image contains a build script that's invoked with source and deployment paths (as env vars).

The buildermgr watches for environments with build images defined, and creates build deployments and services.

Functions can define source and deployment. Buildermgr watches for functions with source code (and build status == pending) and invokes the environment's builder when appropriate. It captures logs from the build and sets the build status (success/failure) and build lots into the PackageStatus.
2017-09-25 07:53:09 -07:00
Ta-Ching ChenandSoam Vasani e56e6482b3 Fix missing checksum from CLI uploads (issue #342) (#343)
Archive upload from the CLI wasn't filling in the checksum field, causing validation to fail.
2017-09-22 12:27:42 -07:00
Soam Vasani e68872ba84 set versions to v0.2.1 2017-09-11 18:32:25 -07:00
Soam VasaniandGitHub 4287d14000 Upgrade tool for 0.1 -> 0.2.1 (#320)
Allows dumping v0.1 state to a json file and restoring it into a new v0.2.1 fission installation.

Usage guide is at: /Documentation/docs-site/content/upgrade-from-v0.1.md
2017-09-11 18:31:36 -07:00
Soam Vasani 98c2a0863f set version to 0.2.1-rc2 2017-09-10 00:36:50 -07:00
Soam Vasani 04eef11fce Set version to 0.2.1-rc in CLI, API and helm charts 2017-09-08 20:48:00 -07:00
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
Soam VasaniandGitHub 8d103fa35b Large functions: API proxy for storage svc, upload support in the CLI (#304)
This change contains CLI support for uploading large functions to the storage service.

It also adds a reverse proxy into the storage service to the fission API.

The helm chart is not yet updated to actually run the storage service -- that will come in the next change.
2017-08-31 15:42:59 -07:00
Ta-Ching ChenandSoam Vasani c03f1a6d9c Add env builder & srcpkg through cli (#296)
CLI support for specifying an environment builder and source packages.
2017-08-28 10:44:31 -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
Ta-Ching ChenandSoam Vasani 961ee069ed Set message content-type based on the trigger.Spec.ContentType (#279) 2017-08-17 10:30:24 -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
S. Brent FaulknerandSoam Vasani fe4015fab2 fix typo funtion -> function (#252) 2017-07-07 09:37:35 -07:00
Ta-Ching ChenandSoam Vasani e4fe007838 Add message queue trigger support (#218)
Adds support for message queue triggers based on the NATS-Streaming message queue.

This lets the user map a queue topic to a function, and optionally send the function's response into another queue topic.

The message queue trigger manager is designed to be message queue independent, so we should be able add support for more queues by adding implementations for the relatively simple mqtrigger.MessageQueue interface.
2017-07-05 17:19:58 -07:00
Ta-Ching ChenandSoam Vasani 5fe4b276eb Fission update must require at least one change to function (#241) 2017-06-26 22:22:09 -07:00
Ta-Ching ChenandSoam Vasani d9b98830cf Fix http response body not closed correctly, return immediately on error (#210)
* Fix controller timer handler not return when error occurred

* Fix controller not close http response correctly

This PR aims to fix controller not close response correctly. Also, I’ve check all over the project there is no more resource leak issues exist after this patch.

* Fix controller not return immediately when error occurred

* Sort import
2017-06-17 13:10:54 -07:00
Niko KurttiandSoam Vasani 93ef6fac53 Fix s/Sirupsen/sirupsen/ for logrus (#224)
Fix s/Sirupsen/sirupsen/ for logrus
2017-06-08 13:44:07 -07:00
Ta-Ching ChenandSoam Vasani 990d943f21 Retrieve function logs from controller (#207)
Establish a proxy server from the controller to the log database.

Redirect query commands send from client to database then proxy back the db response.

Use parameter binding instead of fmt.Sprintf to prevent SQL injection.
2017-05-30 14:19:22 -07:00
yang qfandSoam Vasani a8c6347ed0 Add Time Trigger API and client (#153) (#161)
This change adds a timer trigger API, client, and implementation.  Users can trigger a function with a cron-compatible string. 

This change also moves the publisher interface and webhook-based publisher implementation out of kubewatcher and into a separate `publisher` package.
2017-05-17 15:13:56 -07:00
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
maxwellandSoam Vasani b561f7d948 use fmt.Errorf instead of error.New() (#149) 2017-03-14 16:23:32 -07:00
Kaustubh Phatak 33f7647ea7 Fixing validations of fn actions 2017-02-05 12:51:52 -08: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
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
Andrew Stuart 1cc1fac151 Satisfy golint, clarify logic 2017-01-31 08:25:57 -07:00
Andrew Stuart 39fb45d8da bugfix (cli) Update the URL check to work with https 2017-01-31 08:11:54 -07:00
Soam Vasani e73242f85c Implement 'fission route update'
"fission route update" can now be used to update a route to point to a
different function.
2017-01-05 15:59:39 -08:00
J. Gavin Ray 943d430870 # This is a combination of 2 commits.
# This is the 1st commit message:

Changed package names to match the new organization

# This is the commit message #2:

Forgot Cache
2016-12-24 08:11:35 -08:00
Soam Vasani a5d96b928c Add HTTP route create params to function create command
This allows users to add --method and --url params to their "fission
fn create" command line.  It sets up the route to call the latest
version of the function; user can edit the route with the "fission
route update" command, if they want to.
2016-12-20 17:42:23 -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 f84827e384 Check for name in 'function delete' 2016-12-16 13:43:00 -08:00
Soam Vasani dddb50c00f cli watch impl 2016-12-16 00:54:06 -08:00
Soam Vasani 193cf594be Let fission CLI tolerate URL with/without leading http:// 2016-12-10 19:56:45 -08:00
Soam Vasani 2379cb6f81 Add watches to fission CLI 2016-12-10 19:55:43 -08:00
Sean JohnsonandGitHub 08da045f43 Fix environment command type. 2016-11-30 18:51:44 -06:00
Soam Vasani 1a19f718d4 Add a "fission function edit" command
The new command invokes editor on a copy of the source code, and
uploads the new source code.  It's an easy way to manually edit
functions from a terminal.
2016-11-15 15:51:47 -08:00
Soam Vasani fffba6fcf0 CLI improvements
Check for required args; allow "route add" as an alias for "route
create".
2016-11-07 10:42:16 -08:00
Soam Vasani 038037dded Set filestore path in deployment yaml 2016-11-07 10:41:55 -08:00
Soam Vasani ef7de75ec3 Minor cli option validation bug 2016-11-05 23:34:55 -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