Commit Graph

1088 Commits

Author SHA1 Message Date
CI
97bdc5da4b fnserver: 0.3.280 release [skip ci] 2018-01-09 21:33:52 +00:00
Travis Reeder
82541d24ee wip (#665) 2018-01-09 13:27:38 -08:00
CI
360abceff5 fnserver: 0.3.279 release [skip ci] 2018-01-09 18:36:09 +00:00
CI
0fb40f6abf fnserver: 0.3.278 release [skip ci] 2018-01-09 18:14:47 +00:00
Reed Allman
20089c4e83 make headers quasi-consistent (#660)
possible breakages:

* `FN_HEADER` on cold are no longer `s/-/_/` -- this is so that cold functions
can rebuild the headers as they were when they came in on the request (fdks,
specifically), there's no guarantee that a reversal `s/_/-/` is the original
header on the request.
* app and route config no longer `s/-/_/` -- it seemed really weird to rewrite
the users config vars on these. should just pass them exactly as is to env.
* headers no longer contain the environment vars (previously, base config; app
config, route config, `FN_PATH`, etc.), these are still available in the
environment.

this gets rid of a lot of the code around headers, specifically the stuff that
shoved everything into headers when constructing a call to begin with. now we
just store the headers separately and add a few things, like FN_CALL_ID to
them, and build a separate 'config' now to store on the call. I thought
'config' was more aptly named, 'env' was confusing, though now 'config' is
exactly what 'base_vars' was, which is only the things being put into the env.
we weren't storing this field in the db, this doesn't break unless there are
messages in a queue from another version, anyway, don't think we're there and
don't expect any breakage for anybody with field name changes.

this makes the configuration stuff pretty straight forward, there's just two
separate buckets of things, and cold just needs to mash them together into the
env, and otherwise hot containers just need to put 'config' in the env, and then
hot format can shove 'headers' in however they'd like. this seems better than
my last idea about making this easier but worse (RIP).

this means:

* headers no longer contain all vars, the set of base vars can only be found
in the environment.
* headers is only the headers from request + call_id, deadline, method, url
* for cold, we simply add the headers to the environment, prepending
`FN_HEADER_` to them, BUT NOT upper casing or `s/-/_/`
* fixes issue where async hot functions would end up with `Fn_header_`
prefixed headers
* removes idea of 'base' vars and 'env'. this was a strange concept. now we just have
'config' which was base vars, and headers, which was base_env+headers; i.e.
they are disjoint now.
* casing for all headers will lean to be `My-Header` style, which should help
with consistency. notable exceptions for cold only are FN_CALL_ID, FN_METHOD,
and FN_REQUEST_URL -- this is simply to avoid breakage, in either hot format
they appear as `Fn_call_id` still.
* removes FN_PARAM stuff
* updated doc with behavior

weird things left:

`Fn_call_id` e.g. isn't a correctly formatted http header, it should likely be
`Fn-Call-Id` but I wanted to live to fight another day on this one, it would
add some breakage.

examples to be posted of each format below

closes #329
2018-01-09 10:08:30 -08:00
CI
b1bae08f7d fnserver: 0.3.277 release [skip ci] 2018-01-09 16:49:49 +00:00
Travis Reeder
580dd3e5cb Removes FN_PARAM_xxx (#661) 2018-01-09 16:42:25 +00:00
CI
e2c8eef3c2 fnserver: 0.3.276 release [skip ci] 2018-01-08 23:03:13 +00:00
CI
571add2235 fnserver: 0.3.275 release [skip ci] 2018-01-08 20:41:00 +00:00
Tolga Ceylan
18716911b9 fn: agent slot and execution wait correction (#658)
Since by policy we require timeout/2 remaining time
before we can execute the request, we should also
bound the slot wait time by timeout/2 to avoid
waiting for full timeout in slot wait phase.
2018-01-08 12:33:37 -08:00
CI
c66f668680 fnserver: 0.3.274 release [skip ci] 2018-01-08 18:35:45 +00:00
Tolga Ceylan
6f1f5e365d fn: URL parsing updates to fix json request_url (#657)
*) Updated fn-test-utils to latest fdk-go
*) Added hot-json to runner tests
*) Removed anon function in FromRequest which had
a side effect to set req.URL.Host. This is now more
explicit and eliminates some corresponding logic in
protocol http.
*) in gin, http request RequestURI is not set, removed
code that references this. (use Call.URL instead)
2018-01-08 10:28:50 -08:00
CI
89a4ad3cc2 fnserver: 0.3.273 release [skip ci] 2018-01-08 18:10:35 +00:00
Travis Reeder
5cdee5579d Fixes 404 responses from functions that go through NoRoute path. (#651)
* Fixes 404 responses from functions that go through NoRoute path.

* cleanup

* cleanupp

* fix link

* Rollback a bad change.
2018-01-08 10:03:33 -08:00
CI
798856c580 fnserver: 0.3.272 release [skip ci] 2018-01-06 02:04:56 +00:00
CI
5e09fb45ab fnserver: 0.3.271 release [skip ci] 2018-01-05 18:34:30 +00:00
Tolga Ceylan
7185f8306a fn: async wait bugfix and low mem warnings (#649)
*) fix async high water mark logic
*) warning on 256 mem for async and async+sync pools
2018-01-05 10:27:26 -08:00
CI
2c029e155b fnserver: 0.3.270 release [skip ci] 2018-01-05 17:41:18 +00:00
Gerardo Viedma
6b91351ed8 Logs should support specifying region when using S3-compatible object store (#645)
Logs should support specifying region when using S3-compatible object store
2018-01-05 17:34:32 +00:00
CI
503d596993 fnserver: 0.3.269 release [skip ci] 2018-01-04 21:10:29 +00:00
CI
c8ae56d285 fnserver: 0.3.268 release [skip ci] 2018-01-04 19:41:35 +00:00
Tolga Ceylan
14789aba41 Slot mgr fixes (#613)
*) during shutdown, errors should be 503
*) new inactivity time out for hot queue, we previously kept hot queues in memory forever.
*) each hot queue now has a hot launcher to monitor and launch hot containers
*) consumers now create a consumer channel with startDequeuer() that can be cancelled via context
*) consumers now ping (signal) hot launcher every 200 msecs until they get a slot
*) tests for slot queue & mgr
2018-01-04 11:34:43 -08:00
CI
5dd40ef045 fnserver: 0.3.267 release [skip ci] 2018-01-04 00:24:29 +00:00
CI
4599468017 fnserver: 0.3.266 release [skip ci] 2018-01-03 16:49:45 +00:00
Nigel Deakin
c0dec594ef Add calls metric (#637)
* Add new Prometheus metric fn_api_calls

* Change fn_api_calls to a counter
2018-01-03 10:42:37 -06:00
CI
76ca562b6d fnserver: 0.3.265 release [skip ci] 2018-01-02 22:54:57 +00:00
CI
746a2cf4cf fnserver: 0.3.264 release [skip ci] 2018-01-02 22:09:33 +00:00
Denis Makogon
60d2ca234f Ship call logs to the user as text/plain instead of JSON (#615)
* Ship call logs to the user as text/plain instead of JSON

* Fixing swagger doc

* c.String instead of c.JSON

* Make Logs API backward compatible

* Loop over accepted MIME types

* Bump swagger API version

* Fix client build script

 previous version was producing the following "couldn't find a swagger spec"

* Logs API regression test

* Write response body without buffering

* Switch JSON and text/plain cases

* Handle Accepted content types properly

* More solid response content type handling

* Write HTTP 406 with corresponding error body

* Remove unused import

* Use handleErrorResponse
2018-01-02 16:01:22 -06:00
CI
ee5092c247 fnserver: 0.3.263 release [skip ci] 2018-01-02 21:41:08 +00:00
CI
45dfb0d586 fnserver: 0.3.262 release [skip ci] 2018-01-02 21:24:03 +00:00
Tolga Ceylan
fe80b50e30 fn: tests: revert a hack for agent shutdown (#632)
Reverting due to fix for #623
2018-01-02 15:17:44 -06:00
CI
a49bd43cb2 fnserver: 0.3.261 release [skip ci] 2018-01-02 21:07:01 +00:00
CI
9dfb6a4561 fnserver: 0.3.260 release [skip ci] 2018-01-02 19:39:07 +00:00
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