Commit Graph

536 Commits

Author SHA1 Message Date
Travis Reeder
8800ecc5c2 Merge branch 'func_logs2' into 'master'
Func logs feature

See merge request !66
2017-06-20 11:51:26 -07:00
Travis Reeder
8c96d3ba2f Fixes async payload passing for #68. 2017-06-20 11:32:51 -07:00
James
8a3edb8309 All of the changes for func logs 2017-06-19 11:38:11 -07:00
Reed Allman
161459192d Id gen suga 2017-06-19 10:40:26 -07:00
Travis Reeder
9a8ff408b5 Fixes scary output on docker startup. 2017-06-15 15:48:34 -07:00
Reed Allman
75c5e83936 adds wait time based scaling across nodes
this works by having every request from the functions server kick back a
FXLB-WAIT header on every request with the wait time for that function to
start. the lb then keeps track on a per node+function basis an ewma of the
last 10 request's wait times (to reduce jitter).  now that we don't have max
concurrency it's actually pretty challenging to get the wait time stuff to
tick. i expect in the near future we will be throttling functions on a given
node in order to induce this, but that is for another day as that code needs a
lot of reworking. i tested this by introducing some arbitrary throttling (not
checked in) and load spreads over nodes correctly (see images). we will also
need to play with the intervals we want to use, as if you have a func with
50ms run time then basically 10 of those will rev up another node (this was
before removing max_c, with max_c=1) but in any event this wires in the basic
plumbing.

* make docs great again. renamed lb dir to fnlb
* added wait time to dashboard
* wires in a ready channel to await the first pull for hot images to count in
the wait time (should be otherwise useful)

future:
TODO rework lb code api to be pluggable + wire in data store
TODO toss out first data point containing pull to not jump onto another node
immediately (maybe this is actually a good thing?)
2017-06-09 16:30:34 -07:00
Reed Allman
636af2f7ea fix up the tests 2017-06-06 05:04:22 -07:00
Reed Allman
9edacae928 clean up hotf(x) concurrency, rm max c
this patch gets rid of max concurrency for functions altogether, as discussed,
since it will be challenging to support across functions nodes. as a result of
doing so, the previous version of functions would fall over when offered 1000
functions, so there was some work needed in order to push this through.
further work is necessary as docker basically falls over when trying to start
enough containers at the same time, and with this patch essentially every
function can scale infinitely. it seems like we could add some kind of
adaptive restrictions based on task run length and configured wait time so
that fast running functions will line up to run in a hot container instead of
them all creating new hot containers.

this patch takes a first cut at whacking out some of the insanity that was the
previous concurrency model, which was problematic in that it limited
concurrency significantly across all functions since every task went through
the same unbuffered channel, which could create blocking issues for all
functions if the channel is not picked off fast enough (it's not apparent that
this was impossible in the previous implementation). in any event, each
request has a goroutine already, there's no reason not to use it. not too hard
to wrap a map in a lock, not sure what the benefits were (added insanity?) in effect
this is marginally easier to understand and less insane (marginally). after
getting rid of max c this adds a blocking mechanism for the first invocation
of any function so that all other hot functions will wait on the first one to
finish to avoid a herd issue (was making docker die...) -- this could be
slightly improved, but works in a pinch. reduced some memory usage by having
redundant maps of htfnsvr's and task.Requests (by a factor of 2!). cleaned up
some of the protocol stuff, need to clean this up further. anyway, it's a
first cut. have another patch that rewrites all of it but was getting into
rabbit hole territory, would be happy to oblige if anybody else has problems
understanding this rat's nest of channels. there is a good bit of work left to
make this prod ready (regardless of removing max c).

a warning that this will break the db schemas, didn't put the effort in to add
migration stuff since this isn't deployed anywhere in prod...

TODO need to clean out the htfnmgr bucket with LRU
TODO need to clean up runner interface
TODO need to unify the task running paths across protocols
TODO need to move the ram checking stuff into worker for noted reasons
TODO need better elasticity of hot f(x) containers
2017-06-05 20:04:13 -07:00
Denis Makogon
3f065ce6bf [Feature] Function status 2017-06-06 14:12:50 -07:00
James Jeffrey
c7a5bae587 Merge branch 'chad-gitlab-url-change' into 'master'
Chad gitlab url change

See merge request !28
2017-05-30 11:34:22 -07:00
Travis Reeder
af918fdfe9 Fix run env vars passed in via command line to test locally and updated docs to match. 2017-05-30 10:54:34 -07:00
Denis Makogon
31b4ac4516 Address broken tests 2017-05-30 08:50:53 -07:00
Chad Arimura
49d397293b global url replace 2017-05-29 17:10:47 -07:00
Travis Reeder
9ba22989f8 functions: 0.3.4 release [skip ci] 2017-05-27 09:41:11 -07:00
James Jeffrey
ceaf497957 Merge branch 'chad-ux-improvements' into 'master'
Chad ux improvements

