Commit Graph

1205 Commits

Author SHA1 Message Date
CI
1357119b67 fnserver: 0.3.259 release [skip ci] 2018-01-02 18:48:36 +00:00
Denis Makogon
faaf5846ce Use retry func while trying to ping SQL datastore (#630)
* Use retry func while trying to ping SQL datastore

 - implements retry func specifically for SQL datastore ping
 - fmt fixes
 - using sqlx.Db.PingContext instead of sqlx.Db.Ping
 - propogate context to SQL datastore

* Rely on context from ServerOpt

* Consolidate log instances

* Cleanup

* Fix server usage in API tests
2018-01-02 12:32:10 -06:00
CI
f675c00d93 fnserver: 0.3.258 release [skip ci] 2018-01-02 17:05:52 +00:00
CI
0bfd18a7c4 fnserver: 0.3.257 release [skip ci] 2017-12-26 17:20:10 +00:00
Reed Allman
683fef8c2e allow user configured agent in full node (#627)
* allow user configured agent in full node

this should keep the old default behavior but allow users to pass in a
configured agent to configure the server themselves, without having to worry
about a russian agent being a british agent.

also closes any agent given to an api node.

closes #623

* don't close agent in runner test
2017-12-26 11:04:14 -06:00
CI
ce6945aa3e fnserver: 0.3.256 release [skip ci] 2017-12-23 21:22:21 +00:00
CI
3ece05bc23 fnserver: 0.3.255 release [skip ci] 2017-12-23 16:28:09 +00:00
CI
5008188bfd fnserver: 0.3.254 release [skip ci] 2017-12-23 16:15:00 +00:00
Reed Allman
f51792ae5e Timestamps on apps / routes (#614)
* route updated_at

* add app created at, fix some route updated_at bugs

* add app updated_at

TODO need to add tests through front end
TODO for validation we don't really want to use the validate wrapper since
it's a programmer error and not a user error, hopefully tests block this.

* add tests for timestamps to exist / change on apps&routes

* route equals at done, fix tests wit dis

* fix up the equals sugar

* add swagger

* fix rebase

* precisely allocate maps in clone

* vetted

* meh

* fix api tests
2017-12-23 09:57:36 -06:00
CI
f6243fc6cb fnserver: 0.3.253 release [skip ci] 2017-12-22 21:09:05 +00:00
Tolga Ceylan
feeeca3321 fn: agent shutdown improvements (#622) 2017-12-22 12:52:31 -08:00
CI
4f586533c9 fnserver: 0.3.252 release [skip ci] 2017-12-21 22:12:31 +00:00
CI
77f68a69a9 fnserver: 0.3.251 release [skip ci] 2017-12-21 19:49:38 +00:00
Reed Allman
a8a3e143c7 unexport all data abstractions on Server (#618)
this patch has no behavior changes, changes are:

* server.Datastore() -> server.datastore
* server.MQ -> server.mq
* server.LogDB -> server.logstore
* server.Agent -> server.agent

these were at a minimum not uniform. further, it's probably better to force
configuration through initialization in `server.New` to ensure thread safety
of referencing if someone does want to modify these as well as forcing things
into our initialization path and reducing the surface area of the Server
abstraction.
2017-12-21 13:21:02 -06:00
CI
14d0f10515 fnserver: 0.3.250 release [skip ci] 2017-12-21 18:56:23 +00:00
CI
9ca2905cdb fnserver: 0.3.249 release [skip ci] 2017-12-21 17:58:17 +00:00
Travis Reeder
fdb4188146 Adds before/after app get/list. And some bug fixes/cleanup. (#610)
* Adds before/after app get/list. And some bug fixes/cleanup.

* Fix test
2017-12-21 09:32:03 -08:00
CI
c646a5cc5e fnserver: 0.3.248 release [skip ci] 2017-12-20 18:39:27 +00:00
Tolga Ceylan
7290579e7d fn: tests: adding hot container timeout and huge memory cases (#611)
* fn: adding hot container timeout and huge memory cases

*) switching TestRouteRunnerTimeout to fn-test-utils to handle
    both hot and cold.
*) in server_test added content-length handling as protocol http
    does not create content-length if it is not present.
2017-12-20 10:11:57 -08:00
CI
bf1500bb56 fnserver: 0.3.247 release [skip ci] 2017-12-20 04:58:20 +00:00
CI
299eb625c7 fnserver: 0.3.246 release [skip ci] 2017-12-20 03:02:25 +00:00
CI
b4d10d0cc3 fnserver: 0.3.245 release [skip ci] 2017-12-19 23:24:14 +00:00
CI
b1b64a6f04 fnserver: 0.3.244 release [skip ci] 2017-12-19 18:41:44 +00:00
CI
1ec17c8b0b fnserver: 0.3.243 release [skip ci] 2017-12-16 00:07:44 +00:00
Tolga Ceylan
25a72146f5 slot tracking improvements (#562)
* fn: remove 100 msec sleep for hot containers

*) moved slot management to its own file
*) slots are now implemented with LIFO semantics, this is important since we do
   not want to round robin hot containers. Idle hot containers should timeout properly.
*) each slot queue now stores a few basic stats such as avg time a call spent in a given
   state and number of running/launching containers, number of waiting calls in those states.
*) first metrics in these basic stats are discarded to avoid initial docker pull/start spikes.
*) agent now records/updates slot queue state and how much time a call stayed in that state.
*) waitHotSlot() replaces the previous wait 100 msec logic where it sends a msg to
   hot slot go routine launchHot() and waits for a slot
*) launchHot() is now a go routine for tracking containers in hot slots, it determines
   if a new containers is needed based on slot queue stats.
