Commit Graph

3033 Commits

Author SHA1 Message Date
CI
539d80cab2 fnserver: 0.3.566 release [skip ci] 0.3.566 2018-09-18 01:06:53 +00:00
Tolga Ceylan
893ff1e6fc fn: add missing dequeue in agent Submit (#1220) 2018-09-17 17:58:12 -07:00
CI
2168396a30 fnserver: 0.3.565 release [skip ci] 0.3.565 2018-09-17 18:59:05 +00:00
Richard Connon
493790dbd2 Add tmpfs IOFS (#1212)
* Define an interface for IOFS handling. Add no-op and temporary directory implementations.

* Move IOFS stuff out into separate file, add basic tmpfs implementation for linux only

* Switch between directory and tmpfs based on platform and config

* Respect FN_IOFS_OPTS

* Make directory iofs default on all platforms

* At least try to clean up a bit on failure

* Add backout if IOFS creation fails

* Add comment about iofs.Close
2018-09-17 11:50:43 -07:00
CI
822fa71fd2 fnserver: 0.3.564 release [skip ci] 0.3.564 2018-09-17 17:39:44 +00:00
Tolga Ceylan
b0c93dbd82 fn: new agent resource tracker metrics (#1215)
New metrics for agent resource tracker: CpuUsed, CpuAvail,
MemUsed, MemAvail.
2018-09-17 10:31:17 -07:00
CI
dd727dfd12 fnserver: 0.3.563 release [skip ci] 0.3.563 2018-09-17 16:46:56 +00:00
Owen Cliffe
27a38bd8a6 [bump minor] Fix call migration (#1217) 2018-09-17 17:37:48 +01:00
Tom Coupland
d56a49b321 Remove V1 endpoints and Routes (#1210)
Largely a removal job, however many tests, particularly system level
ones relied on Routes. These have been migrated to use Fns.

* Add 410 response to swagger
* No app names in log tags
* Adding constraint in GetCall for FnID
* Adding test to check FnID is required on call
* Add fn_id to call selector
* Fix text in docker mem warning
* Correct buildConfig func name
* Test fix up
* Removing CPU setting from Agent test

CPU setting has been deprecated, but the code base is still riddled
with it. This just removes it from this layer. Really we need to
remove it from Call.

* Remove fn id check on calls
* Reintroduce fn id required on call
* Adding fnID to calls for execute test
* Correct setting of app id in middleware
* Removes root middlewares ability to redirect fun invocations
* Add over sized test check
* Removing call fn id check
2018-09-17 16:44:51 +01:00
CI
6a01dae923 fnserver: 0.3.562 release [skip ci] 0.3.562 2018-09-17 11:08:19 +00:00
Owen Cliffe
6567f6e8ef support configuration-based relative dirs (host and agent) for iofs (#1213)
* support configuration-based relative dirs (host and agent) for iofs mounts
* Send UDS requests as POST to <UDS>/call
2018-09-17 11:59:16 +01:00
CI
a0ef26bdb7 fnserver: 0.3.561 release [skip ci] 0.3.561 2018-09-14 23:59:15 +00:00
Tolga Ceylan
aa13a40168 fn: agent/lb/runner error handling adjustments (#1214)
1) Early call validation and return due to cpu/mem impossible
to meet (eg. request cpu/mem larger than max-mem or max-cpu
on server) now emits HTTP Bad Request (400) instead of 503.
This case is most likely due to client/service configuration
and/or validation issue.
2) 'failed' metric is now removed. 'failed' versus 'errors'
were too confusing. 'errors' is now a catch all error case.
3) new 'canceled' counter for client side cancels.
4) 'server_busy' now covers more cases than it previously did.
2018-09-14 16:50:14 -07:00
CI
75bd0d3414 fnserver: 0.3.560 release [skip ci] 0.3.560 2018-09-14 16:04:04 +00:00
Reed Allman
2b797a556a update docs with pro tips for fdk http stream people (#1211)
* update docs with pro tips for fdk http stream people

* fix bug where container could die before uds wait

we used to hang out for an hour. oopsie, thanks Owen
2018-09-14 16:54:18 +01:00
CI
250853cb8a fnserver: 0.3.559 release [skip ci] 0.3.559 2018-09-14 10:08:38 +00:00
Reed Allman
3a9c48b8a3 http-stream format (#1202)
* POC code for inotify UDS-io-socket

* http-stream format

introducing the `http-stream` format support in fn. there are many details for
this, none of which can be linked from github :( -- docs are coming (I could
even try to add some here?). this is kinda MVP-ish level, but does not
implement the remaining spec, ie 'headers' fixing up / invoke fixing up. the
thinking being we can land this to test fdks / cli with and start splitting
work up on top of this. all other formats work the same as previous (no
breakage, only new stuff)

with the cli you can set `format: http-stream` and deploy, and then invoke a
function via the `http-stream` format. this uses unix domain socket (uds) on
the container instead of previous stdin/stdout, and fdks will have to support
this in a new fashion (will see about getting docs on here). fdk-go works,
which is here: https://github.com/fnproject/fdk-go/pull/30 . the output looks
the same as an http format function when invoking a function. wahoo.

there's some amount of stuff we can clean up here, enumerated:

* the cleanup of the sock files is iffy, high pri here

* permissions are a pain in the ass and i punted on dealing with them. you can
run `sudo ./fnserver` if running locally, it may/may not work in dind(?) ootb

* no pipe usage at all (yay), still could reduce buffer usage around the pipe
behavior, we could clean this up potentially before removal (and tests)

* my brain can’t figure out if dispatchOldFormats changes pipe behavior, but
tests work

* i marked XXX to do some clean up which will follow soon… need this to test fdk
tho so meh, any thoughts on those marked would be appreciated however (1 less
decision for me). mostly happy w/ general shape/plumbing tho

* there are no tests atm, this is a tricky dance indeed. attempts were made.
need to futz with the permission stuff before committing to adding any tests
here, which I don't like either. also, need to get the fdk-go based test image
updated according to the fdk-go, and there's a dance there too. rumba time..

* delaying the big big cleanup until we have good enough fdk support to kill
all the other formats.

open to ideas on how to maneuver landing stuff...

* fix unmount

* see if the tests work on ci...

* add call id header

* fix up makefile

* add configurable iofs opts

* add format file describing http-stream contract

* rm some cruft

* default iofs to /tmp, remove mounting

out of the box fn we can't mount. /tmp will provide a memory backed fs for us
on most systems, this will be fine for local developing and this can be
configured to be wherever for anyone that wants to make things more difficult
for themselves.

also removes the mounting, this has to be done as root. we can't do this in
the oss fn (short of requesting root, but no). in the future, we may want to
have a knob here to have a function that can be configured in fn that allows
further configuration here. since we don't know what we need in this dept
really, not doing that yet (it may be the case that it could be done
operationally outside of fn, eg, but not if each directory needs to be
configured itself, which seems likely, anyway...)

* add WIP note just in case...
2018-09-14 10:59:12 +01:00
CI
cd54322e8f fnserver: 0.3.558 release [skip ci] 0.3.558 2018-09-13 23:33:42 +00:00
Tolga Ceylan
4dcdb7d982 fn: paused and evicted container stats (#1209)
* fn: paused and evicted container stats

With this change, now stats reports paused state
as well as incidents of container exit due to evictions.

* fn: update/document state transitions in state tracker

There's no case of a transition moving from done to waiting. This
must be deprecated behavior.
2018-09-13 16:24:26 -07:00
CI
ede5b93c34 fnserver: 0.3.557 release [skip ci] 0.3.557 2018-09-13 10:37:49 +00:00
Tolga Ceylan
586d5c4735 fn: make call.End() to blocking to reduce complexity (#1208)
agent/lb-agent/runner roles execute call.End() in the background
in some cases to reduce latency. With this change, we simplify this
and switch to non-background execution of call.End(). This fixes
hard to detect issues such as non-deterministic calculation of
call.CompletedAt or incomplete Call.Stats in runners.

Downstream projects if impacted by the now blocking call.End()
latency should take steps to handle this according to their requirements.
2018-09-13 11:28:11 +01:00
CI
54ba179078 fnserver: 0.3.556 release [skip ci] 0.3.556 2018-09-13 09:39:35 +00:00
Tom Coupland
a0ccc4d7c4 Copy logs up to v2 endpoints (#1207)
Copies the log endpoints up to the V2 endpoints, in a similar way to
the call endpoints.

The main change is to when logs are inserted into S3. The signature of
the function has been changed to take the whole call object, rather
than just the app and call id's. This allows the function to switch
between calls for Routes and those for Fns. Obviously this switching
can be removed when v1 is removed.

In the sql implementation it inserts with both appID and fnID, this
allows the two get's to work, and the down grade of the
migration. When the v1 logs are removed, the appId can be dropped.

The log fetch test and error messages have been changed to be FnID specific.
2018-09-13 10:30:10 +01:00
CI
ac11d42e56 fnserver: 0.3.555 release [skip ci] 0.3.555 2018-09-12 20:11:25 +00:00
Tolga Ceylan
aabbe0fba5 fn: check context timeout when waiting for non-blocking attach (#1201)
* fn: check context timeout when waiting for non-blocking attach

With this change, we no longer allow docker client AttachToContainerNonBlocking
to block on Success channel more than our context deadline/timeout.

* fn: move nbio chan handling in attach to docker from docker-client
2018-09-12 13:01:51 -07:00
CI
d18cd9e855 fnserver: 0.3.554 release [skip ci] 0.3.554 2018-09-12 18:50:48 +00:00
Tolga Ceylan
ef5c35c6f0 fn: add http.Server options for web/admin/grpc services in server (#1191)
* fn: add httpç to Server

This allows to time limit slow/malicious clients when
reading HTTP headers. In GetBody() buffering, same timeout
can be used to time limit to give consistent I/O wait
limits for the service in addition to per handler
imposed limits we already have.

* fn: generic http Server settings for services
2018-09-12 11:41:06 -07:00
CI
dcc94e514e fnserver: 0.3.553 release [skip ci] 0.3.553 2018-09-12 15:37:18 +00:00
Tom Coupland
3c95d80dce Change not present v2 call endpoint respone to Gone (#1206)
Currently, when the calls endpoints are disabled a 501 is
returned. While this is technically correct, it's not hard to see this
causing trouble when people tend to create 5xx roll up alerting
metrics.

This changes it to a 410, Gone, response, which is close enough and
should allow clients to know what's going on.
2018-09-12 16:27:34 +01:00
CI
aceb1021be fnserver: 0.3.552 release [skip ci] 0.3.552 2018-09-12 14:55:18 +00:00
Tom Coupland
c3537399f1 The V2 Calls api endpoints have been added beneath fns: (#1203)
/fns/{fnID}/calls
/fns/{fnID}/calls/{callID}

The S3 implementation forces our hand as we if we want to list Calls
under a Fn, we have to use the FnID as a prefix on the object names,
which mean we need it to look up any Call. It also makes sense in
terms of resource hierarchy.

These endpoints can optionally be disabled (as other endpoints), if a
service provider needs to provide this functionality via other means.

The 'calls' test has been fully migrated to fn calls. This has been
done to reduce the copy pasta a bit, and on balance is ok as the
routes calls will be removed soon.
2018-09-12 15:45:53 +01:00
Gerardo Viedma
6684299096 Changes README hello world example to use invoke in the absence of routes (#1205) 2018-09-12 13:43:59 +01:00
CI
2c444ae757 fnserver: 0.3.551 release [skip ci] 0.3.551 2018-09-12 06:37:17 +00:00
Tom Coupland
c4dcd96adb Adds key existence check to config equality (#1204)
The config equality test doesn't check that keys exist between config
maps. Meaning that when two maps, both with a single, yet differing
key, with the lefts value being "", the default string, are compared they are
considered equal.

This change uses the two value assignment version of the map get,
allowing it to test for key existence.
2018-09-12 07:27:32 +01:00
CI
8df7cec8f5 fnserver: 0.3.550 release [skip ci] 0.3.550 2018-09-10 23:39:40 +00:00
Tolga Ceylan
6226af933a fn: slot metrics/stats should be in stats/metrics removing logging (#1200)
Slot stats are too noisy. These should be (or shortly will be) in
metrics/stats/tracing.
2018-09-10 16:30:25 -07:00
CI
02af9f72b4 fnserver: 0.3.549 release [skip ci] 0.3.549 2018-09-10 20:45:25 +00:00
Tolga Ceylan
bb8436c3ee fn: docker driver stats/metrics for prometheus (#1197)
* fn: docker driver stats/metrics for prometheus
2018-09-10 13:35:50 -07:00
CI
424ee5fdf7 fnserver: 0.3.548 release [skip ci] 0.3.548 2018-09-06 13:39:29 +00:00
Tolga Ceylan
35d04cae6d fn: handle client connection close errors (#1196) 2018-09-05 16:56:31 -07:00
CI
246c353f9a fnserver: 0.3.547 release [skip ci] 0.3.547 2018-09-05 07:03:13 +00:00
Gerardo Viedma
0e01f3e547 Gracefully handles client request cancelations, instead of treating treating them as server errors (#1194)
* Gracefully handles client request cancelations, instead of logging them as a 500 error

* adds runner_addr to runner client logs
2018-09-05 07:53:48 +01:00
CI
b11c1e63a1 fnserver: 0.3.546 release [skip ci] 0.3.546 2018-09-04 22:51:15 +00:00
Reed Allman
7638b31e11 use tini to run every container (#1195)
fixes #1101

additional context:

* this was introduced in docker 1.13 (1/2017), we require docker 17.10
(10/2017), this should not have any issues dependency-wise, as `docker-init`
is in the docker install from that point in time. unless explicitly removed,
it should be in the dind container we use as well...
* the PR that introduced this to docker is
https://github.com/moby/moby/pull/26061 for additional context
* it may be wise to put this through some paces, if anybody has any...
interesting... function containers. the tests seem to work fine, however, and
this shouldn't be something users have to think about (?) at all, just
something that we are doing. this isn't the default in docker for
compatibility reasons, which is maybe a yellow flag but I am not sure tbh
2018-09-04 15:41:30 -07:00
CI
dee4171be1 fnserver: 0.3.545 release [skip ci] 0.3.545 2018-08-29 20:17:16 +00:00
Tolga Ceylan
ad011fde7f fn: introducing docker-syslog driver as default logger (#1189)
* fn: introducing docker-syslog driver as default logger

With this change, fn-agent prefers RFC2454 docker-syslog driver
for logging stdout/stderr from containers. The advantage
of this is to offload it to docker itself instead of
streaming stderr along with stdout, which gets multiplexed
through single connection via docker-API.

The change will need support from FDKs in order to log
correct call-id and supress '\n' that splits syslog lines.
2018-08-29 13:08:02 -07:00
CI
59f401d525 fnserver: 0.3.544 release [skip ci] 0.3.544 2018-08-29 12:07:55 +00:00
Gerardo Viedma
802832436c Sets FN_PATH in models.Call for fn invoke requests (#1192) 2018-08-29 12:58:39 +01:00
CI
994e5a3d77 fnserver: 0.3.543 release [skip ci] 0.3.543 2018-08-27 18:05:23 +00:00
Reed Allman
292f673747 Go1.11 (#1188)
* update circleci to go1.11

* update opencensus dep to build with go1.11

* fix up for new gofmt rules
2018-08-27 10:55:52 -07:00