See merge request !20
2017-05-27 00:26:00 +00:00
Chad Arimura
1e90fc4459 consts 2017-05-26 17:01:39 -07:00
Travis Reeder
69f0201818 Some small cleanup to docs. 2017-05-26 18:54:26 +00:00
Chad Arimura
8899361545 adding ascii art to server start 2017-05-25 09:39:14 -07:00
Travis Reeder
961d17bdb8 Uses SetDefaults as it does in create too. 2017-05-18 14:18:16 -07:00
Travis Reeder
2696a8a917 Fixed idle timeout bug 2017-05-18 13:24:49 -07:00
Travis Reeder
9cc12b4b12 Remove iron... 2017-05-18 18:59:34 +00:00
Travis Reeder
fedf08964e Deploy will automatically create a route if it doesn't exist. 2017-05-17 15:11:44 -07:00
James
e4bb04887e Rewrite imports to use forks files on gitlab not use githubs. 2017-05-16 11:06:32 -07:00
Travis Reeder
4b9bba352d Rename location. 2017-05-15 11:00:15 -07:00
Travis Reeder
d0ca2f9228 Moved runner into this repo, update dep files and now builds. 2017-04-21 07:42:42 -07:00
Travis Reeder
615ae5c36f Mass s&r: iron-io -> kumokit 2017-04-19 09:49:12 -06:00
Denis Makogon
7603e6e8fa Add idle_timeout to routes API (#603)
* Add inactivity_timeout to routes API

Closes: #544

* Fix failing datastore tests

* Rename inactivity_timeout to idle_timeout

* Update swagger doc

* Update hot fn doc

* Fix json tags

* Add function timeouts docs

* Rewording
2017-03-25 18:28:53 +01:00
Denis Makogon
6a8b995e04 Fix REQUEST_URL to reflect host and port of a client (#580)
Fixes: #578
2017-03-14 13:55:56 -07:00
Goutham Veeramachaneni
fae66764b4 Config EnvVars passed without leading _ (#534)
* Earlier X=Y was passed as _X=Y

Signed-off-by: Goutham Veeramachaneni <cs14btech11014@iith.ac.in>
2017-03-03 16:17:00 -08:00
Jordan Krage
1d0ba54b35 server updates (#566)
* server updates

- improved route create/update validation/defaults
- improved/added route test cases

* cleanup

* negative concurrency check
2017-03-03 09:33:19 -06:00
Jordan Krage
06171800e2 Datastore validator (#565)
* add datastore validator; adapt mock and tests

* adapt bolt datastore to common validator

* adapt postgres datastore to validator

* adapt redis datastore to common validator
2017-03-02 14:43:53 -08:00
Seif Lotfy سيف لطفي
e39f70d6cc Return 500 if trying to run path with non-existing image (#546)
* Return 500 if trying to run path with non-existing image

Fixes: #540

* Add failed task run to logs
2017-02-28 19:14:51 -06:00
Travis Reeder
24ed27bd74 Removed image check and mount docker socket in quickstart. (#531) 2017-02-21 22:21:40 -08:00
Travis Reeder
7f7d99feb4 Share version between API and fn tool (#525) 2017-02-15 21:26:45 -08:00
CircleCI
2890b909b1 functions: 0.2.17 release [skip ci] 2017-02-16 05:22:42 +00:00
CircleCI
ce375b3975 functions: 0.2.16 release [skip ci] 2017-02-13 23:52:42 +00:00
CircleCI
3f8e0cecfc functions: 0.2.15 release [skip ci] 2017-02-11 02:41:35 +00:00
Pedro Nasser
a5eeacdadb fix runner response (#517) 2017-02-11 03:36:56 +01:00
CircleCI
ad50523fd1 functions: 0.2.14 release [skip ci] 2017-02-10 00:36:14 +00:00
Seif Lotfy سيف لطفي
ab9428a937 Unskip tests (#516)
* Unskip tests

* fix fn output for errors

* Change Error model and add fn routes call return on error
2017-02-09 22:31:39 -02:00
CircleCI
6214f1711a functions: 0.2.13 release [skip ci] 2017-02-08 21:21:01 +00:00
CircleCI
1783eb5488 functions: 0.2.12 release [skip ci] 2017-02-06 15:17:27 +00:00
Travis Reeder
27123a0609 Updated API index reponse, more friendly. (#511) 2017-02-06 16:12:29 +01:00
CircleCI
679d50602e functions: 0.2.11 release [skip ci] 2017-02-02 21:43:56 +00:00
CircleCI
a949c392c2 functions: 0.2.10 release [skip ci] 2017-02-01 20:51:12 +00:00
CircleCI
e47d9540c6 functions: 0.2.9 release [skip ci] 2017-01-31 20:02:20 +00:00
CircleCI
0ad91466ff functions: 0.2.8 release [skip ci] 2017-01-30 22:47:46 +00:00
Travis Reeder
ce26f665ea Middleware (#502)
* API endpoint extensions working.

extensions example.

extensions example.

* Added server.NewEnv and some docs for the API extensions example.

extensions example.

extensions example.

* Uncommented special handler stuff.

* First example of middleware.

easier to use.

* Added a special Middleware context to make middleware easier to use.

* Fix tests.

* Cleanup based on PR comments.
2017-01-30 23:43:23 +01:00
CircleCI
37efa47bdf functions: 0.2.7 release [skip ci] 2017-01-30 20:19:04 +00:00
Travis Reeder
d5116397b6 API extension points (#473)
* API endpoint extensions working.

extensions example.

* Added server.NewEnv and some docs for the API extensions example.

extensions example.
example main.go.

* Uncommented special handler stuff.

* Added section in docs for extending API linking to example main.go.

* Commented out special_handler test

* Changed to NewFromEnv
2017-01-30 12:14:28 -08:00