Commit Graph

1230 Commits

Author SHA1 Message Date
CI
4d7c951f76 fnserver: 0.3.305 release [skip ci] 2018-01-22 17:02:09 +00:00
Nigel Deakin
e1df053de9 Change timedout to timeouts (#709) 2018-01-22 16:55:30 +00:00
CI
5c7a21b59e fnserver: 0.3.304 release [skip ci] 2018-01-19 20:43:29 +00:00
Tolga Ceylan
8c31e47c01 fn: agent slot improvements (#704)
*) Stopped using latency previous/current stats, this
was not working as expected. Fresh starts usually have
these stats zero for a long time, and initial samples
are high due to downloads, caches, etc.

*) New state to track: containers that are idle. In other
words, containers that have an unused token in the slot
queue.

*) Removed latency counts since these are not used in
container start decision anymore. Simplifies logs.

*) isNewContainerNeeded() simplified to use idle count
to estimate effective waiters. Removed speculative
latency based logic and progress check comparison.
In agent, waitHot() delayed signalling compansates
for these changes. If the estimation may fail, but
this should correct itself in the next 200 msec
signal.
2018-01-19 12:35:52 -08:00
CI
31fd1276fb fnserver: 0.3.303 release [skip ci] 2018-01-19 18:09:40 +00:00
CI
1549534c3c fnserver: 0.3.302 release [skip ci] 2018-01-19 03:45:21 +00:00
Tolga Ceylan
2f0de2b574 fn: resource and slot cancel and broadcast improvements (#696)
* fn: resource and slot cancel and broadcast improvements

*) Context argument does not wake up the waiters correctly upon
cancellation/timeout.
*) Avoid unnecessary broadcasts in slot and resource.

