Commit Graph

605 Commits

Author SHA1 Message Date
Reed Allman
4ad1167284 simplify env var setting, precisely allocate maps 2017-08-02 15:40:50 -07:00
Reed Allman
9ccd48eb18 adds FN_FORMAT, APP_NAME and ROUTE to hot containers 2017-08-02 15:14:23 -07:00
Reed Allman
63796a7c48 change hot containers when route/app vars change
this changes the behavior of hot containers:

1) we are no longer populating a hot container with all of the env vars from the
first request to start up that hot container. this will only populate the
container with any vars that are defined on the app or route.
2) when env vars are changed on the route or app, we will now start up a new
hot container that contains those changes.
3) fixes a bug where we could have a collision if the image and path name
created one, e.g. `/yo/foo` & `oze/yo:latest` collides with `/yo/fo` and
`ooze/yo:latest` (if all other fields are held constant), since we're
name spacing with app name in theory it would happen to the same user (though
we were relying on a comma delimiter there, not great). now we use NULL bytes
which should be hard to get in through a json api ;) i added a sha1 to keep
the size of the (soon to be very large) map down, i don't expect collisions
but, well, it's a hash function.

a small note that we could add a few things to the hot container that will not
change on a request basis, such as `app_name`, `format` and `route` but it's a
bit pedantic. ultimately, it's confusing imo that we have a different set of
vars in the env and in the request itself for hot, which is unavoidable unless
we choose to omit setting env vars entirely, but it seems to be what the
people want (lmk, people, if otherwise).
2017-08-02 15:14:23 -07:00
CI
7ad81ebeb5 functions: 0.3.42 release [skip ci] 2017-08-03 18:15:58 +00:00
CI
7f054b46cb functions: 0.3.41 release [skip ci] 2017-08-02 22:17:17 +00:00
CI
4d0b2d2f3c functions: 0.3.40 release [skip ci] 2017-08-02 22:05:52 +00:00
CI
a2b1d027b5 functions: 0.3.39 release [skip ci] 2017-08-02 19:43:41 +00:00
CI
678c3b4aa3 functions: 0.3.38 release [skip ci] 2017-08-01 02:37:48 +00:00
CI
a4f7f3aa86 functions: 0.3.37 release [skip ci] 2017-07-31 19:43:33 +00:00
CI
0ef171dff5 functions: 0.3.36 release [skip ci] 2017-07-31 19:14:19 +00:00
Denis Makogon
edb1279d57 Fixing task deleting to be similar to task getter 2017-07-31 21:37:29 +03:00
Denis Makogon
333fc66906 Making http client global to async runner 2017-07-31 21:22:12 +03:00
Denis Makogon
7c22468b81 Addressing comments 2017-07-31 21:15:08 +03:00
Denis Makogon
10566ba1a8 Use better http client while deleting task 2017-07-31 21:14:12 +03:00
Denis Makogon
f1e46ebfe3 Using better HTTP client 2017-07-31 21:14:12 +03:00
Denis Makogon
2d7f54bffe Addressing comments 2017-07-31 21:14:12 +03:00
Denis Makogon
bb8f12ece9 Fixing tests and CI file 2017-07-31 21:14:11 +03:00
Denis Makogon
49fe3eb11a Fixing FMT errors
Do we run go-fmt in CI?
2017-07-31 21:14:11 +03:00
Denis Makogon
721c0f1255 Improving erro handling while trying to reserve tasks at async runner
Each time when MQ becomes unreachable HTTP GET /tasks returned HTTP 500
 and code was not handling this case except expecting networking errors.
 After that it tried to unmarshal empty response body that caused another sort of an error.

 This patch triggers error based on http response code, explicitly checking if response code
 is something unexpected (not HTTP 200 OK).

 Response status code for /tasks for changed from 202 Accepted to 200 OK according to swagger doc.
