Commit Graph

618 Commits

Author SHA1 Message Date
Denis Makogon
7a36e424d1 Fix app updating
Closes: #212
2017-08-09 14:41:23 +03:00
CI
65fed1a2bf functions: 0.3.49 release [skip ci] 2017-08-08 13:20:11 +00:00
Reed Allman
6a7973e6b6 plumb all config fields into task
the mqs are storing a models.Task, which was not incorporating all the fields
that are in a task.Config. I would very much like to merge these two things,
but expect to do this in a future restructuring as both are used widely and
not cordoned off properly (Config has a channel, stdin, stdout, stderr -- and
isn't just a 'config', so to speak, as Task is).

Since a task.Config is what is used to actually run a container, the result of
the aforementioned deficiency was #193 where tasks are improperly configured
and ran (namely, memory wrong).

async tasks can still not be hot, they will be reverted to default format.
would also like to fix this (also part of restructuring). I actually started
doing this, hence the changes to those files (the surface area of the change
is small and discourages improper future use, so I've left what I've done).

this will:

closes #193
closes #195
closes #154

removes many unused fields in models.Task, since we have not implemented
retries. priority & delay are left, even though they are not used either,
the main goal of this is to resolve #193 and both these fields are strongly
plumbed into all the mqs, so punting on those two.
2017-08-03 06:33:30 -07:00
CI
2940727082 functions: 0.3.48 release [skip ci] 2017-08-07 19:04:21 +00:00
CI
d70f27b870 functions: 0.3.47 release [skip ci] 2017-08-07 18:06:39 +00:00
CI
995619f077 functions: 0.3.46 release [skip ci] 2017-08-07 17:54:26 +00:00
Reed Allman
f7345e8080 Merge pull request #191 from fnproject/fix-memory-limits
fix task memory
2017-08-07 10:44:23 -07:00
CI
b3b243bb56 functions: 0.3.45 release [skip ci] 2017-08-05 04:47:13 +00:00
CI
159db07817 functions: 0.3.44 release [skip ci] 2017-08-03 22:40:00 +00:00
Reed Allman
ccea601028 Merge pull request #163 from fnproject/hot-env-changes
change hot containers when route/app vars change
2017-08-03 15:29:41 -07:00
CI
e2bb0b1965 functions: 0.3.43 release [skip ci] 2017-08-03 21:13:23 +00:00
CI
7ad81ebeb5 functions: 0.3.42 release [skip ci] 2017-08-03 18:15:58 +00:00
Reed Allman
910f6a4b09 fix memory setting in cli, remove MEMORY_MB for now 2017-08-02 20:24:58 -07:00
Reed Allman
3ff28163db fix task memory
prior to this patch we were allowing 256MB for every function run, just
because that was the default for the docker driver and we were not using the
memory field on any given route configuration. this fixes that, now docker
containers will get the correct memory limit passed into the container from
the route. the default is still 128.

there is also an env var now, `MEMORY_MB` that is set on each function call,
see the linked issue below for rationale.

closes #186

ran the given function code from #186, and now i only see allocations up to
32MB before the function is killed. yay.

notes:

there is no max for memory. for open source fn i'm not sure we want to
cap it, really. in the services repo we probably should add a cap before prod.
since we don't know any given fn server's ram, we can't try to make sure the
setting on any given route is something that can even be run.

remove envconfig & bytefmt

this updates the glide.yaml file to remove the unused deps, but trying to
install fresh is broken atm so i couldn't remove from vendor/, going to fix
separately (next update we just won't get these). also changed the skip dir to
be the cli dir now that its name has changed (related to brokenness).

fix how ram slots were being allocated. integer division is significantly
slower than subtraction.
2017-08-02 19:09:16 -07:00
Reed Allman
4ad1167284 simplify env var setting, precisely allocate maps 2017-08-02 15:40:50 -07:00
CI
7f054b46cb functions: 0.3.41 release [skip ci] 2017-08-02 22:17:17 +00: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
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