Commit Graph

65 Commits

Author SHA1 Message Date
Reed Allman
05ac5b6d93 use redis pool more better
event loop was reusing a connection even if it was broken forever...

db was only using one connection ever even if it was broken...

no mas. seems to pass tests, hopefully chad can push it
2017-06-11 14:25:10 -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
James Jeffrey
79f1dab007 Deploy sh 2017-06-09 13:42:59 -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
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
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
ffae780f07 functions: 0.2.60 release [skip ci] 2017-05-15 12:00:43 -07:00
Travis Reeder
4b9bba352d Rename location. 2017-05-15 11:00:15 -07:00
Travis Reeder
615ae5c36f Mass s&r: iron-io -> kumokit 2017-04-19 09:49:12 -06:00
Pedro Nasser
5e8340bc1c Solving postgres marshal/unmarshal issue (#610)
* Solving postgres marshal/unmarshal issue

Postgres datastore was not marshaling the App config during its insert, that behavior was resulting in issues when fetching the App and the datastore couldn't unmarshal the config.

The same issue was probably happening with the Route's headers in some situations.

This commit's idea is to always try to marshal configs and headers when inserting/updating Apps or Routes. But in Apps and Routes get methods, if the  config/headers unmarshal fails, it returns an empty config/headers.

* fix one more unmarshal case

* returning error when unmarshaling non-empty
2017-03-28 11:30:12 -07:00
Pedro Nasser
5761ce3499 fix: error unmarshal empty app config (#609) 2017-03-27 09:58:03 -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
Martin Pinto-Bazurco Mendieta
e4b3105d92 Fix #418 Added MySQL as DB storage layer. (#575)
* Fix #418 Added MySQL as DB storage layer.

* Make the mysql stuff work

* Make the mysql stuff work

* Make the mysql stuff work

* Make the mysql stuff work

* small fixes

* Switch to Go 1.8 installation inside CI (#589)

* Switch to Go 1.8 installation inside CI

Partially Addresses: #588

* Use url.Hostname() instead of custom method

* Added PR review changes.

* Added missing check for error.

* Changed * with name, config

* Removed unused import.

* Added check for NoRows

* Merged changes with HEAD

* Added documentation to mysql.go

* update mysql to be on par with postgres
2017-03-21 20:01:17 +01:00
Denis Makogon
2a0e9f4b9c Switch to Go 1.8 installation inside CI (#589)
* Switch to Go 1.8 installation inside CI

Partially Addresses: #588

* Use url.Hostname() instead of custom method
2017-03-15 20:07:03 +01:00
Denis Makogon
23360d45f3 Make datastore tests pass with remote Docker containers (#587)
* Make datastore tests pass with remote Docker containers
* Make tests consume DOCKER_HOST IP address as bind host while constucting database URI.

 This fix makes datastore tests pass against
 remote Docker (with host IP different from 127.0.0.1)

Fixes: #586

* Make datastore tests pass on Go1.7.1
2017-03-14 14:32:50 +01:00
Jordan Krage
690d0d92e4 Postgres datastore errors and cleanup (#579)
* improved postgres datastore error handling

* remove excess postgres datastore validation

* postgres datastore errors and cleanup
2017-03-13 20:31:08 +01: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
Jordan Krage
17e18d872b mock datastore tests (#562) 2017-03-01 22:04:04 -08:00
Seif Lotfy سيف لطفي
3918701b2c Add support for redis as a datastore (#548)
* Add support for redis as a datastore

Fixes: #388

* Use HEXISTS instead of HGET when checking for apps and routes

* Get rid of SADD SREM and SMEMBERS

* change redis test port

* Add buffer time for redis docker

* redis test ping loop (#552)

* redis test ping loop

* simplify

* Refactor redis_test.go to adapt to @jmank88 new testing code

* tiny fix

* Redis datastore test fixes (#555)

* redis datastore test fixes - UpdateRoute/UpdateApp

* redis datastore fix InsertRoute

* redis datastore fix GetRoutesByApp
2017-03-01 16:55:09 -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
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
Pedro Nasser
a80fe9c897 Fix datastore error for inexistent app (#493)
* fix datastore error inexistent app

* fix get route error handling

* fix API errors handling and tests
2017-01-26 14:41:18 -08:00
Pedro Nasser
bf1f435458 API initialization changes (#483)
* initialization changes and shows no error

* fix issues

* remove unnecessary go routine

* revert

* fix http.Serve

* add change log
2017-01-18 19:07:11 -02:00
Reed Allman
dd2af59fc7 fixes make run-docker (#471)
since the db files were being created inside of the docker container with only
permissions for the root user to rwx and docker run needs all of $PWD to be
readable in order to build a docker container on the host, `make run-docker`
was broken on any subsequent runs. If we create more permissive permissions
then we don't have that issue (group +rx)
2017-01-03 20:41:05 +01:00
Pedro Nasser
597d66b5b3 fix: using bolt config/header update now overwrites (#456) 2016-12-22 22:27:52 +01: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
Pedro Nasser
9382f0b133 fix datastore Put and added tests (#402) 2016-12-07 08:59:54 -08:00
Pedro Nasser
7183c440d9 minor postgres fix (#392) 2016-12-05 10:44:37 -08:00
Pedro Nasser
9387e9bc41 fix postgres GetApp bug when filter is nil (#383) 2016-12-02 16:44:57 -08: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
Guilherme Rezende
707fc5ec0e fix bolt UpdateRoute header bug (#341) 2016-11-25 15:00:55 -02:00
Pedro Nasser
107033d5d7 Fix: handle nil filters (#340)
fix bug when filter is nil
2016-11-24 15:29:07 -02:00
Pedro Nasser
01d5a81389 Add appfilter and tests (#337)
add appfilter and tests
2016-11-24 03:46:42 -02:00
Pedro Nasser
c14bc323f9 added ctx to datastore and improve mock (#329)
Added ctx to datastore and improved mock
2016-11-22 03:33:44 -02:00
C Cirello
f6d19c3cc9 functions: performance improvements - LRU & singleflight DB calls (#322)
* functions: add cache and singleflight to ease database load

* runner: upgrade

* deps: upgrade glide files

* license: add third party notifications

* functions: fix handling of implicitly created apps

* functions: code deduplication

* functions: fix missing variable
2016-11-21 19:48:11 +01: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
C Cirello
34b4b25092 Log messages cleanup (#158) 2016-10-13 18:11:31 +02:00
C Cirello
4cbfb3ccfd Reduce test log verbosity (#150)
* Reduce test verbosity
* Divert gin's log to the test buffer
* Divert stdlib's log to the test buffer
* Add bolt tests into log buffer

* Add a linebreak to improve log output layout
2016-10-13 00:06:02 +02:00
Carlos C
bc3fba088f Fix start problem with two IronFunction colliding configurations
By default, BoltDB will hang while waiting to acquire lock to the
datafile, thus the users might find themselves waiting for something
but not what. The added timeout aims inform use about what's
happening.

Also this renames MQADR to TASKSRV, refactor configuration to read
environment variables. RunAsyncRunner now fills the gaps when
parsing TASKSRV.

Fixes #119
2016-10-04 23:57:43 +02:00