With some back-ends a hard-coded memory limit is needed - we should be able to set this at deployment time by passing additional parameters.
Leave unbounded or set a hard-limit
For DC/OS in particular - memory limits need to be set - so we'd pass additional data in the Create/Deploy endpoint.
Individual providers can opt in or ignore the metadata.
possibly related to https://github.com/openfaas/faas-cli/issues/143
I'll start looking into this.
My suggestion would be to have a structure like this:
resources:
limits:
cpus: '0.001'
memory: 50M
reservations:
cpus: '0.0001'
memory: 20M
that will be propagated from the faas-cli, read from the myfunctions.yml or from a commandline arguments: --limit-cpu, --limit-memory, --reserve-cpu, --reserve-memory.
Then we can have implementations in the gateway for different backends.
If no one objects on this, I'll start working on it...
Yes!! I really want this feature. Can you advise us how to achieve this in faas-cli or faas-netes?
Currently I want to hard-code the limitation for memory. But I have no useful clue to set it. Currently I found deploy handler may is the correct place to set it. But what variable a response for the resource limited?
@nenadilic84 are these both compatible with the notions of reservations and limits in Docker Swarm and Kubernetes? If so then please go ahead and start with the YAML only (not the CLI) so we can get to done and start testing.
CC/ @realbot would this work for you too?
@alexellis @nenadilic84 Yes!
Would you like to collaborate with @nenadilic84 on Slack since you are both there and interested in seeing this happen?
@nenadilic84 let's talk about that on slack
Most helpful comment
I'll start looking into this.
My suggestion would be to have a structure like this:
that will be propagated from the faas-cli, read from the
myfunctions.ymlor from a commandline arguments:--limit-cpu,--limit-memory,--reserve-cpu,--reserve-memory.Then we can have implementations in the gateway for different backends.
If no one objects on this, I'll start working on it...