Commit Graph

1277 Commits

Author SHA1 Message Date
Travis Reeder
667c611fac Added functions to MiddlewareContext interface 2017-07-12 22:28:49 -07:00
Travis Reeder
86b93e27f7 Updated ctx to MiddlewareContext in various places. 2017-07-12 21:40:16 -07:00
Travis Reeder
7a81aa5761 Merge branch 'middleware-update' into 'master'
Allow setting values in middleware context like gin context.

See merge request !99
2017-07-12 15:05:13 -07:00
Travis Reeder
1dcc93b32b Updated dependencies 2017-07-12 14:18:01 -07:00
Travis Reeder
98539fba8a Updated deps 2017-07-12 14:08:59 -07:00
Reed Allman
8d669c202c Merge branch 'one-db' into 'master'
merge datastores into sqlx package

See merge request !101
2017-07-11 11:30:41 -07:00
Travis Reeder
0f83355f0a Merge branch 'fix-root-route-invocation' into 'master'
Allow calling root route on app

Closes #64

See merge request !91
2017-07-11 09:44:29 -07:00
Mukhtar Haji
cdc8c03c87 Remove runtime as a dependency and add test lib
This change also simplifies the entrypoint in the func.yaml, so only the
user's function is referenced. All runtime related stuff is completely
abstracted away from the user.
2017-07-11 11:43:47 +01:00
Reed Allman
1bb314508e Merge branch 'use-ctx-logger' into 'master'
Using ctx logger in more places to get more context in the logs - ie: call_id

See merge request !102
2017-07-10 16:13:51 -07:00
Travis Reeder
e56ac42bc2 Using ctx logger in more places to get more context in the logs - ie: call_id 2017-07-10 16:13:51 -07:00
Reed Allman
6217ef7d35 Merge branch 'remove-logrus-from-fn' into 'master'
Remove logrus from fn

See merge request !98
2017-07-07 16:41:45 -07:00
Travis Reeder
aed8ec8e2a Remove logrus from fn 2017-07-07 16:41:45 -07:00
Travis Reeder
bd9c9c5202 WIP, setting values in middleware context like gin context. 2017-07-07 16:34:04 -07:00
Reed Allman
b793d97a07 Merge branch 'detect_vendor' into 'master'
Detect vendor dir by having the func be on the go path

See merge request !95
2017-07-07 15:47:13 -07:00
Travis Reeder
130991819d functions: 0.3.20 release [skip ci] 2017-07-07 14:54:16 -07:00
Travis Reeder
b24ff782bf Minor cleanup for hot lambda. 2017-07-07 14:51:42 -07:00
James Jeffrey
fcc878bdc4 Merge branch 'fix-netwokring-for-int-tests' into 'master'
Make mysql ports consistent

See merge request !97
2017-07-07 13:10:50 -07:00
Denis Makogon
d69423b6b7 Make mysql ports consistent 2017-07-07 23:05:17 +03:00
James Jeffrey
2c42861b48 Merge branch 'fix-netwokring-for-int-tests' into 'master'
Enable different kinds of networking communications to Docker for integration tests

See merge request !96
2017-07-07 12:49:17 -07:00
Denis Makogon
54068ae0b6 Enable different kinds of networking communications to Docker 2017-07-07 22:46:26 +03:00
James Jeffrey
fdd7ad929f : 0.3.19 release [skip ci] 2017-07-07 11:05:31 -07:00
James Jeffrey
15fd29f1e9 [skip ci] Bump fn Version 0.3.13 2017-07-07 10:45:36 -07:00
James Jeffrey
7343df70de Add example of using vendor for golang 2017-07-07 10:35:36 -07:00
James Jeffrey
b175dcf291 Just copy func file 2017-07-07 10:15:05 -07:00
Reed Allman
aada2476e9 Merge branch 'add_go_fmt' into 'master'
Add go fmt

See merge request !94
2017-07-07 10:14:08 -07:00
James Jeffrey
81e39b210d Add go fmt 2017-07-07 10:14:08 -07:00
James Jeffrey
4bac217847 Detect vendor dir by having the func be on the go path 2017-07-07 10:00:18 -07:00
Reed Allman
e637f9736e back the lb with a db for scale
now we can run multiple lbs in the same 'cluster' and they will all point to
the same nodes. all lb nodes are not guaranteed to have the same set of
functions nodes to route to at any point in time since each lb node will
perform its own health checks independently, but they will all be backed by
the same list from the db to health check at least. in cases where there will
be more than a few lbs we can rethink this strategy, we mostly need to back
the lbs with a db so that they persist nodes and remain fault tolerant in that
sense. the strategy of independent health checks is useful to reduce thrashing
the db during network partitions between lb and fn pairs. it would be nice to
have gossip health checking to reduce network traffic, but this works too, and
we'll need to seed any gossip protocol with a list from a db anyway.