2017-07-31 21:14:11 +03:00
CI
ee1656980c functions: 0.3.35 release [skip ci] 2017-07-30 23:51:51 +00:00
CI
c93ed3b87c functions: 0.3.34 release [skip ci] 2017-07-30 23:40:24 +00:00
Reed Allman
53cbe2d5a4 stop riding the short bus, no clue why this stuff is here. only adds confusion, removing (#1)
server exposes Router field
2017-07-30 16:31:31 -07:00
CI
153487002b functions: 0.3.33 release [skip ci] 2017-07-28 19:06:32 +00:00
CI
5285b5d08e functions: 0.3.32 release [skip ci] 2017-07-28 18:54:44 +00:00
CI
329281232e functions: 0.3.31 release [skip ci] 2017-07-28 18:42:59 +00:00
Reed Allman
7ebdfa0451 Merge pull request #161 from fnproject/catch-panics
catch request panics in goroutine
2017-07-28 11:35:25 -07:00
Travis Reeder
ec75b34841 Merge branch 'master' into export_app_name 2017-07-28 11:19:15 -07:00
CI
2319ed5be7 functions: 0.3.30 release [skip ci] 2017-07-28 18:13:52 +00:00
James
c57c071f44 Add appname and route path to context 2017-07-28 11:10:05 -07:00
James Jeffrey
9ff3dc1d50 Export handling error response (#171) 2017-07-28 11:05:30 -07:00
CI
80b15a8fba functions: 0.3.29 release [skip ci] 2017-07-28 14:46:32 +00:00
James
6ee7619b40 Move all endpoints on v1 to be under apps 2017-07-28 07:25:50 -07:00
Denis Makogon
189905f726 Merge branch 'master' into catch-panics 2017-07-28 11:55:03 +03:00
CI
cd85eefbbc functions: 0.3.28 release [skip ci] 2017-07-28 01:26:18 +00:00
CI
543c8c0500 functions: 0.3.27 release [skip ci] 2017-07-27 18:13:47 +00:00
Travis Reeder
b0494cd25d Boom, circle good to go, releases on commits to master too (#7)
* circle

* circle

* circle

* circle

* circle

* CIRCLE

* circle

* circle

* circle

* circle

* circle

* circle

* circle

* circle

* circle

* circle

* cijrcle

* circle

* circle

* circle

* circle

* c

* c

* circle

* testing release

* circle

* trying release

* c

* c

* functions: 0.3.25 release [skip ci]

* c

* functions: 0.3.26 release [skip ci]

* fn tool: 0.3.19 release [skip ci]

* testing cli release only

* fn tool: 0.3.20 release [skip ci]

* fn tool: 0.3.21 release [skip ci]

* hopefully the last thing

* fn tool: 0.3.22 release [skip ci]

* c

* fn tool: 0.3.23 release [skip ci]

* almost there....

* fn tool: 0.3.24 release [skip ci]

* fnlb: 0.0.2 release [skip ci]

* fn tool: 0.3.25 release [skip ci]

* fnlb: 0.0.3 release [skip ci]

* Added back in commented out lines.

* Fixing middleware example.
2017-07-26 17:38:37 -07:00
Travis Reeder
48e3781d5e Rename to GitHub (#3)
* circle

* Rename to github and fn->cli

*  Rename to github and fn->cli
2017-07-26 10:50:19 -07:00
Reed Allman
9cdd3befe3 add abortion 2017-07-26 04:37:35 -07:00
Reed Allman
f9948aa4cb fix up go-fmt'd oracle fn thing 2017-07-26 04:28:53 -07:00
Reed Allman
13f822ad7f catch request panics in goroutine
the async stuff uses carlos supervisor thing but in the normal request path we
aren't catching any panics and returning a 500 to user (conn just gets
closed & server dies). should catch any mistakes we might make, or any one of
the 10000 libraries we're importing.

closes #150
2017-07-26 04:24:44 -07:00
Reed Allman
e0569192ee Merge branch '103' into 'master'
Ensure app exists before listing its routes

Closes #103

See merge request !106
2017-07-25 10:16:07 -07:00
Denis Makogon
5ed3e79b63 Adding comment with the reason for doing this 2017-07-25 20:09:05 +03:00
Reed Allman
5ea70791a5 Merge branch '113' into 'master'
Use coma as separator for multi-value headers

Closes #113

See merge request !128
2017-07-25 10:08:44 -07:00
Denis Makogon
97b0b97bd8 Reject async requests in case if MQ is not reachable 2017-07-25 10:03:04 -07:00
Denis Makogon
efa75dfbb7 Use coma as separator for multi-value headers
Fixes: #113
2017-07-25 19:30:31 +03:00
Reed Allman
dc5e67b6d2 add opentracing spans for metrics 2017-07-25 08:55:22 -07:00
Denis Makogon
bdffa75762 Fixing tests 2017-07-25 08:57:37 +03:00
Denis Makogon
b3ba42e3b9 Fixing fmt 2017-07-25 08:57:37 +03:00
Denis Makogon
4f5197a1c2 Fixing tests and addressing comments 2017-07-25 08:57:37 +03:00
Denis Makogon
48484be608 Ensure app exists before listing its routes 2017-07-25 08:57:05 +03:00