Commit Graph

1708 Commits

Author SHA1 Message Date
CI
e7c0c164c1 fnlb: 0.0.60 release [skip ci] fnlb-0.0.60 2017-09-08 16:48:05 +00:00
CI
aa4b61cc4f functions: 0.3.92 release [skip ci] 0.3.92 2017-09-08 16:46:55 +00:00
CI
af28b15780 fnlb: 0.0.59 release [skip ci] fnlb-0.0.59 2017-09-08 16:40:32 +00:00
CI
9275a592a8 functions: 0.3.91 release [skip ci] 0.3.91 2017-09-08 16:39:16 +00:00
CI
23becd70af fnlb: 0.0.58 release [skip ci] fnlb-0.0.58 2017-09-08 16:37:02 +00:00
CI
c5c4f83476 functions: 0.3.90 release [skip ci] 0.3.90 2017-09-08 16:35:49 +00:00
Chad Arimura
d5250b4f0c Update writing.md 2017-09-08 09:27:31 -07:00
Chad Arimura
8f1a77123e Update writing.md 2017-09-08 09:27:06 -07:00
Chad Arimura
03bb8157cf Update writing.md 2017-09-08 09:26:49 -07:00
Chad Arimura
227e41ef3c Update writing.md 2017-09-08 09:26:29 -07:00
Chad Arimura
7b4744fe47 Update func.yaml 2017-09-08 09:26:08 -07:00
Reed Allman
59d95d660a push app/route cache down to datastore (#303)
cache now implements models.Datastore by just embedding one and then changing
GetApp and GetRoute to have the cache inside. this makes it really flexible
for things like testing, so now the agent doesn't automagically do caching,
now it must be passed a datastore that was wrapped with a cache datastore.
the datastore in the server can remain separate and not use the cache still,
and then now the agent when running fn 'for real' is configured with the cache
baked in. this seems a lot cleaner than what we had and gets the cache out of
the way and it's easier to swap in / out / extend.
2017-09-08 09:18:36 -07:00
Reed Allman
53ff665d69 not ready for spans yet in hot land 2017-09-08 05:06:35 -07:00
Reed Allman
0f50e4b7fc fix neg content length 2017-09-08 01:59:54 -07:00
Reed Allman
4ce9163d99 nuke some TODO yey 2017-09-07 20:15:39 -07:00
Reed Allman
1811b4e230 make fn logger more reasonable
something still feels off with this, but i tinkered with it for a day-ish and
didn't come up with anything a whole lot better. doing a lot of the
maneuvering in the caller seemed better but it was just bloating up GetCall so
went back to having it basically like it was, but returning the limited
underlying buffer to read from so we can ship to the db.

some small changes to the LogStore interface, swapped it to take an
io.Reader instead of a string for more flexibility in the future while
essentially maintaining the same level of performance that we have now.
i'm guessing in the not so distant future we'll ship these to some s3 like
service and it would be better to stream them in than carry around a giant
string anyway. also, carrying around up to 1MB buffers in memory isn't great,
we may want to switch to file backed logs for calls, too. using io.Reader for
logs should make #279 more reasonable if/once we move to some s3-like thing,
we can stream from the log storage service direct to clients.

this fixes the span being out of whack and allows the 'right' context to be
used to upload logs (next to inserting the call). deletes the dbWriter we had,
and we just do this in call.End now (which makes sense to me at least).
removes the dupe code for making an stderr for hot / cold and simplifies the
way to get a func logger (no more 7 param methods yay).

closes #298
2017-09-07 20:15:39 -07:00
Reed Allman
1d0a63ca99 add id to all call invocation logs 2017-09-07 18:37:22 -07:00
Travis Reeder
e56d555c3e Updated docs for cli flag changes. 2017-09-07 15:53:28 -07:00
Reed Allman
700078ccb9 bubble up some docker errors to user
currently:

* container ran out of memory (code 137)
* container exited with other code != 0
* unable to pull image (auth/404)

there may be others but this is a good start (the most common). notably, for
both hot and cold these should bubble up (if deterministic, which hub isn't
always), and these are useful for users to use in debugging why things aren't
working.

added tests to make sure that these behaviors are working.

also changed the behavior such that when the container exits we return a 502
instead of a 503, just to be able to distinguish the fact that fn is working
as expected but the container is acting funky (400 is weird here, so idk).

removed references to old IsUserVisible crap and slightly changed the
interface for RunResult for plumbing reasons (to get the error type,
specifically).

fixed an issue where if ~/.docker/config.json exists sometimes pulling images
wouldn't work deterministically (should be more inline w/ expectations now)

closes #275
2017-09-07 11:55:50 -07:00
CI
3d8ca450bb fnlb: 0.0.57 release [skip ci] fnlb-0.0.57 2017-09-07 17:18:17 +00:00
CI
0902bbfb67 functions: 0.3.89 release [skip ci] 0.3.89 2017-09-07 17:16:56 +00:00
Reed Allman
423df1e7e9 Merge pull request #290 from fnproject/issue-276
Use context-bound SQL methods
2017-09-07 10:06:13 -07:00
Denis Makogon
8a337e744b Addresing new comments 2017-09-07 15:17:39 +03:00
Reed Allman
f068a4c6df oops, try to pre-allocate slice of useful size but if not allow expansion 2017-09-07 04:44:07 -07:00
Denis Makogon
57a577dfc9 Wiring new context with initial span 2017-09-06 21:55:52 +03:00
Denis Makogon
9a89366d1b Addressing review comments
reverting query string caching in favour of Go 1.9 sqlx features
 moving context definition out of call.End to upper level
2017-09-06 21:48:29 +03:00
Denis Makogon
6a541139a9 Make call.End more solid 2017-09-06 21:48:29 +03:00
Denis Makogon
d91d0fe79b Use appropriate query for route updating 2017-09-06 21:48:28 +03:00
Denis Makogon
b971595e44 Adding go-fmt.sh to circle config 2017-09-06 21:48:28 +03:00
Denis Makogon
6ac579f296 Formatting issues
Aren't we running go-fmt.sh in CI?
2017-09-06 21:48:28 +03:00
Denis Makogon
9066dca750 Use context-bound SQL methods
Changes:
   Exec     -> ExecContext
   Query    -> QueryContext
   QueryRow -> QueryRowContext

   Rebind and store all possible queries before using them

Closes: #276
2017-09-06 21:48:28 +03:00
CI
da74f538c0 fnlb: 0.0.56 release [skip ci] fnlb-0.0.56 2017-09-06 18:38:36 +00:00
CI
5244b2db90 functions: 0.3.88 release [skip ci] 0.3.88 2017-09-06 18:37:17 +00:00
CI
db76735000 fnlb: 0.0.55 release [skip ci] fnlb-0.0.55 2017-09-06 18:31:42 +00:00
CI
837f9b86ad functions: 0.3.87 release [skip ci] 0.3.87 2017-09-06 18:30:29 +00:00
Reed Allman
875300dcd1 Merge pull request #292 from fnproject/get-body
stop forcing GET bodies through ?payload
2017-09-06 11:26:23 -07:00
Reed Allman
3d7e7c5ce7 Merge pull request #294 from fnproject/fixDefaultHeadersMissing
Add headers to env for default functions
2017-09-06 11:20:08 -07:00
CI
ffb7a14b30 fnlb: 0.0.54 release [skip ci] fnlb-0.0.54 2017-09-06 15:36:03 +00:00
CI
c2b6d67a2f functions: 0.3.86 release [skip ci] 0.3.86 2017-09-06 15:34:46 +00:00
Chad Arimura
30fda80295 Update README.md 2017-09-06 08:25:34 -07:00
Chad Arimura
c79d867384 minor doc tweaks 2017-09-06 08:23:49 -07:00
Reed Allman
debbef96fa add headers right way, more docs 2017-09-06 07:34:55 -07:00
Reed Allman
639adf70eb ensure that certain request headers may not be overwritten / added to 2017-09-06 07:24:50 -07:00
Reed Allman
c10462cdc5 FN_MEMORY, FN_TYPE and precedence for app/route vars 2017-09-06 07:24:50 -07:00
Reed Allman
2341456334 FN_ prefix env vars
this adds `FN_` in front of env vars that we are injecting into calls, for
namespacing reasons. this will break code relying on the current variables but
if we want to do this, the chance is now really. alternatively, we could
maintain both the old and new for a short period of time to ease the
adjustment (speak now...). updated the docs, as well.

this also adds tests for the notoriously finicky configuration of the env vars
and headers when setting up a call. this won't test the container / request
for the call is actually receiving them, but it's a decent start and will yell
loudly enough upon formatting breakage.

added back FXLB_WAIT to a couple places so the lb can ride again

one thing for feedback:

headers are a bit confusing at the moment (not from this change, but that
behavior is kept here for now), we've a chance to fix them. currently, headers
in the request __are not__ prefixed with `FN_HEADER_`, i.e. 'hot'+sync containers
will receive `Content-Length` in the http request headers, yet a 'cold'
container from the same request would receive `FN_HEADER_Content-Length` in
its environment. This is additionally confusing because if this function were
hot+async, it would receive `FN_HEADER_Content-Length` in the headers, where
just changing it to sync goes back to `Content-Length`. If that was confusing,
then point made ;)

I propose to remove the `FN_HEADER_` prefix for request headers in the
environment, so that the request headers and env will match, as request
headers already are of this format (not prefixed). please lmk thoughts here

Would be fine with going back to the 'plain' vars too, then this patch will
mostly just be adding tests and changing `FN_FORMAT` to `FORMAT`. obviously,
from the examples, it's a bit ingrained now. anyway, entirely up to y'all.
2017-09-06 07:24:50 -07:00
Owen Cliffe
3a231d6296 review feedback 2017-09-06 15:05:47 +01:00
Owen Cliffe
33060bcb9e Add headers to env for default functions 2017-09-06 13:59:10 +01:00
CI
808c031b6f fnlb: 0.0.53 release [skip ci] fnlb-0.0.53 2017-09-05 22:33:22 +00:00
CI
a1fe5dacfb functions: 0.3.85 release [skip ci] 0.3.85 2017-09-05 22:32:02 +00:00
Reed Allman
a307a3b321 Merge pull request #291 from fnproject/root-readme-edit
Moved export of FN_REGISTRY in front of `fn run` which needs it set.
2017-09-05 15:20:24 -07:00