db_url is the same format as what functions takes. i don't have env vars set
up for fnlb right now (low hanging fruit), the flag is `-db`, it defaults to
in memory sqlite3 so nodes will be forgotten between reboots. used the sqlx
stuff, decided not to put the lb stuff in the datastore stuff as this was easy
enough to just add here to get the sugar, and avoid bloating the datastore
interface. the tables won't collide, so can just use same pg/mysql as what the
fn servers are running in prod even, db load is low from lb (1 call every 1s
per lb).

i need to add some tests, touch testing worked as expected.
2017-07-07 07:45:17 -07:00
Reed Allman
eed8555da6 add sqlite3 dep 2017-07-07 01:31:11 -07:00
Reed Allman
4e52c595d2 merge datastores into sqlx package
replace default bolt option with sqlite3 option. the story here is that we
just need a working out of the box solution, and sqlite3 is just fine for that
(actually, likely better than bolt).

with sqlite3 supplanting bolt, we mostly have sql databases. so remove redis
and then we just have one package that has a `sql` implementation of the
`models.Datastore` and lean on sqlx to do query rewriting. this does mean
queries have to be formed a certain way and likely have to be ANSI-SQL (no
special features) but we weren't using them anyway and our base api is
basically done and we can easily extend this api as needed to only implement
certain methods in certain backends if we need to get cute.

* remove bolt & redis datastores (can still use as mqs)
* make sql queries work on all 3 (maybe?)
* remove bolt log store and use sqlite3
* shove the FnLog shit into the datastore shit for now (free pg/mysql logs...
just for demos, etc, not prod)
* fix up the docs to remove bolt references
* add sqlite3, sqlx dep
* fix up tests & mock stuff, make validator less insane
* remove put & get in datastore layer as nobody is using.

this passes tests which at least seem like they test all the different
backends. if we trust our tests then this seems to work great. (tests `make
docker-test-run-with-*` work now too)
2017-07-07 01:30:02 -07:00
Reed Allman
cc0f7cfb14 add sqlx package 2017-07-06 19:46:28 -07:00
Chad Arimura
9a7141967c removing old release 2017-07-06 15:05:38 -07:00
Reed Allman
e9294c594e Merge branch 'resolves_issue_37' into 'master'
Resolves issue 37

Closes #37

See merge request !88
2017-07-06 14:10:31 -07:00
James Jeffrey
b3a4e96800 Build fn before all tests 2017-07-06 13:42:53 -07:00
James Jeffrey
4fbb34655a Update vendored deps 2017-07-06 13:41:25 -07:00
Denis Makogon
084c61dfa1 Merge branch 'issues-54' into 'master'
Issue 54: Fix CLI output while listing routes

Closes #54

See merge request !93
2017-07-06 13:38:49 -07:00
James Jeffrey
9d677fab63 Update cli to use put for deploy 2017-07-06 13:31:35 -07:00
James Jeffrey
55239dbd80 Check both errors 2017-07-06 12:42:09 -07:00
James Jeffrey
7ebf8ab144 No nil errors on error 2017-07-06 12:23:44 -07:00
Reed Allman
c0466bd0cd Merge branch 'hot-lambda' into 'master'
Hot lambda

Closes #81

See merge request !90
2017-07-06 12:22:43 -07:00
James Jeffrey
61bd41f9b2 Error apps create not route 2017-07-06 12:22:03 -07:00
James Jeffrey
e5b1bb03ea Address more comments. Add docs and clean up comments 2017-07-06 12:19:48 -07:00
James Jeffrey
d3fb420be0 Move logging. Remove todo comment 2017-07-06 12:08:17 -07:00
James Jeffrey
77c5d38381 Update docs 2017-07-06 11:46:25 -07:00
James Jeffrey
021bb32a22 Refactor tests to use testRoute case struct. Use one method for tests. Fix logic for when to skipzero 2017-07-06 11:46:25 -07:00
James Jeffrey
a37abfd9d5 Add error validation to some cases that were missing it. 2017-07-06 11:46:25 -07:00
James Jeffrey
3087a12b83 Needs != for this. Do not try to test client for functions go if there 2017-07-06 11:46:25 -07:00
James Jeffrey
7f226bc96b Assign err. Fixes tests that were not working 2017-07-06 11:46:25 -07:00
James Jeffrey
b4d39c0f3c Refactor seperate out logic 2017-07-06 11:46:24 -07:00
James Jeffrey
4845ddb1d4 Only use 200 follows what others do. Less switching. Remove defense 2017-07-06 11:46:24 -07:00