mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
fn: applications should be aware of reserved writable space (#1083)
Similar to FN_MEMORY, we pass FN_TMPSIZE to function config.
This commit is contained in:
@@ -154,6 +154,7 @@ func buildConfig(app *models.App, route *models.Route) models.Config {
|
|||||||
// TODO: might be a good idea to pass in: "FN_BASE_PATH" = fmt.Sprintf("/r/%s", appName) || "/" if using DNS entries per app
|
// TODO: might be a good idea to pass in: "FN_BASE_PATH" = fmt.Sprintf("/r/%s", appName) || "/" if using DNS entries per app
|
||||||
conf["FN_MEMORY"] = fmt.Sprintf("%d", route.Memory)
|
conf["FN_MEMORY"] = fmt.Sprintf("%d", route.Memory)
|
||||||
conf["FN_TYPE"] = route.Type
|
conf["FN_TYPE"] = route.Type
|
||||||
|
conf["FN_TMPSIZE"] = fmt.Sprintf("%d", route.TmpFsSize)
|
||||||
|
|
||||||
CPUs := route.CPUs.String()
|
CPUs := route.CPUs.String()
|
||||||
if CPUs != "" {
|
if CPUs != "" {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ the function's format:
|
|||||||
* `FN_TYPE` - the type for this call, currently 'sync' or 'async'
|
* `FN_TYPE` - the type for this call, currently 'sync' or 'async'
|
||||||
* `FN_MEMORY` - a number representing the amount of memory available to the call, in MB
|
* `FN_MEMORY` - a number representing the amount of memory available to the call, in MB
|
||||||
* `FN_CPUS` - a string representing the amount of CPU available to the call, in MilliCPUs or floating-point number, eg. `100m` or `0.1`. Header is present only if `cpus` is set for the route.
|
* `FN_CPUS` - a string representing the amount of CPU available to the call, in MilliCPUs or floating-point number, eg. `100m` or `0.1`. Header is present only if `cpus` is set for the route.
|
||||||
|
* `FN_TMPSIZE` - a number representing the amount of writable disk space available under /tmp for the call, in MB
|
||||||
|
|
||||||
In addition to these, all config variables set on `app.config` or `route.config` will be populated into the environment exactly as configured, for example if `app.config = { "HAMMER": "TIME" }` your environment will be populated with `HAMMER=TIME`.
|
In addition to these, all config variables set on `app.config` or `route.config` will be populated into the environment exactly as configured, for example if `app.config = { "HAMMER": "TIME" }` your environment will be populated with `HAMMER=TIME`.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user