Commit Graph
30 Commits
Author SHA1 Message Date
smruthi2187andGitHub fa565b75ae Canary deployments for fission functions. (#892) 2018-09-25 18:26:26 -07:00
Nafisa ShaziaandTa-Ching Chen 74a3a54543 Recorder CRD, Records API, Redis deployment (#818) 2018-08-15 05:28:40 +08:00
xiekeyangandSoam Vasani 3707b95edb Round Tripper of Fission Router: parameters be configurable (#713)
The Round Tripper parameters of timeout, keep alive time and Max retry
times is configured in router system environment.

And they are set to Round Tripper when router service initializing.

This setup new nested structure `tsRoundTripperParams` to transfer them.
2018-07-12 12:08:52 -07:00
smruthi2187andGitHub 9daf97a9ab router tracks function liveness before forwarding request (#701) 2018-07-03 15:51:52 -07:00
VishalandGitHub 7642dcf05f Disable caching of connections from router to function pods (#742)
A temporary fix for #723 which needs to be optimized in future. Disables caching of connections from the router to function pod/service.
2018-06-21 12:45:11 +05:30
Soam VasaniandGitHub d846aed612 Fission metrics integration (#677)
Add prometheus metrics collection endpoints to router and executor. Add prometheus annotations to router and executor pods.
2018-05-21 13:57:18 -07:00
smruthi2187andGitHub 12299df811 Prevent releasing idle connections because transport is shared. (#609)
The transport in RoundTripper is the default transport and there's just one object shared between different http requests and releasing the idle Connections ended up releasing the idle connections that were established with the executor service address too.

So every time a http request was made to get a service for function, the transport layer ended up having to dial a new connection (that was timing out due to various reasons).

By removing the CloseIdleConnections, we minimize the need for transport to dial a new connection to executor for every request, thereby minimizing the occurrence of dial timeouts.
2018-04-06 13:23:25 -07:00
smruthi2187andGitHub 8014c83b02 Invalidate stale router cache entry with podIP's for deleted pods. (#546)
The router's cache entry for a function might become stale if the pod that had the function specialized gets deleted somehow. In such a case, we'd retry getting a new service for the function from executor and retry forwarding the user request to the newly created service.
2018-04-05 13:47:47 -07:00
Wang GuoliangandTa-Ching Chen b578819202 Optimize code 2018-01-24 13:43:51 +08:00
Ta-Ching ChenandSoam Vasani 43fea01bd9 Overwrite request host with internal host to prevent request rejection (#419) 2017-11-30 23:58:14 -08:00
VishalandSoam Vasani da820186f0 Executor abstraction (#384)
This change adds a layer of abstraction over poolmgr. Poolmgr is now just one of the ways to turn a function into a service; other implementations will be added. The executor abstraction is a uniform API over all these implementations.

* Executor layer added on top of pool manager

* Removed the external server for executor

* Minor changes to keep existing semantics as much possible

* Separating the executor vs. poolmgr backend functionality and associated data members

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed references to poolmgr in tests

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Executor layer added on top of pool manager

* Executor logic separated from Poolmgr backend completely, placeholder for new backend

* Changed podName to a generic objectReference in fscache (#391)

Changed podName to a generic objectReference in function service cache implementation.

* Moved poolmgr to it's package, as a side effect moved Cache to its's package (was causing cyclical dependency) and had to make some data structures exposed outside package

* Rebased from master and changed references to tpr -> crd

* Merged from master with latest changes

* Removed stale executor service & deployment from previous merge

* Addressed review comments, still testing some areas
2017-11-20 20:51:14 -08: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
Erwin van EykandSoam Vasani 33f967b61b Fission workflow env integration (#336)
Add a flag to the environment to control multiple specialization -- the max number of functions per container. This can be set to 1 or infinity. 

Add an api proxy to workflow apiserver from the controller.

Add function metadata to FunctionLoadRequest; every v2 environment now knows which function it's loading (but can ignore that information if it wants to).

Add function identity headers to router. This is useful for multiple specialization, so the router can disambiguate between different function calls. (If this turns out to be a non-trivial perf overhead, we could add these headers conditionally, but for now they are always added.)
2017-09-26 18:36:07 -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
yang qfandSoam Vasani b1e66663bd Retrieve URL params in functions (#226)
Addresses #158. Adds URL params into HTTP headers. A URL param named `KEY` with the value `VALUE` in the actual URL will appear as the header "X-Fission-Params-KEY: VALUE" in the fission function.
2017-06-17 21:12:12 -07:00
yang qfandSoam Vasani c1dd8a9f35 Aggregate tap service request in interval (#229)
The poolmgr client now aggregates successive tapService() calls and sends them to the poolmgr service every 5 sec, instead of sending them immediately.
2017-06-17 20:58:10 -07: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
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 f639bc3558 Use fission.Cache for functionServiceMap 2016-11-04 23:05:29 -07:00
Soam Vasani f3eba4b825 Call poolmgr from router while using a cached service
Poolmgr needs to know usage statistics for a function's pod.  This
change asynchronously taps poolmgr API when router uses a service.
Poolmgr can use this information to control pod expiry.  It may also
be useful later as one of the metrics for autoscaling.
2016-11-04 23:05:29 -07:00
Soam Vasani 59cc772b89 Add retries to router's proxy
Create an implementation of http.RoundTrip which does retries --
RetryingRoundTripper.  K8s services seem to timeout for about ~1-2 sec
after they're created even when the pods being routed to are ready to
serve requests.
2016-11-03 14:59:41 -07:00
Soam Vasani 1b76cdf200 Remove request path when routing
Route all requests to / on the function run container.  It doesn't
need to do any routing since it has only one function.
2016-11-03 10:11:43 -07:00
Soam Vasani 4cd3e65692 Another bug due to initialization/assignment confusion 2016-11-02 22:42:43 -07:00
Soam Vasani af8e5f360f Don't put internal fission error details in responses 2016-11-02 16:07:07 -07:00
Soam Vasani 3d5e52dc3d Router integration with poolmgr and controller
Router uses poolmgr to specialize pods when necessary.

Router uses controller to get the list of triggers to listen for.  For
now this integration is pretty crappy -- we just poll the controller
every few seconds and cache the result.  The right way would be to
have some sort of watch API on the controller and use that.  Or maybe
share access to etcd directly.
2016-11-01 18:22:04 -07:00
Soam Vasani fbd76149f5 Add exports to make router usable as a library 2016-10-29 20:40:41 -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 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 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