2017-12-15 15:50:07 -08:00
CI
fa0439640c fnserver: 0.3.242 release [skip ci] 2017-12-15 22:48:48 +00:00
Tolga Ceylan
419298e1c0 Async hot hdr fix (#604)
* fn: for async hot requests ensure/fix content-length/type

* fn: added tests for FromModel for content type/length

* fn: restrict the content-length fix to async in FromModel()
2017-12-15 14:32:25 -08:00
CI
477ae570a2 fnserver: 0.3.241 release [skip ci] 2017-12-15 18:49:25 +00:00
Nigel Deakin
f1fc040948 Fix spans for prometheus (#606) 2017-12-15 10:31:57 -08:00
CI
1ef2108acc fnserver: 0.3.240 release [skip ci] 2017-12-15 03:41:38 +00:00
Tolga Ceylan
3b12f3fa3d Fn deadline (#591)
* fn: added fn_deadline as RFC3339
2017-12-14 19:25:36 -08:00
CI
2fc96fef8d fnserver: 0.3.239 release [skip ci] 2017-12-14 21:59:49 +00:00
Reed Allman
404250a417 loggy loo for node type on startup (#602)
* loggy loo for node type on startup

* additional english verse

* update to most recent suggestion
2017-12-14 13:43:21 -08:00
CI
76283dd6ae fnserver: 0.3.238 release [skip ci] 2017-12-14 21:27:07 +00:00
Tolga Ceylan
eccce881a6 fn: exclude timeouts from failed error count (#590)
* fn: exclude timeouts from failed error count
2017-12-14 13:10:07 -08:00
CI
e1b6212d28 fnserver: 0.3.237 release [skip ci] 2017-12-14 15:42:55 +00:00
CI
20b73b3452 fnserver: 0.3.236 release [skip ci] 2017-12-14 00:47:58 +00:00
Reed Allman
fab788b539 makes span use init() to run before server.New (#597) 2017-12-13 16:31:19 -08:00
CI
4f7ccab0eb fnserver: 0.3.235 release [skip ci] 2017-12-13 18:44:33 +00:00
Dario Domizioli
6ba8bf4488 Change runner api env var to FN_RUNNER_API_URL (#592) 2017-12-13 10:28:19 -08:00
CI
1aed099d7d fnserver: 0.3.234 release [skip ci] 2017-12-13 00:13:18 +00:00
Reed Allman
bb92547b95 Hybrid plumby (#585)
* fix configuration of agent and server to be future proof and plumb in the hybrid client agent

* fixes up the tests, turns off /r/ on api nodes

* fix up defaults for runner nodes

* shove the runner async push code down into agent land to use client

* plumb up async-age

* return full call from async dequeue endpoint, since we're storing a whole
call in the MQ we don't need to worry about caching of app/route [for now]
* fast safe shutdown of dequeue looper in runner / tidying of agent
* nice errors for path not found against /r/, /v1/ or other path not found
* removed some stale TODO in agent
* mq backends are only loud mouths in debug mode now

* update tests

* Add caching to hybrid client

* Fix HTTP error handling in hybrid client.

The type switch was on the value rather than a pointer.

* Gofmt.

* Better caching with a nice caching wrapper

* Remove datastore cache which is now unused

* Don't need to manually wrap interface methods

* Go fmt
2017-12-12 15:54:55 -08:00
CI
9643e38f5d fnserver: 0.3.233 release [skip ci] 2017-12-12 20:25:06 +00:00
CI
ef735aeb47 fnserver: 0.3.232 release [skip ci] 2017-12-12 20:19:25 +00:00
Tolga Ceylan
b0937f236f fn: headroom error case to clarify OOM (#589) 2017-12-12 12:02:12 -08:00
CI
034b507e65 fnserver: 0.3.231 release [skip ci] 2017-12-12 18:21:48 +00:00
CI
9234bdff96 fnserver: 0.3.230 release [skip ci] 2017-12-12 18:01:11 +00:00
CI
85d5291f0f fnserver: 0.3.229 release [skip ci] 2017-12-11 18:59:51 +00:00
Reed Allman
2ebc9c7480 hybrid mergy (#581)
* so it begins

* add clarification to /dequeue, change response to list to future proof

* Specify that runner endpoints are also under /v1

* Add a flag to choose operation mode (node type).

This is specified using the `FN_NODE_TYPE` environment variable. The
default is the existing behaviour, where the server supports all
operations (full API plus asynchronous and synchronous runners).

The additional modes are:
* API - the full API is available, but no functions are executed by the
  node. Async calls are placed into a message queue, and synchronous
  calls are not supported (invoking them results in an API error).
* Runner - only the invocation/route API is present. Asynchronous and
  synchronous invocation requests are supported, but asynchronous
  requests are placed onto the message queue, so might be handled by
  another runner.

* Add agent type and checks on Submit

* Sketch of a factored out data access abstraction for api/runner agents

* Fix tests, adding node/agent types to constructors

* Add tests for full, API, and runner server modes.

* Added atomic UpdateCall to datastore

* adds in server side endpoints

* Made ServerNodeType public because tests use it

* Made ServerNodeType public because tests use it

* fix test build

* add hybrid runner client

pretty simple go api client that covers surface area needed for hybrid,
returning structs from models that the agent can use directly. not exactly
sure where to put this, so put it in `/clients/hybrid` but maybe we should
make `/api/runner/client` or something and shove it in there. want to get
integration tests set up and use the real endpoints next and then wrap this up
in the DataAccessLayer stuff.

* gracefully handles errors from fn
* handles backoff & retry on 500s
* will add to existing spans for debuggo action

* minor fixes

* meh
2017-12-11 10:43:19 -08:00
CI
eb39c22bf5 fnserver: 0.3.228 release [skip ci] 2017-12-07 14:13:52 +00:00