Closed hxalid closed 5 years ago
I've found the reason why scaling from zero was not working on Nomad. It was apparently, due to the fact that when true is not used as a string in the Nomad manifest as an environment variable value, it is being interpreted as "1" by Nomad. However, OpenFaaS Gateway expects scale_from_zero environment variable as a string of value "true". So, changing scale_from_zero=true to scale_from_zero="true" fixed my problem.
However, I am observing some other intermittent behaviour. Namely, when a Nomad job is in pending status after scaling from zero to one, it still returns Function Not Found. I'm going to close this issue and will open another issue to explain that intermittent behaviour more if I cannot figure out what is happening.
Thanks @hxalid The Funciton Not Found message is by design as pending status means that the function can not yet accept requests. Maybe this needs to be changed from a generic 404 to another status code however I would need to think about how this would work, the function execution is not aware of Nomad status only the Service Catalog and a function is only registered here once healthy.
What are the steps to reproduce this issue?
What happens?
echoer starts with 1 replication and after short time scales down to zero. Any subsequent requests returns Function Not Found:
curl --data "message" https://faas-gateway/function/echoer
What were you expecting to happen?
The number of replications would go up from zero to 1
Any logs, error output, etc?
Any other comments?
…
What versions of software are you using?
Operating System: … Ubuntu 16.04 OpenFaaS Version: … Latest OpenFaaS built from source Nomad Version: … Nomad v0.8.6