Commit Graph

30 Commits

Author SHA1 Message Date
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
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
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
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
17e18d872b mock datastore tests (#562) 2017-03-01 22:04:04 -08:00
Jordan Krage
3fd3da87f3 Datastore tests (#551)
* common datastore tests

* fix Datastore.UpdateApp

* remove extra datastore tests

* datastore test fixes
2017-03-01 08:40:08 -08:00
Pedro Nasser
5367a3ef99 Fix API inconsistencies (#404)
* fix api inconsistencies

* handling empty format cases

* code style
2016-12-07 17:16:48 -02:00
C Cirello
66d446b148 functions: returns HTTP error in case of route update attempt (#396)
Ensure that attempts to update route's path are properly handled
with a HTTP error. Moreover, updates swagger file to make it
explicit that routes are immutable.

Fixes #381
2016-12-07 19:54:09 +01:00
C Cirello
a7a466f968 functions: fix route timeout (#349)
* functions: add route-level timeout configuration options

* functions: harmonize defaults
2016-11-28 20:53:11 -02:00
C Cirello
ac0044f7d9 functions: hot containers (#332)
* functions: modify datastore to accomodate hot containers support

* functions: protocol between functions and hot containers

* functions: add hot containers clockwork

* fn: add hot containers support
2016-11-28 15:45:35 -02:00
Pedro Nasser
7593480d4b fix route update (#295)
Fix route update, ensure image exists
2016-11-16 19:46:56 -02:00
Travis Reeder
616112b349 swagger fixes and appname -> app_name (#294)
* swagger fixes and appname -> app_name

* Swagger errors fixed
2016-11-15 08:13:53 -08:00
Pedro Nasser
7aa1981fba Datastore refactor and added postgres tests (#259)
* fix apps & routes creation/update

* refactor datastore and added postgres tests

* added test-datastore and fixed circleci test
2016-11-14 15:03:10 -02:00
Carlos C
d5fb1afda7 Revert "Assert License (#224)"
This reverts commit a61c4dab78.
2016-11-06 09:25:12 -08:00
C Cirello
a61c4dab78 Assert License (#224)
* license: assert license for Go code
* license: add in shell scripts
* license: assert license for Ruby code
* license: assert license to individual cases
* license: assert license to Dockerfile
2016-11-05 23:33:07 +01:00
C Cirello
42efb2ed6b Improve routes query (#172) 2016-10-14 21:52:25 +02:00
Pedro Nasser
2e12e2c700 Fix input async tasks + tests (#137) 2016-10-12 22:23:34 +02:00
Seif Lotfy
54f66c7b09 update glide 2016-09-26 12:59:18 +02:00
Seif Lotfy
b623fc27e4 Initial work on async functions 2016-09-24 10:06:51 +02:00
Pedro Nasser
f461312553 add required memory configuration to Route 2016-09-09 00:53:46 -03:00
Pedro Nasser
2782a6db54 added config to apps and routes 2016-08-26 23:04:57 -03:00
Pedro Nasser
43ab8da867 added omitempty route struct 2016-08-15 20:05:38 -03:00
Pedro Nasser
39f59620aa added image filter 2016-08-11 01:04:11 -03:00
Travis Reeder
3d94fc64c9 Removed "name" from route, only need path. 2016-08-07 14:58:05 -04:00
Pedro Nasser
0b3d5cec5e renamed route errors and added path validation 2016-07-30 18:15:57 -03:00
Pedro Nasser
2489fd851f added wrapper on models; changed handlers; fixes 2016-07-26 00:10:45 -03:00
Pedro Nasser
14cc57fd9c refactor runner using titan 2016-07-24 17:46:08 -03:00
Pedro Nasser
5a13e2c0cc improv api, datastore, postgres, runner 2016-07-21 21:18:02 -03:00
Pedro Nasser
66fa3d4035 refactoring API and added dbs: postgres, bolt 2016-07-21 16:04:58 -03:00