Commit Graph

1418 Commits

Author SHA1 Message Date
CI
77f243bfaf fnserver: 0.3.479 release [skip ci] 2018-06-20 20:57:15 +00:00
CI
2d9a3f9444 fnserver: 0.3.478 release [skip ci] 2018-06-20 18:02:30 +00:00
Tolga Ceylan
bd7f67a74a fn: test scripts should use well defined ports (#1077)
* fn: test scripts should use well defined ports

Moved allocation of listener ports for mysql/minio/postgres
to helper script with a list of service list names.

* fn: makefile docker pull mysql version must match tests
2018-06-20 10:55:05 -07:00
CI
3fd6b6c1d8 fnserver: 0.3.477 release [skip ci] 2018-06-20 17:38:19 +00:00
CI
7637f53c26 fnserver: 0.3.476 release [skip ci] 2018-06-19 18:07:30 +00:00
Owen Cliffe
229353051f Mask DB password in logs (#1072) 2018-06-19 18:59:28 +01:00
CI
4bf23d8c1b fnserver: 0.3.475 release [skip ci] 2018-06-18 21:49:37 +00:00
Tolga Ceylan
e67d0e5f3f fn: Call extensions/overriding and more customization friendly docker driver (#1065)
In pure-runner and LB agent, service providers might want to set specific driver options.

For example, to add cpu-shares to functions, LB can add the information as extensions
to the Call and pass this via gRPC to runners. Runners then pick these extensions from
gRPC call and pass it to driver. Using a custom driver implementation, pure-runners can
process these extensions to modify docker.CreateContainerOptions.

To achieve this, LB agents can now be configured using a call overrider.

Pure-runners can be configured using a custom docker driver.

RunnerCall and Call interfaces both expose call extensions.

An example to demonstrate this is implemented in test/fn-system-tests/system_test.go
which registers a call overrider for LB agent as well as a simple custom docker driver.
In this example, LB agent adds a key-value to extensions and runners add this key-value
as an environment variable to the container.
2018-06-18 14:42:28 -07:00
CI
199827b319 fnserver: 0.3.474 release [skip ci] 2018-06-14 09:48:01 +00:00
Andrea Rosa
e637661ea2 Adding a way to inject a request ID (#1046)
* Adding a way to inject a request ID

It is very useful to associate a request ID to each incoming request,
this change allows to provide a function to do that via Server Option.
The change comes with a default function which will generate a new
request ID. The request ID is put in the request context along with a
common logger which always logs the request-id

We add gRPC interceptors to the server so it can get the request ID out
of the gRPC metadata and put it in the common logger stored in the
context so as all the log lines using the common logger from the context
will have the request ID logged
2018-06-14 10:40:55 +01:00
CI
3790d34eee fnserver: 0.3.473 release [skip ci] 2018-06-13 05:52:56 +00:00
Reed Allman
e848b4c88e should turn on views regardless of exporter (#1059)
https://github.com/fnproject/fn/pull/1058/files#r194913723
2018-06-12 22:45:50 -07:00
CI
e2a58f9403 fnserver: 0.3.472 release [skip ci] 2018-06-12 20:43:21 +00:00
Tolga Ceylan
f24172aa9d fn: introducing lb placer basic metrics (#1058)
* fn: introducing lb placer basic metrics

This change adds basic metrics to naive and consistent
hash LB placers. The stats show how many times we scanned
the full runner list, if runner pool failed to return a
runner list or if runner pool returned an empty list.

Placed and not placed status are also tracked along with
if TryExec returned an error or not. Most common error
code, Too-Busy is specifically tracked.

If client cancels/times out, this is also tracked as
a client cancel metric.

For placer latency, we would like to know how much time
the placer spent on searching for a runner until it
successfully places a call. This includes round-trip
times for NACK responses from the runners until a successful
TryExec() call. By excluding last successful TryExec() latency,
we try to exclude function execution & runner container
startup time from this metric in an attempt to isolate
Placer only latency.

* fn: latency and attempt tracker

Removing full scan metric. Tracking number of
runners attempted is a better metric for this
purpose.

Also, if rp.Runners() fail, this is an unrecoverable
error and we should bail out instead of retrying.

* fn: typo fix, ch placer finalize err return

* fn: enable LB placer metrics in WithAgentFromEnv if prometheus is enabled
2018-06-12 13:36:05 -07:00
Peter Jausovec
bd5150f1ac Extract register view functionality (#1056)
* WIP

* Create separate Register*Views functions that are called from main.
2018-06-12 17:24:21 +01:00
CI
6c164ff693 fnserver: 0.3.471 release [skip ci] 2018-06-11 17:30:34 +00:00
Owen Cliffe
1ad27f4f0d Inverting deps on SQL, Log and MQ plugins to make them optional dependencies of extended servers, Removing some dead code that brought in unused dependencies Filtering out some non-linux transitive deps. (#1057)
* initial Db helper split - make SQL and datastore packages optional

* abstracting log store

* break out DB, MQ and log drivers as extensions

* cleanup

* fewer deps

* fixing docker test

* hmm dbness

* updating db startup

* Consolidate all your extensions into one convenient package

* cleanup

* clean up dep constraints
2018-06-11 18:23:28 +01:00
CI
5b2691037e fnserver: 0.3.470 release [skip ci] 2018-06-08 23:04:23 +00:00
Tolga Ceylan
fce1e54746 fn: remove dead code in static pool (#1052)
Static pool is oriented for testing/basic usage and
as it's name implies it is a static pool. Therefore,
removing unnecessary/dead code.
2018-06-08 15:57:06 -07:00
Tolga Ceylan
8f969918bd fn: removing unused/dead code (#1051) 2018-06-08 15:51:19 -07:00
CI
8155779f96 fnserver: 0.3.469 release [skip ci] 2018-06-08 10:54:01 +00:00
CI
1a3b72a05b fnserver: 0.3.468 release [skip ci] 2018-06-08 10:13:29 +00:00
CI
f847402f67 fnserver: 0.3.467 release [skip ci] 2018-06-08 07:40:25 +00:00
CI
dc49b55673 fnserver: 0.3.466 release [skip ci] 2018-06-07 11:07:44 +00:00
Richard Connon
80569c8f21 ID should be primary key on apps model and name should be unique. This allows for renaming apps in the future. (#1048) 2018-06-07 12:00:16 +01:00
CI
242f1571f3 fnserver: 0.3.465 release [skip ci] 2018-06-06 21:57:27 +00:00
Tolga Ceylan
4fcb52f69d fn: MaxTotalCPU and MaxTotalMemory in non-Linux systems (#1043)
Non-Linux systems skip some of memory/cpu determination
code in resource tracker. But config settings to cap
these are used in tests, so they must not be ignored.

With this change, we apply these config settings even
on non-Linux systems.

Memory allocation code is also now same in non-Linux
systems, but default is raised to 2GB from 1.5GB.
2018-06-06 14:50:21 -07:00
CI
6ea13d0f6d fnserver: 0.3.464 release [skip ci] 2018-06-06 14:22:23 +00:00
Owen Cliffe
c6abc8bf64 Use context logging more to ensure context vars are present in log lines (#1039) 2018-06-06 15:14:29 +01:00
CI
19bc5cf852 fnserver: 0.3.463 release [skip ci] 2018-06-05 21:48:33 +00:00
Tolga Ceylan
4af53025d8 fn: lb-agent: Initial TryCall result can be retriable. (#1035)
Before this change, we assumed data may end up in a container
once we placed a TryCall() and if gRPC send failed, we did not
retry. However, a send failure cannot result in data in a
container, since only upon successful receipt of a TryCall can
pure-runner schedule a call into a container. Here we trust
gRPC and if gRPC layer says it could not send a msg, then
the receiver did not receive it.
2018-06-05 14:41:13 -07:00
CI
64431b4497 fnserver: 0.3.462 release [skip ci] 2018-06-05 21:31:15 +00:00
Andrea Rosa
c2c295ffb3 Add a LBAgent constructor which accept AgentConfig (#1037)
In some cases could be useful to pass Agent configurations to the
LnAgent constuctor, this small change adds a new constructor which
accepts an agent configuration as additional parameter.
2018-06-05 13:59:43 -07:00
Tolga Ceylan
1cd5894f41 fn: LB agent: reduce 'Too Busy' error logs (#1033)
With this PR, runner client translates too busy errors
from gRPC session and runner itself into Fn error type.
Placers now ignore this error message to reduce unnecessary
logging.
2018-06-04 12:16:00 -07:00
Tolga Ceylan
7261ddedcc fn: LB agent: EOF from runner is normal in nack cases (#1032) 2018-06-04 12:10:00 -07:00
Reed Allman
00c29b8bf3 datastore no longer implements logstore (#1013)
* datastore no longer implements logstore

the underlying implementation of our sql store implements both the datastore
and the logstore interface, however going forward we are likely to encounter
datastore implementers that would mock out the logstore interface and not use
its methods - signalling a poor interface. this remedies that, now they are 2
completely separate things, which our sqlstore happens to implement both of.

related to some recent changes around wrapping, this keeps the imposed metrics
and validation wrapping of a servers logstore and datastore, just moving it
into New instead of in the opts - this is so that a user can have the
underlying datastore in order to set the logstore to it, since wrapping it in
a validator/metrics would render it no longer a logstore implementer (i.e.
validate datastore doesn't implement the logstore interface), we need to do
this after setting the logstore to the datastore if one wasn't provided
explicitly.

* splits logstore and datastore metrics & validation logic
* `make test` should be `make full-test` always. got rid of that so that
nobody else has to wait for CI to blow up on them after the tests pass locally
ever again.

* fix new tests
2018-06-04 00:08:16 -07:00
Tomas Knappek
e0425abd19 unmatched api handler reported as 'invalid' (#1028) 2018-06-01 13:49:40 -07:00
Tolga Ceylan
a57907eed0 fn: user friendly timeout handling changes (#1021)
* fn: user friendly timeout handling changes

Timeout setting in routes now means "maximum amount
of time a function can run in a container".

Total wait time for a given http request is now expected
to be handled by the client. As long as the client waits,
the LB, runner or agents will search for resources to
schedule it.
2018-06-01 13:18:13 -07:00
CI
ffefcf5773 fnserver: 0.3.461 release [skip ci] 2018-06-01 10:49:07 -07:00
Tolga Ceylan
f97b63f878 fn: fixup temp dir read/write permissions if tmp fs size is not set. (#1024)
When TmpFsSize is not set in a route, docker fails to create a /tmp
mount that is writable. Forcing docker to explicitly to this if
read-only root directory is enabled (default).
2018-06-01 10:49:07 -07:00
CI
316940285d fnserver: 0.3.460 release [skip ci] 2018-05-31 20:11:30 +00:00
Tolga Ceylan
e1b7e30e49 fn: cleanup of unused/global constants in lb agent (#1020)
Moved retry interval as placer member variable for time-being.
2018-05-31 13:04:06 -07:00
CI
a282005bf7 fnserver: 0.3.459 release [skip ci] 2018-05-31 01:24:47 +00:00
Tolga Ceylan
d190167580 fn: read-only root fs becomes default (#1019)
* fn: read-only root fs becomes default

Set root fs as read-only by default.

* fn: update doc for FN_DISABLE_READONLY_ROOTFS
2018-05-30 18:17:28 -07:00
CI
f4712b4f5b fnserver: 0.3.458 release [skip ci] 2018-05-29 23:33:43 +00:00
Tolga Ceylan
7f1d14d21f fn: slot hash id must be utf8 in gRPC (#1016) 2018-05-29 16:26:43 -07:00
CI
47c6fb54af fnserver: 0.3.457 release [skip ci] 2018-05-25 21:20:22 +00:00
Tolga Ceylan
74a5379dec fn: lb & pure-runner slot hash id communication (#1007)
* fn: lb & pure-runner slot hash id communication

With this change, LB can pre-calculate the slot hash
key and pass it to runners. If LB knows/calculates
the slot hash ids, then it can also make better
estimates on which runner can successfully execute
it especially when status messages from runner
include a small summary of idle slots for a given
slot hash id. (TODO)

* fn: fix mock test
2018-05-25 14:12:48 -07:00
Tolga Ceylan
9584643142 fn: size restricted tmpfs /tmp and read-only / support (#1012)
* fn: size restricted tmpfs /tmp and read-only / support

*) read-only Root Fs Support
*) removed CPUShares from docker API. This was unused.
*) docker.Prepare() refactoring
*) added docker.configureTmpFs() for size limited tmpfs on /tmp
*) tmpfs size support in routes and resource tracker
*) fix fn-test-utils to handle sparse files better in create file

* test typo fix
2018-05-25 14:12:29 -07:00
CI
71dbf9fa57 fnserver: 0.3.456 release [skip ci] 2018-05-25 15:39:27 +00:00