Commit Graph
24 Commits
Author SHA1 Message Date
Ta-Ching ChenandSoam Vasani 8df520721c Add go vet check (#430)
* Add go vet check

* Replace go vet with go tool vet to avoid printing exit message
2018-01-22 09:28:16 -08:00
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
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 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
Ta-Ching ChenandSoam Vasani 46ff55ab49 Fix unstoppable kubewatcher (#208)
Fix a bug due to which watches could never be stopped; simplify control flow a bit.
2017-07-10 16:01:48 -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
Javier CastellanosandSoam Vasani cde2f26a9d Added support for pods and replication controllers to watchers (#216) 2017-06-01 10:49:57 -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
Soam Vasani 01b399187e Work around 'too old resource version' 2017-03-28 12:42:59 +02:00
Soam Vasani b4dd7a83df Better error checking in watch restarts 2017-03-28 12:06:07 +02:00
Soam Vasani 137d8f7285 Track resourceVersion from event objects 2017-03-28 10:01:11 +02:00
Soam Vasani c9f63e8173 Pass last resource version to restart watch 2017-03-28 10:01:11 +02:00
Soam Vasani a71756762b Restart watches when they stop unexpectedly 2017-03-28 10:01:11 +02:00
Soam Vasani bba71d65a2 Fix incorrect log printf 2017-01-23 19:49:13 -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 d721df998d Fix object-type header passed to event handlers 2016-12-20 14:16:33 -08:00
Soam Vasani c5425180e8 Make webhook publisher use relative urls 2016-12-20 12:19:51 -08:00
Soam Vasani 0456df0d63 Refactor kubewatcher/webhook publisher
Create a Publisher interface. Refactor webhook publisher to satisfy
that interface.

Add some limited retries to webhook publisher.
2016-12-19 14:38:44 -08:00
Soam Vasani de30886c9e compile error 2016-12-16 00:43:45 -08:00
Soam Vasani 215f4fc30f comments 2016-12-15 19:48:45 -08:00
Soam Vasani 53c49d1485 Add an atomic bool to track if a watch is stopped
Saw a watch channel close once without actually calling watch.Stop.
Need to investigate this a bit and handle it if necessary.
2016-12-15 09:34:03 -08:00
Soam Vasani 5c6dcca19d Pass obj type to functions 2016-12-12 08:46:19 -08:00
Soam Vasani ddb189bda2 Kube requests: add content-type 2016-12-10 19:54:01 -08:00
Soam Vasani fa093829bc Kubernetes events watcher
Kubewatcher watches the Kubernetes API for Watches that have been
configured on the fission controller.  It then posts that event to the
function configured in the watch.
2016-12-09 23:22:18 -08:00