* fn: limit scope of context in resource/slot calls in agent
2018-01-18 13:43:56 -08:00
Reed Allman
c9e995292c if a slot is available, don't launch more (#701)
since we were sending a signal before checking if a slot was available, even
in the case of serial calls locally I was seeing 2 containers launch. if we
only send a signal after first checking if a slot is available, this goes
away. 1 usec should not be too offensive of an additional wait, all things
considered here.
2018-01-18 13:19:25 -08:00
CI
3e2debae07 fnserver: 0.3.301 release [skip ci] 2018-01-18 00:16:12 +00:00
Tolga Ceylan
5a7778a656 fn: cancellations in WaitAsyncResource (#694)
* fn: cancellations in WaitAsyncResource

Added go context with cancel to wait async resource. Although
today, the only case for cancellation is shutdown, this cleans
up agent shutdown a little bit.

* fn: locked broadcast to avoid missed wake-ups

* fn: removed ctx arg to WaitAsyncResource and startDequeuer

This is confusing and unnecessary.
2018-01-17 16:08:54 -08:00
CI
65592c9d26 fnserver: 0.3.300 release [skip ci] 2018-01-17 15:23:53 +00:00
CI
88072eba6e fnserver: 0.3.299 release [skip ci] 2018-01-16 22:52:35 +00:00
CI
f0aeb815b6 fnserver: 0.3.298 release [skip ci] 2018-01-15 16:42:49 +00:00
CI
02768f6539 fnserver: 0.3.297 release [skip ci] 2018-01-15 14:56:00 +00:00
Nigel Deakin
8bf26efa29 Add new Prom metrics fn_timeout and fn_errors (#679)
* Add new Prom metric fn_timedout

* Add new Prometheus metric fn_errors

* Tidy up variable name

* Add new Prometheus metric fn_errors

* gofmt
2018-01-15 14:49:33 +00:00
CI
ea97bea22e fnserver: 0.3.296 release [skip ci] 2018-01-15 10:48:20 +00:00
Gerardo Viedma
966ce58525 Use new metrics API for s3 log metrics (#680)
* use new metrics API for histogram metrics

* Avoid creating an extra tracing span

* use new metrics api for histograms

* fix minor formatting issue
2018-01-15 10:09:03 +00:00
CI
9678ca4735 fnserver: 0.3.295 release [skip ci] 2018-01-12 22:56:37 +00:00
CI
23b267b208 fnserver: 0.3.294 release [skip ci] 2018-01-12 22:03:11 +00:00
Reed Allman
0bde666395 clean up agent.Submit (#681)
this was getting bloated with various contexts and spans and stats
administrivia that obfuscated what was going on a lot. this makes some helper
methods to shove most of that stuff into, and simplifies the context handling
around getting a slot by moving it inside of slot acquisition code. also
removed most uses of `call.Model()` -- I'll kill this thing some day, but if a
reason is needed, then the overhead of dynamic dispatch is unnecessary, we're
inside of the implementee for the agent, we don't want to use the interface
methods inside of that.
2018-01-12 13:56:17 -08:00
CI
342460f242 fnserver: 0.3.293 release [skip ci] 2018-01-12 19:45:33 +00:00
Tolga Ceylan
39b2cb2d9b Cpu resources (#642)
* fn: cpu quota implementation
2018-01-12 11:38:28 -08:00
CI
5d500124e0 fnserver: 0.3.292 release [skip ci] 2018-01-12 00:07:38 +00:00
Tolga Ceylan
1c8029e4f1 fn: more tests for hot container launch logic (#678) 2018-01-11 16:00:37 -08:00
CI
7693c6f9d1 fnserver: 0.3.291 release [skip ci] 2018-01-11 22:16:17 +00:00
Tolga Ceylan
db159e595f fn: new container lauch adjustments (#677)
*) revert executor wait queue size comparison. This is too
   aggresive and with stall check below, now unnecessary.
*) new container logic now checks if stats are constant, if
   this is the case, then we assume the system is stalled (eg
   running functions that take long time), this means we need
   to make progress and spin up a new container.
2018-01-11 14:09:21 -08:00
CI
25e8ce34b7 fnserver: 0.3.290 release [skip ci] 2018-01-11 19:20:58 +00:00
CI
6c2cfa155a fnserver: 0.3.289 release [skip ci] 2018-01-11 17:41:33 +00:00
Nigel Deakin
ac2bfd3462 Change basic stats to use opentracing rather than Prometheus API (#671)
* Change basic stats to use opentracing rather than Prometheus API directly

* Just ran gofmt

* Extract opentracing access for metrics to common/metrics.go

* Replace quotes strings with constants where possible
2018-01-11 17:34:51 +00:00
CI
9b6cdd8009 fnserver: 0.3.288 release [skip ci] 2018-01-11 01:02:43 +00:00
CI
b19e147c2f fnserver: 0.3.287 release [skip ci] 2018-01-10 22:21:02 +00:00
Tolga Ceylan
7c91b98a72 fn: hot container launcher adjustment (#673)
Latency stats are not always read-time updated and
if calls are stuck in waiting state, isNewContainerNeeded()
needs to be a bit more aggresive if the wait queue grows.
2018-01-10 14:14:19 -08:00
CI
797e4c65c0 fnserver: 0.3.286 release [skip ci] 2018-01-10 21:22:00 +00:00
Tolga Ceylan
23ae1fe723 fn: removed dead code (#672) 2018-01-10 12:32:19 -08:00
CI
fe31401335 fnserver: 0.3.285 release [skip ci] 2018-01-10 17:51:20 +00:00
Gerardo Viedma
60d2e92c9a Replace minio-go with aws-sdk-go for s3-compatible log backend (#670)
* Logs should support specifying region when using S3-compatible object store

* Use aws-sdk-go client for s3 backed logstore

* fixes vendor with aws-sdk-go dependencies
2018-01-10 09:44:04 -08:00
CI
d02d59b979 fnserver: 0.3.284 release [skip ci] 2018-01-10 17:29:52 +00:00
CI
e442c7f3e4 fnserver: 0.3.283 release [skip ci] 2018-01-09 23:40:11 +00:00
CI
9eb5212d0d fnserver: 0.3.282 release [skip ci] 2018-01-09 22:34:23 +00:00
Reed Allman
24aa911609 add FN_LOG_DEST for logs, fixup init (#663)
* add FN_LOG_DEST for logs, fixup init

* FN_LOG_DEST can point to a remote logging place (papertrail, whatever)
* FN_LOG_PREFIX can add a prefix onto each log line sent to FN_LOG_DEST

default remains stderr with no prefix. users need this to send to various
logging backends, though it could be done operationally, this is somewhat
simpler.

we were doing some configuration stuff inside of init() for some of the global
things. even though they're global, it's nice to keep them all in the normal
server init path.

we have had strange issues with the tracing setup, I tested the last repro of
this repeatedly and didn't have any luck reproducing it, though maybe it comes
back.

* add docs
2018-01-09 14:27:50 -08:00
CI
874f826288 fnserver: 0.3.281 release [skip ci] 2018-01-09 22:17:29 +00:00
Travis Reeder
3b9818bc58 Switch to dep from glide (#664) 2018-01-09 14:11:08 -08:00
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