Commit Graph

2042 Commits

Author SHA1 Message Date
CI
ca30310352 functions: 0.3.186 release [skip ci] 0.3.186 2017-11-16 23:52:13 +00:00
Tolga Ceylan
4edda24703 fn: fnlb: default health state for new nodes (#508)
* fn: fnlb: default health state for new nodes

*) Any new node now by default is in unknown state.
*) One health check is required for unknown state to move in
   to healthy/unhealthy states, then actual interval and
   thresholds apply.
*) add() no longer runs health check as this is now handled
   with the new logic.

This means during restarts fnlb will run one health check
immediately for nodes to switch to healthy/unhealthy state
to ensure speedy start, but guard against routing traffic to
unhealthy servers. After this initial state, nodes are
subjected to regular interval and thresholds.

* *) style fixes
2017-11-16 15:35:33 -08:00
CI
73817c0fd4 fnlb: 0.0.151 release [skip ci] fnlb-0.0.151 2017-11-16 20:16:29 +00:00
CI
20c50bc9da functions: 0.3.185 release [skip ci] 0.3.185 2017-11-16 20:15:01 +00:00
Tolga Ceylan
657afd5838 fn: fnlb: enhancements and new grouper tests (#493)
* fn: fnlb: enhancements and new grouper tests

*) added healthy threshold (default: 1)
*) grouper is now using configured hcEndpoint for version checks
*) grouper now logs when servers switch between healthy/unhealthy status
*) moved DB code out of grouper
*) run health check immediately at start (don't wait until hcInterval)
*) optional shutdown timeout (default: 0) & mgmt port (default: 8081)
*) hot path List() in grouper now uses atomic ptr Load
*) consistent router: moved closure to a new function
*) bugfix: version parsing from fn servers should not panic fnlb
*) bugfix: servers removed from DB, stayed in healthy list
*) bugfix: if DB is down, health checker stopped monitoring
*) basic new tests for grouper (add/rm/unhealthy/healthy) server
2017-11-16 11:35:30 -08:00
Nigel Deakin
910612d0b1 Docker stats to Prometheus (#486)
* Docker stats to Prometheus

* Fix compilation error in docker_test

* Refactor docker driver Run function to wait for  the container to have stopped before stopping the colleciton of statistics

* Fix go fmt errors

* Updates to sending docker stats to Prometheus

* remove new test TestWritResultImpl because we changes to support multiple waiters have been removed

* Update docker.Run to use channels not contextrs to shut down stats collector
2017-11-16 11:02:33 -08:00
CI
83145db6ba fnlb: 0.0.150 release [skip ci] fnlb-0.0.150 2017-11-16 18:27:02 +00:00
CI
db3d76fd1b functions: 0.3.184 release [skip ci] 0.3.184 2017-11-16 18:25:15 +00:00
CI
f605370309 fnlb: 0.0.149 release [skip ci] fnlb-0.0.149 2017-11-16 18:16:53 +00:00
CI
0f3b64867f functions: 0.3.183 release [skip ci] 0.3.183 2017-11-16 18:15:31 +00:00
Travis Reeder
64c6118313 Removed a bunch of old examples. (#502)
* Removed a bunch of old examples.

* moved grafana back.

* Bumping, circle didn't do build... ?
2017-11-16 10:10:03 -08:00
Travis Reeder
96cfc9f5c1 Update json (#463)
* wip

* wip

* Added more fields to JSON and added blank line between objects.

* Update tests.

* wip

* Updated to represent recent discussions.

* Fixed up the json test

* More docs

* Changed from blank line to bracket, newline, open bracket.

* Blank line added back, easier for delimiting.
2017-11-16 09:59:13 -08:00
CI
279e5248ba fnlb: 0.0.148 release [skip ci] fnlb-0.0.148 2017-11-16 17:57:17 +00:00
CI
86fb89d250 functions: 0.3.182 release [skip ci] 0.3.182 2017-11-16 17:55:59 +00:00
Derek Schultz
c281f96486 K8s docs update (#499)
* split fn-ui to its own service

* add fn namespace

* update path

* add namespace flag for kubectl

* simplify grabbing minikube IP and port

* typo: FUNCTIONS -> API_URL
2017-11-16 10:45:25 -07:00
CI
724d3730a3 fnlb: 0.0.147 release [skip ci] fnlb-0.0.147 2017-11-16 15:49:50 +00:00
CI
a8a0345090 functions: 0.3.181 release [skip ci] 0.3.181 2017-11-16 15:48:31 +00:00
Alexander Bransby-Sharples
c5ec0cc41e Add CORS support to fn api (#455)
The Gin middleware is being used if one or more Origins are specified. Default setup for each Origin is as follows:

- GET,POST, PUT, HEAD methods allowed
- Credentials share disabled
- Preflight requests cached for 12 hours

Which are the defaults gin-contrib/cors comes with out of the box.

Gin-cors will return a 403 if it gets a request with an Origin header that isn't on its' list. If no Origin header is specified then it will just return the servers response.

Start fn with CORS enabled:

`API_CORS="http://localhost:4000, http://localhost:3000" make run`
2017-11-16 15:37:26 +00:00
CI
8f7794c53a fnlb: 0.0.146 release [skip ci] fnlb-0.0.146 2017-11-16 00:19:17 +00:00
CI
406267a040 functions: 0.3.180 release [skip ci] 0.3.180 2017-11-16 00:17:55 +00:00
Owen Cliffe
8aa2c8958f Remove java tutorial, link to FDK (#504) 2017-11-15 16:06:42 -08:00
CI
fe82fc724c fnlb: 0.0.145 release [skip ci] fnlb-0.0.145 2017-11-15 16:41:22 +00:00
CI
92c68e3665 functions: 0.3.179 release [skip ci] 0.3.179 2017-11-15 16:40:04 +00:00
Travis Reeder
d30732e5b8 image was in wrong place. 2017-11-15 08:29:10 -08:00
CI
daaf7fb7c1 fnlb: 0.0.144 release [skip ci] fnlb-0.0.144 2017-11-14 21:06:42 +00:00
CI
3031a465a2 functions: 0.3.178 release [skip ci] 0.3.178 2017-11-14 21:05:21 +00:00
Reed Allman
61b416a9b5 automagic sql db migrations (#461)
* adds migrations

closes #57

migrations only run if the database is not brand new. brand new
databases will contain all the right fields when CREATE TABLE is called,
this is for readability mostly more than efficiency (do not want to have
to go through all of the database migrations to ascertain what columns a table
has). upon startup of a new database, the migrations will be analyzed and the
highest version set, so that future migrations will be run. this should also
avoid running through all the migrations, which could bork db's easily enough
(if the user just exits from impatience, say).

otherwise, all migrations that a db has not yet seen will be run against it
upon startup, this should be seamless to the user whether they had a db that
had 0 migrations run on it before or N. this means users will not have to
explicitly run any migrations on their dbs nor see any errors when we upgrade
the db (so long as things go well). if migrations do not go so well, users
will have to manually repair dbs (this is the intention of the `migrate`
library and it seems sane), this should be rare, and I'm unsure myself how
best to resolve not having gone through this myself, I would assume it will
require running down migrations and then manually updating the migration
field; in any case, docs once one of us has to go through this.

migrations are written to files and checked into version control, and then use
go-bindata to generate those files into go code and compiled in to be consumed
by the migrate library (so that we don't have to put migration files on any
servers) -- this is also in vcs. this seems to work ok. I don't like having to
use the separate go-bindata tool but it wasn't really hard to install and then
go generate takes care of the args. adding migrations should be relatively
rare anyway, but tried to make it pretty painless.

1 migration to add created_at to the route is done here as an example of how
to do migrations, as well as testing these things ;) -- `created_at` will be
`0001-01-01T00:00:00.000Z` for any existing routes after a user runs this
version. could spend the extra time adding 'today's date to any outstanding
records, but that's not really accurate, the main thing is nobody will have to
nuke their db with the migrations in place & we don't have any prod clusters
really to worry about. all future routes will correctly have `created_at` set,
and plan to add other timestamps but wanted to keep this patch as small as
possible so only did routes.created_at.

there are tests that a spankin new db will work as expected as well as a db
after running all down & up migrations works. the latter tests only run on mysql
and postgres, since sqlite3 does not like ALTER TABLE DROP COLUMN; up
migrations will need to be tested manually for sqlite3 only, but in theory if
they are simple and work on postgres and mysql, there is a good likelihood of
success; the new migration from this patch works on sqlite3 fine.

for now, we need to use `github.com/rdallman/migrate` to move forward, as
getting integrated into upstream is proving difficult due to
`github.com/go-sql-driver/mysql` being broken on master (yay dependencies).
Fortunately for us, we vendor a version of the `mysql` bindings that actually
works, thus, we are capable of using the `mattes/migrate` library with success
due to that. this also will require go1.9 to use the new `database/sql.Conn`
type, CI has been updated accordingly.

some doc fixes too from testing.. and of course updated all deps.

anyway, whew. this should let us add fields to the db without busting
everybody's dbs. open to feedback on better ways, but this was overall pretty
simple despite futzing with mysql.

* add migrate pkg to deps, update deps

use rdallman/migrate until we resolve in mattes land

* add README in migrations package

* add ref to mattes lib
2017-11-14 12:54:33 -08:00
CI
91962e50b9 fnlb: 0.0.143 release [skip ci] fnlb-0.0.143 2017-11-14 02:09:38 +00:00
CI
bfbc6096ee functions: 0.3.177 release [skip ci] 0.3.177 2017-11-14 02:08:26 +00:00
Tolga Ceylan
af8eed098d fn: graceful shutdown adjustments (#498)
Graceful shutdown should wait for Shutdown call instead of
ListenAndServe. This is because ListenAndServe returns
immediately upon Shutdown call.
2017-11-13 17:58:15 -08:00
CI
ef43e2c772 fnlb: 0.0.142 release [skip ci] fnlb-0.0.142 2017-11-13 17:51:11 +00:00
CI
42e7143ed4 functions: 0.3.176 release [skip ci] 0.3.176 2017-11-13 17:49:52 +00:00
CI
8c4c7cfda1 fnlb: 0.0.141 release [skip ci] fnlb-0.0.141 2017-11-13 17:47:47 +00:00
CI
3e4ebbda33 functions: 0.3.175 release [skip ci] 0.3.175 2017-11-13 17:46:21 +00:00
Chad Arimura
cb0ff466a0 small changes 2017-11-13 09:39:24 -08:00
Chad Arimura
5822072bbd few small changes 2017-11-13 09:35:43 -08:00
CI
317059e632 fnlb: 0.0.140 release [skip ci] fnlb-0.0.140 2017-11-13 17:25:05 +00:00
CI
be844de01d functions: 0.3.174 release [skip ci] 0.3.174 2017-11-13 17:23:46 +00:00
Travis Reeder
42e8bf1601 Replace arch diagram. 2017-11-13 09:13:21 -08:00
CI
85c61a4a99 fnlb: 0.0.139 release [skip ci] fnlb-0.0.139 2017-11-09 15:24:52 +00:00
CI
27bdd9ed71 functions: 0.3.173 release [skip ci] 0.3.173 2017-11-09 15:23:37 +00:00
Travis Reeder
6c21103057 Rollback dockerfile (image too big) and add docker run command to docs. (#488) 2017-11-09 16:12:45 +01:00
CI
fde2173087 fnlb: 0.0.138 release [skip ci] fnlb-0.0.138 2017-11-08 14:50:18 +00:00
CI
2318e04d0b functions: 0.3.172 release [skip ci] 0.3.172 2017-11-08 14:48:08 +00:00
Reed Allman
d1b22f7fb3 Merge pull request #474 from fnproject/remove-swarm-link
remove link to outdated swarm doc
2017-11-08 14:37:55 +00:00
CI
7999cdc52d fnlb: 0.0.137 release [skip ci] fnlb-0.0.137 2017-11-03 00:54:03 +00:00
CI
601e2d18fd functions: 0.3.171 release [skip ci] 0.3.171 2017-11-03 00:51:56 +00:00
Reed Allman
0b594cfeff Merge pull request #475 from skinowski/go_lint
Minor naming and control flow changes to satisfy golint
2017-11-03 00:41:18 +00:00
Tolga Ceylan
a530cd9be3 Minor naming and control flow changes to satisfy golint 2017-11-02 15:36:55 -07:00
Derek Schultz
21e42658b3 remove link to outdated swarm doc 2017-11-02 16:18:03 -06:00