Commit Graph

2585 Commits

Author SHA1 Message Date
Dario Domizioli
27ffb561e8 Hide details of delegated agents for PR and LB, to disable docker for LB (#872)
* Move delegated agent creation within NewLBAgent so we can hide the fact we disable docker
* Move delegated agent creation within NewPureRunner for better encapsulation
2018-03-20 13:45:45 +00:00
CI
38eebf69cd fnserver: 0.3.382 release [skip ci] 0.3.382 2018-03-19 12:19:38 +00:00
Shaun Smith
795f37f1bd Fix to broken CLI link. (#868)
* Fix to broken CLI link.

* Point to install CLI link in the Fn readme file
2018-03-19 17:42:18 +05:30
CI
a13960f6cd fnserver: 0.3.381 release [skip ci] 0.3.381 2018-03-16 15:48:46 +00:00
Gerardo Viedma
1cae6f988e Make PKI data and RunnerFactory public objects (#865)
* Make PKI data and RunnerFactory public objects

* removes unnecessary nullRunner object

* renames secure factory to point out MTLS
2018-03-16 15:40:58 +00:00
CI
62de4a5c9a fnserver: 0.3.380 release [skip ci] 0.3.380 2018-03-16 13:53:35 +00:00
Gerardo Viedma
73ae77614c Moves out node pool manager behind an extension using runner pool abstraction (Part 2) (#862)
* Move out node-pool manager and replace it with RunnerPool extension

* adds extension points for runner pools in load-balanced mode

* adds error to return values in RunnerPool and Runner interfaces

* Implements runner pool contract with context-aware shutdown

* fixes issue with range

* fixes tests to use runner abstraction

* adds empty test file as a workaround for build requiring go source files in top-level package

* removes flappy timeout test

* update docs to reflect runner pool setup

* refactors system tests to use runner abstraction

* removes poolmanager

* moves runner interfaces from models to api/runnerpool package

* Adds a second runner to pool docs example

* explicitly check for request spillover to second runner in test

* moves runner pool package name for system tests

* renames runner pool pointer variable for consistency

* pass model json to runner

* automatically cast to http.ResponseWriter in load-balanced call case

* allow overriding of server RunnerPool via a programmatic ServerOption

* fixes return type of ResponseWriter in test

* move Placer interface to runnerpool package

* moves hash-based placer out of open source project

* removes siphash from Gopkg.lock
2018-03-16 13:46:21 +00:00
CI
1a390dc067 fnserver: 0.3.379 release [skip ci] 0.3.379 2018-03-16 11:58:14 +00:00
Dario Domizioli
362e910d9d Make dataplane system test behave deterministically (#849)
Make dataplane system test deterministic by injecting capacity constraints
2018-03-16 11:50:44 +00:00
CI
9ed3dd86ea fnserver: 0.3.378 release [skip ci] 0.3.378 2018-03-15 17:32:10 +00:00
Tolga Ceylan
1b6f8cb24a fn: add docker-containerd to prometheus processes (#863)
*) switch to /proc/<pid>/cmdline due to /proc/<pid>/status
process name truncation.
*) Optional override with FN_PROCESS_COLLECTOR_LIST
2018-03-15 10:24:27 -07:00
CI
a7743a03ea fnserver: 0.3.377 release [skip ci] 0.3.377 2018-03-15 10:36:17 +00:00
Gerardo Viedma
6bc1220d8b Adds extension points for runner pools in load-balanced mode (Patch 1/2) (#851)
* adds extension points for runner pools in load-balanced mode

* adds error to return values in RunnerPool and Runner interfaces
2018-03-15 10:28:56 +00:00
CI
7df6863678 fnserver: 0.3.376 release [skip ci] 0.3.376 2018-03-14 22:56:10 +00:00
Tolga Ceylan
cb61a678d9 fn: add storage opt size support (#860)
Added env FN_MAX_FS_SIZE_MB, which if defined and non-zero
is passed to docker as storage opt size. We do not validate
if this option is supported by docker currently. This is
because it's difficult to actually validate this since it
not only depends on storage driver and its backing filesystem,
but also the mount options used to mount that fs.
2018-03-14 15:47:34 -07:00
Tolga Ceylan
b74db6762b fn: remove pre go 1.10 optimization of build install (#859)
This speeded up tests before go 1.10 improvements, but
also clashed with fn cli tool, which gets installed as 'fn'.
2018-03-14 14:14:31 -07:00
CI
603af80bd1 fnserver: 0.3.375 release [skip ci] 0.3.375 2018-03-14 16:26:02 +00:00
Tolga Ceylan
7b5b091698 fn: update fn dependencies for go 1.10 (#856) 2018-03-14 09:18:30 -07:00
CI
70af65d35a fnserver: 0.3.374 release [skip ci] 0.3.374 2018-03-14 16:05:51 +00:00
Faiq Raza
e02a2e08d9 Remove refs to vbox and just use vagrant (#852) 2018-03-14 08:56:17 -07:00
Sachin Pikle
b41f320284 Updated Tutorials link (#857)
Changed from fnproject.com to fnproject.io
2018-03-14 08:11:10 -07:00
CI
0f5afa3970 fnserver: 0.3.373 release [skip ci] 0.3.373 2018-03-14 01:46:37 +00:00
Tolga Ceylan
74a51f3f88 fn: reorg agent config (#853)
* fn: reorg agent config

*) Moving constants in agent to agent config, which helps
with testing, tuning.
*) Added max total cpu & memory for testing & clamping max
mem & cpu usage if needed.

* fn: adjust PipeIO time
* fn: for hot, cannot reliably test EndOfLogs in TestRouteRunnerExecution
2018-03-13 18:38:47 -07:00
CI
1988d92c83 fnserver: 0.3.372 release [skip ci] 0.3.372 2018-03-13 23:05:04 +00:00
Reed Allman
9eaf824398 add jaeger support, link hot container & req span (#840)
* add jaeger support, link hot container & req span

* adds jaeger support now with FN_JAEGER_URL, there's a simple tutorial in the
operating/metrics.md file now and it's pretty easy to get up and running.
* links a hot request span to a hot container span. when we change this to
sample at a lower ratio we'll need to finagle the hot container span to always
sample or something, otherwise we'll hide that info. at least, since we're
sampling at 100% for now if this is flipped on, can see freeze/unfreeze etc.
if they hit. this is useful for debugging. note that zipkin's exporter does
not follow the link at all, hence jaeger... and they're backed by the Cloud
Empire now (CNCF) so we'll probably use it anyway.

* vendor: add thrift for jaeger
2018-03-13 15:57:12 -07:00
CI
a7347a88b7 fnserver: 0.3.371 release [skip ci] 0.3.371 2018-03-13 22:52:34 +00:00
Reed Allman
7fbbd75349 fn, dockerd pid collector & go collector metrics (#837)
* fn, dockerd pid collector & go collector metrics

the prometheus client we're using has a nice collector for process metrics and
for go metrics. these are things we are very interested in operationally and
recently the benevolent team at opencensus made this possible again, so this
hooks it up for us with added dockerd sugar.

nannying the dockerd we're using should be super useful since that thing likes
to get carried away, it'll be nice to differentiate memory/cpu usage between
dockerd  / the host / fn. this will basically only work in a 'dind'
environment, or on a linux host that is running fn outside of docker that is
configured with the permissions to be able to check this.  otherwise, it will
simply fail. we also probably want disk i/o and net i/o information for that
as well, or at least it would be interesting to differentiate from the host,
but this isn't hooked up in the default collectors unfortunately.

dockerd:

```
dockerd_process_cpu_seconds_total 520.74
dockerd_process_max_fds 1.048576e+06
dockerd_process_resident_memory_bytes 9.033728e+07
dockerd_process_start_time_seconds 1.52029677322e+09
dockerd_process_virtual_memory_bytes 1.782509568e+09
```

fn:

```
fn_process_cpu_seconds_total 0.14
fn_process_max_fds 1024
fn_process_open_fds 12
fn_process_resident_memory_bytes 2.7348992e+07
fn_process_start_time_seconds 1.52056274238e+09
fn_process_virtual_memory_bytes 7.20068608e+08
```

go:

```
go_gc_duration_seconds{quantile="0"} 4.4194e-05
go_gc_duration_seconds{quantile="0.25"} 9.8118e-05
go_gc_duration_seconds{quantile="0.5"} 0.000105989
go_gc_duration_seconds{quantile="0.75"} 0.000106251
go_gc_duration_seconds{quantile="1"} 0.000157864
go_gc_duration_seconds_sum 0.000512416
go_gc_duration_seconds_count 5
go_goroutines 30
go_memstats_alloc_bytes 3.897696e+06
go_memstats_alloc_bytes_total 1.2916016e+07
go_memstats_buck_hash_sys_bytes 1.45034e+06
go_memstats_frees_total 75399
go_memstats_gc_sys_bytes 450560
go_memstats_heap_alloc_bytes 3.897696e+06
go_memstats_heap_idle_bytes 868352
go_memstats_heap_inuse_bytes 5.750784e+06
go_memstats_heap_objects 29925
go_memstats_heap_released_bytes_total 0
go_memstats_heap_sys_bytes 6.619136e+06
go_memstats_last_gc_time_seconds 1.520562751182639e+09
go_memstats_lookups_total 239
go_memstats_mallocs_total 105324
go_memstats_mcache_inuse_bytes 3472
go_memstats_mcache_sys_bytes 16384
go_memstats_mspan_inuse_bytes 90592
go_memstats_mspan_sys_bytes 98304
go_memstats_next_gc_bytes 6.31304e+06
go_memstats_other_sys_bytes 710548
go_memstats_stack_inuse_bytes 720896
go_memstats_stack_sys_bytes 720896
go_memstats_sys_bytes 1.0066168e+07
```

* cache pid until it stops working
2018-03-13 15:42:43 -07:00
CI
139f12b19b fnserver: 0.3.370 release [skip ci] 0.3.370 2018-03-13 21:42:32 +00:00
Faiq Raza
52adedad86 Update to plugin (#847)
* make vagrant stuff more pluginable

* Touch up vbox file

* Refactor plugins
2018-03-13 14:33:46 -07:00
CI
05c1bf1468 fnserver: 0.3.369 release [skip ci] 0.3.369 2018-03-13 21:21:32 +00:00
Reed Allman
4084b727c0 phase 2: mattes/migrate -> migratex (#848)
* move mattes migrations to migratex

* changes format of migrations to migratex format
* updates test runner to use new interface (double checked this with printlns,
the tests go fully down and then up, and work on pg/mysql)

* remove mattes/migrate

* update tests from deps

* update readme

* fix other file extensions
2018-03-13 14:12:34 -07:00
CI
1f43545b63 fnserver: 0.3.368 release [skip ci] 0.3.368 2018-03-13 15:59:47 +00:00
Dario Domizioli
2c8b02c845 Make PureRunner an Agent so that it encapsulates its grpc server (#834)
* Refactor PureRunner as an Agent so that it encapsulates its grpc server
* Maintain a list of extra contexts for the server to select on to handle errors and cancellations
2018-03-13 15:51:32 +00:00
CI
fa828c8770 fnserver: 0.3.367 release [skip ci] 0.3.367 2018-03-12 22:06:14 +00:00
Matt Stephenson
924fe2b72b Fix missing instructions for building noop.so (#846) 2018-03-12 14:57:56 -07:00
Matt Stephenson
a787ccac36 Refactor controlplane into a go plugin (#833)
* Refactor controlplane into a go plugin

* Move vbox to controlplane package
2018-03-12 12:50:55 -07:00
CI
ce4551e129 fnserver: 0.3.366 release [skip ci] 0.3.366 2018-03-12 18:26:32 +00:00
Tolga Ceylan
e80a06937b fn: timeouts and container exists should stop slot queuing (#843)
1) in theory it may be possible for an exited container to
requeue a slot, close this gap by always setting fatal error
for a slot if a container has exited.
2) when a client request times out or cancelled (client
disconnect, etc.) the slot should not be allowed to be
requeued and container should terminate to avoid accidental
mixing of previous response into next.
2018-03-12 11:18:55 -07:00
CI
080b46d4cb fnserver: 0.3.365 release [skip ci] 0.3.365 2018-03-12 17:39:55 +00:00
Reed Allman
96aa2a67ae phase 1 sqlx migrator (#825)
code is feature complete in the general sense, with minor TODO left.

this is just a patch with 'migratex' and does not use it for fn's migrations
yet, would like to get feedback prior to doing that.

presenting:

A migration library loosely based on pressly/goose and mattes/migrate design,
that does migrations across a smattering of sql databases by only accepting a
`*sqlx.DB`.

why?

* goose didn't support kindly allowing us to rebind transactions based on a
given db to various dialects or offer oracle support
* goose didn't support locking the db (maybe not needed with tx? it's late..
we may want to lock the whole db eventually?)
* goose requires us to do semi-complex migration to it from mattes/migrate
* mattes has stepped down as migrate maintainer and the project is in flux
* mattes/migrate did not allow us to define migrations in go and rebind to
different dialects, an issue since we need to insert ids in our own format and
can't define this in sql
* neither handled context plumbing and risked issues there for various
reasons (deadlock, etc).
* I think I'm forgetting 1 or 2

in the style of goose, this lets us define `*sqlx.Tx` up and down funcs in go
code, but uses mattes' migration table so we don't need to migrate that and
retains its lock behavior with added tx sugar and less errors. most
importantly, this code is terse, leveraging sqlx to support a lot of sql dbs
(unlike mattes) and we control this. there is one useful TODO to handle
migrations failing at startup more gracefully, in prod stuff like that will be
nice to have. open to discussion of putting in a separate library, the
landscape of go sql migrators is... really something.

TODO make test suite and test against sqlite3, pg, mysql [, oracledb] like we
have for our own unit tests. I'm thinking it's faster to wire up through
there and use our bevy of migrations?
2018-03-12 10:30:58 -07:00
CI
00eed1ef73 fnserver: 0.3.364 release [skip ci] 0.3.364 2018-03-12 17:26:33 +00:00
Tolga Ceylan
ea2b3f214c fn: enable log checks in runner test (#838) 2018-03-12 10:18:55 -07:00
CI
7ecba586d0 fnserver: 0.3.363 release [skip ci] 0.3.363 2018-03-12 13:44:52 +00:00
Andrea Rosa
3261e48843 Add a timeout to the net dialer (#844)
This change add the option to set a timeout for the dialer used in
making gRPC connection, with that we remove the check on the state of
the connections and therefore remove any potential race conditions.
2018-03-12 13:36:53 +00:00
CI
4f0c91b958 fnserver: 0.3.362 release [skip ci] 0.3.362 2018-03-12 09:46:34 +00:00
Andrea Rosa
43547a572f Check runner connection before sending requests (#831)
If a runner disconnect not gracefully it could happen that the
connection gets stuck in connecting mode, this change verifies the state
of the connection before starting to execute a call, if the client
connection is not ready we fail fast to give a change to the next runner
(if any) to execute the call.
2018-03-12 09:38:27 +00:00
CI
47383d9ff7 fnserver: 0.3.361 release [skip ci] 0.3.361 2018-03-10 00:59:59 +00:00
Dario Domizioli
9b28497cff Add a basic concurrency test for the dataplane system tests (#832)
Add a basic concurrency test for the dataplane system tests. Also remove some spurious logging.
2018-03-10 00:51:02 +00:00
Tolga Ceylan
e4cf74d2a3 fn: netcat must timeout if traffic is dropped at that port (#828) 2018-03-09 12:30:56 -08:00
Reed Allman
6967d0bfcb json format __definition__ omit whitespace between objects (#835)
http://json.org/ says: `Whitespace can be inserted between any pair of tokens. Excepting a few encoding details, that completely describes the language.`

we do not explicitly need the whitespace between objects in our json, it's entirely optional and soon we will even support it (#830)!
2018-03-09 12:06:31 -08:00