Commit Graph

2506 Commits

Author SHA1 Message Date
CI
6f3237585d fnserver: 0.3.329 release [skip ci] 0.3.329 2018-02-09 21:30:52 +00:00
Tolga Ceylan
bed3b5ddff fn: more functionality into fn-test-utils (#752)
read/write a file on disk, alloc/leak memory.
2018-02-09 13:23:40 -08:00
Reed Allman
27179ddf54 plumb ctx for container removal spanno (#750)
these were just dangling off on the side, took some plumbing work but not so
bad
2018-02-08 22:48:23 -08:00
Owen Strain
c36c627b93 Trivial fix to get 'make test' working on Mac (#749)
Apparently GNU find lets you omit the directory but BSD find does not.
2018-02-08 17:52:17 -08:00
CI
aea3bab95e fnserver: 0.3.328 release [skip ci] 0.3.328 2018-02-09 01:23:22 +00:00
Reed Allman
3ab49d4701 limit log size in containers (#748)
closes #317

we could fiddle with this, but we need to at least bound these. this
accomplishes that. 1m is picked since that's our default max log size for the
time being per call, it also takes a little time to generate that many bytes
through logs, typically (i.e. without trying to). I tested with 0, which
spiked the i/o rate on my machine because it's constantly deleting the json
log file. I also tested with 1k and it was similar (for a task that generated
about 1k in logs quickly) -- in testing, this halved my throughput, whereas
using 1m did not change the throughput at all. trying the 'none' driver and
'syslog' driver weren't great, 'none' turns off all stderr and 'syslog' blocks
every log line (boo). anyway, this option seems to have no affect on the
output we get in 'attach', which is what we really care about (i.e. docker is
not logically capping this, just swapping out the log file).

using 1m for this, e.g. if we have 500 hot containers on a machine we have
potentially half a gig of worthless logs laying around. we don't need the
docker logs laying around at all really, but short of writing a storage driver
ourselves there don't seem to be too many better options. open to idears, but
this is likely to hold us over for some time.
2018-02-08 17:16:26 -08:00
CI
6c62bdb18a fnserver: 0.3.327 release [skip ci] 0.3.327 2018-02-08 01:29:10 +00:00
Tolga Ceylan
f27d47f2dd Idle Hot Container Freeze/Preempt Support (#733)
* fn: freeze/unfreeze and eject idle under resource contention
2018-02-07 17:21:53 -08:00
CI
105947d031 fnserver: 0.3.326 release [skip ci] 0.3.326 2018-02-08 00:56:39 +00:00
Tolga Ceylan
dc4d90432b fn: memory limit adjustments (#746)
1) limit kernel memory which was previously unlimited, using
   same limits as user memory for a unified approach.
2) disable swap memory for containers
2018-02-07 16:48:52 -08:00
Chad Arimura
8b6102f139 Update README.md 2018-02-07 08:02:35 -08:00
CI
8f70b622cc fnserver: 0.3.325 release [skip ci] 0.3.325 2018-02-07 00:24:19 +00:00
Tolga Ceylan
ebc6657071 fn: docker version check2 (#744)
1) now required docker version is 17.06
2) enable circle ci latest docker install
3) docker driver & agent check minimum version before start
2018-02-06 16:16:40 -08:00
CI
640a47fe55 fnserver: 0.3.324 release [skip ci] 0.3.324 2018-02-06 00:23:02 +00:00
Tolga Ceylan
15c0d7a99f fn: fn-test-utils fdk-go dep update (#743) 2018-02-05 16:16:45 -08:00
CI
4d802acc83 fnserver: 0.3.323 release [skip ci] 0.3.323 2018-02-05 20:00:05 +00:00
Reed Allman
235cbc2d67 Fix default setting (#740)
* push validate/defaults into datastore

we weren't setting a timestamp in route insert when we needed to create an app
there. that whole thing isn't atomic, but this fixes the timestamp issue.

closes #738

seems like we should do similar with the FireBeforeX stuff too.

* fix tests

* app name validation was buggy, an upper cased letter failed. now it doesn't.
uses unicode now.
* removes duplicate errors for datastore and models validation that were used
interchangably but weren't.
2018-02-05 11:54:09 -08:00
CI
b49f332e01 fnserver: 0.3.322 release [skip ci] 0.3.322 2018-02-05 19:18:17 +00:00
Tolga Ceylan
fdf5a67f6f fn: error image is now deprecated (#737)
Please use fn-test-utils instead for testing.
2018-02-05 11:12:27 -08:00
CI
18cbf440bd fnserver: 0.3.321 release [skip ci] 0.3.321 2018-02-05 18:07:23 +00:00
Tolga Ceylan
6b5486c699 fn: sleeper image is now deprecated (#736)
Please use fn-test-utils instead for testing.
2018-02-05 10:01:11 -08:00
CI
f76648a18a fnserver: 0.3.320 release [skip ci] 0.3.320 2018-02-05 16:14:17 +00:00
Nigel Deakin
afe9ba2c36 Update README.md (#730) 2018-02-06 00:08:36 +08:00
CI
606813a35f fnserver: 0.3.319 release [skip ci] 0.3.319 2018-02-05 15:57:15 +00:00
Nigel Deakin
5089dd6119 Extend /stats API to handle two routes with the same path in different apps (#735)
* Extend deprecated /stats API to handle apps and paths correctly

* More changes (bugfixes) to the JSON structure returned by the stats API call
2018-02-05 15:51:53 +00:00
CI
ac4dfa6077 fnserver: 0.3.318 release [skip ci] 0.3.318 2018-02-01 15:31:13 +00:00
jan grant
55e5d9665d Actually build the final docker image before release! (#732) 2018-02-01 15:25:45 +00:00
jan grant
552d8dd430 Nitfix: dropped a line during rebase :-( (#731) 2018-02-01 15:02:16 +00:00
jan grant
025e598c4b Selective releasing (#708)
* Rejig the build process

During a build, we check and rebuild any dependencies prior to
potentially using them.

Build:
- DIND (this only produces a new docker image, no local code changes)
- fnserver (built as part of the testing)

On master, if everything works, then we release the built artifacts,
if necessary:
- DIND (this pushes a docker image and a tag)
- fnserver (this builds the docker image and releases it, if necessary).

Fnserver is dealt with last by the release script: all previous steps
in CI use locally-run go tests rather than a docker file.

When a commit happens, we need to know (a) if we need to rebuild
a set of tools and artifacts (or whether we can continue to use
published ones); and (b) if we need to release new versions of
those tools, if all tests pass.

We do this by identifying the previous release tag on origin/master
(which is the release branch), then checking for changes between
that point at the current one.

Those changes may appear in various places in the tree: some simple
boolean rules work out whether the change means we need to rebuild
and rerelease.

* Make the fnproject/fnserver build use the latest dind

As docker bumps from 17.12.x, use whatever dind we just built.

* Use bash
dind-0.0.1
2018-02-01 12:43:43 +00:00
CI
45675bc36d fnserver: 0.3.317 release [skip ci] 0.3.317 2018-02-01 01:30:56 +00:00
Reed Allman
3b261fc144 pipe swapparoo each slot (#721)
* pipe swapparoo each slot

previously, we made a pair of pipes for stdin and stdout for each container,
and then handed them out to each call (slot) to use. this meant that multiple
calls could have a handle on the same stdin pipe and stdout pipe to read/write
to/from from fn's perspective and could mix input/output and get garbage. this
also meant that each was blocked on the previous' reads.

now we make a new pipe every time we get a slot, and swap it out with the
previous ones. calls are no longer blocked from fn's perspective, and we don't
have to worry about timing out dispatch for any hot format. there is still the
issue that if a function does not finish reading the input from the previous
task, from its perspective, and reads the next call's it can error out the
second call. with fn deadline we provide the necessary tools to skirt this,
but without some additional coordination am not sure this is a closable hole
with our current protocols since terminating a previous calls input requires
some protocol specific bytes to go in (json in particular is tricky). anyway,
from fn's side fixing pipes was definitely a hole, but this client hole is
still hanging out. there was an attempt to send an io.EOF but the issue is
that will shut down docker's read on the stdin pipe (and the container). poop.

this adds a test for this behavior, and makes sure 2 containers don't get
launched.

this also closes the response writer header race a little, but not entirely, I
think there's still a chance that we read a full response from a function and
get a timeout while we're changing the headers. I guess we need a thread safe
header bucket, otherwise we have to rely on timings (racy). thinking on it.

* fix stats mu race
2018-01-31 17:25:24 -08:00
CI
4e989b0789 fnserver: 0.3.316 release [skip ci] 0.3.316 2018-01-31 12:32:20 +00:00
Dario Domizioli
e753732bd8 Hot protocols improvements (for 662) (#724)
* Improve deadline handling in streaming protocols

* Move special headers handling down to the protocols

* Adding function format documentation for JSON changes

* Add tests for request url and method in JSON protocol

* Fix  protocol missing fn-specific info

* Fix import

* Add panic for something that should never happen
2018-01-31 12:26:43 +00:00
CI
02c8aa1998 fnserver: 0.3.315 release [skip ci] 0.3.315 2018-01-31 12:13:33 +00:00
Dario Domizioli
e2dad00a83 Add simple test for calling several hot functions in parallel (#675)
* Add test for calling several hot functions in parallel
2018-01-31 12:08:05 +00:00
CI
5f8736500d fnserver: 0.3.314 release [skip ci] 0.3.314 2018-01-26 20:26:48 +00:00
Tolga Ceylan
97d78c584b fn: better slot/container/request state tracking (#719)
* fn: better slot/container/request state tracking
2018-01-26 12:21:11 -08:00
CI
a7223437df fnserver: 0.3.313 release [skip ci] 0.3.313 2018-01-24 17:36:52 +00:00
Travis Reeder
7ace234848 Cleaned up main readme a bit (#693)
* Cleaned up main readme a bit

* Update README.md
2018-01-24 09:31:28 -08:00
CI
cc4c157d56 fnserver: 0.3.312 release [skip ci] 0.3.312 2018-01-24 15:43:41 +00:00
Chad Arimura
43c9c5a5c5 remove some old non-fn assets that snuck in (#718) 2018-01-24 07:38:04 -08:00
CI
665997078e fnserver: 0.3.311 release [skip ci] 0.3.311 2018-01-24 03:57:41 +00:00
Reed Allman
bbd50a0e02 additional ctx spans / maid service (#716)
* add spans to async

* clean up / add spans to agent

* there were a few methods which had multiple contexts which existed in the same
scope (this doesn't end well, usually), flattened those out.
* loop bound context cancels now rely on defer (also was brittle)
* runHot had a lot of ctx shuffling, flattened that.
* added some additional spans in certain paths for added granularity
* linked up the hot launcher / run hot / wait hot to _a_ root span, the first
2 are follows from spans, but at least we can see the source of these and also
can see containers launched over a hot launcher's lifetime

I left TODO around the FollowsFrom because OpenCensus doesn't, at least at the
moment, appear to have any idea of FollowsFrom and it was an extra OpenTracing
method (we have to get the span out, start a new span with the option, then
add it to the context... some shuffling required). anyway, was on the fence
about adding at least.

* resource waiters need to manage their own goroutine lifecycle

* if we get an impossible memory request, bail instead of infinite loop

* handle timeout slippery case

* still sucks, but hotLauncher doesn't leak anything. even the time.After timer goroutines

* simplify GetResourceToken

GetCall can guard against the impossible to allocate resource tasks entering
the system by erroring instead of doling them out. this makes GetResourceToken
logic more straightforward for callers, who now simply have the contract that
they won't ever get a token if they let tasks into the agent that can't run
(but GetCall guards this, and there's a test for it).

sorry, I was going to make this only do that, but when I went to fix up the
tests, my last patch went haywire so I fixed that too. this also at least
tries to simplify the hotLaunch loop, which will now no longer leak time.After
timers (which were long, and with signaller, they were many -- I got a stack
trace :) -- this breaks out the bottom half of the logic to check to see if we
need to launch into its own function, and handles the cleaning duties only in
the caller instead of in 2 different select statements. played with this a
bit, no doubt further cleaning could be done, but this _seems_ better.

* fix vet

* add units to exported method contract docs

* oops
2018-01-23 19:52:22 -08:00
CI
ccd95b6f72 fnserver: 0.3.310 release [skip ci] 0.3.310 2018-01-24 03:35:45 +00:00
Tolga Ceylan
ee59361bda fn: added server too busy stats (#717) 2018-01-23 19:30:01 -08:00
CI
6873ed1fc1 fnserver: 0.3.309 release [skip ci] 0.3.309 2018-01-23 21:20:57 +00:00
Denis Makogon
a70c038760 New deps (#715) 2018-01-23 13:15:11 -08:00
CI
5fc01d6974 fnserver: 0.3.308 release [skip ci] 0.3.308 2018-01-22 22:23:01 +00:00
Denis Makogon
d3be603e54 Fnlb was moved to its own repo: fnproject/lb (#702)
* Fnlb was moved to its own repo: fnproject/lb

* Clean up fnlb leftovers

* Newer deps
2018-01-22 14:17:29 -08:00
CI
4ffa3d5005 fnlb: 0.0.268 release [skip ci] fnlb-0.0.268 2018-01-22 20:11:11 +00:00