Commit Graph

1252 Commits

Author SHA1 Message Date
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
James Jeffrey
c66a0d0cc4 Update swagger doc. Indicate to user if updated or created 2017-07-06 11:46:24 -07:00
James Jeffrey
2832c5adec Catch errors when building fn bin 2017-07-06 11:46:24 -07:00
James Jeffrey
70eb25c873 Change logic behind put post and patch for routes 2017-07-06 11:46:24 -07:00
Denis Makogon
91674820f2 Fixing tab writer for more clean view while listing routes 2017-07-06 20:48:33 +03:00
Reed Allman
ed0b49b706 Merge branch 'cleanup-utils-imports-leftovers' into 'master'
Cleanup utils imports leftovers

See merge request !92
2017-07-06 10:45:13 -07:00
Denis Makogon
fa20db0df4 Remove trace message on client init 2017-07-06 20:42:42 +03:00
Denis Makogon
009c478c07 Clean up leftover imports 2017-07-06 18:15:07 +03:00
Mukhtar Haji
ce7ef8bb99 Split the deps into api and runtime
This is based on !34 in jfaas. The plan is to only depend on the api in
the pom file and for the runtime to be embedded into the run image.
Currently, there isn't a registry to push a Java image with the runtime
embedded so for run, we'll still reference both the api and runtime in
the pom.
2017-07-06 10:41:25 +01:00
Will Price
02d6349cf8 Allow calling root route on app
Fixes #64

Previously calling a root registered route would result in an error
message "Not Found" suggesting the route hadn't been registed, yet when
listing the routes, `fn routes list myapp` you could see the `/` route.

You can now successfully call a root registered route with `fn call
myapp /`
2017-07-06 10:40:34 +01:00
Travis Reeder
5ec0eadff8 Got optional hot functions working for Lambda. 2017-07-05 23:34:19 -07:00
Reed Allman
a5861d5b6f Merge branch 'integration-api-tests' into 'master'
Full stack tests

See merge request !68
2017-07-05 12:38:10 -07:00
Denis Makogon
adf61c77be Full stack tests 2017-07-05 12:38:09 -07:00
Reed Allman
c85571f51d Merge branch 'fix-logs-reed' into 'master'
Fix logs stuff

See merge request !74
2017-07-05 10:41:27 -07:00
Mukhtar Haji
5c5f10d6e5 Make Java maven the default Java runtime
This replaces the basic Java runtime with Java maven
2017-07-03 10:17:40 +01:00
Reed Allman
c20b4769bf make hot functions actually have logs now 2017-06-30 16:10:33 -07:00
Reed Allman
db782536d9 Merge branch 'fix_issue_72' into 'master'
This returns 404 when app is not there on delete closes #72

Closes #72

See merge request !87
2017-06-30 12:37:58 -07:00
Reed Allman
c186c10123 Merge branch 'issues-76' into 'master'
Check if route exists before attempting to delete it

Closes #76

See merge request !85
2017-06-30 12:37:48 -07:00
James Jeffrey
8e97a635a9 This returns 404 when app is not there on delete closes #72 2017-06-30 12:20:59 -07:00
James Jeffrey
76b2b8059e functions: 0.3.18 release [skip ci] 2017-06-30 11:34:47 -07:00
Travis Reeder
27ab931340 Merge branch 'glide-get' into 'master'
add funcy/functions_go & update docker/distribution

See merge request !86
2017-06-30 11:22:56 -07:00
Reed Allman
c9c7950d0f add funcy/functions_go & update docker/distribution 2017-06-30 11:22:56 -07:00
Denis Makogon
67719d691d Check if route exist before attempting to delete it
xFixes: #76
2017-06-30 14:09:00 +03:00
Reed Allman
452dc1ee86 Merge branch 'fnpatch' into 'master'
fixes fn set/unset for routes & apps

Closes #80

See merge request !83
2017-06-29 13:43:44 -07:00
Reed Allman
94c0232480 Merge branch 'remove_iron' into 'master'
Use FN_TOKEN not iron_token

See merge request !82
2017-06-29 10:59:44 -07:00
Derek Schultz
049a048c09 Merge branch 'fnlb-docker' into 'master'
adds docker & release stuff for fnlb

Closes #58

See merge request !65
2017-06-29 10:57:04 -07:00