
Show HN: FaaS – Serverless functions framework for Docker - alexellisuk
http://github.com/alexellis/faas
======
hbt
Anyone knows how this compare to iron functions [https://github.com/iron-
io/functions](https://github.com/iron-io/functions)

Looks similar. Docker image with entry point but the entry point is a server
instead of process and it reuses the docker container instead of shutting it
down

Would be great to get a quick comparison between the two.

Another tool in the same category is hook.io microcule
[https://github.com/Stackvana/microcule](https://github.com/Stackvana/microcule)

both iron functions and microcule are battle tested by companies

------
arekkas
The project and UI looks very cool. But can someone explain to me why FaaS is
a good thing? Isn't this just a perversion of microservices with a ton of
development, operations, CPU, memory and network overhead?

~~~
zdragnar
Kindof. If you look at aws lambda, you get a few more things for the overhead
price: namely, integration with other services (Iam, cognito) and no need to
worry about whether your auto scaling setup or instance sizes are
appropriate... It really is just a logical extension of the concept of the
cloud.

Then again, I certainly wouldn't use it for everything, but ymmv

------
hdhzy
Wow, I was thinking about building something like that but this looks very
good!

Is there a way to map query parameters and / or http headers to input JSON? (a
la API Gateway).

~~~
alexellisuk
So I'd like to know more about your usercases - it's something I want to add
to the roadmap. Right now this is designed to be facing services making HTTP
POSTs aka webhooks and to act as an event type bus for modern web.

~~~
hdhzy
Sometimes I've got a service that won't send plain JSON but rather some data
in query parameters and some in http headers. So it's rather for integration
with others. AWS API Gateway makes it possible to build the input JSON out of
any of (body, headers, query params) just before the lambda function is
invoked. Note that they are using Velocity templates so it doesn't really look
good but if you need this data it gets the job done.

~~~
alexellisuk
That makes sense, do you have any examples? The input doesn't have to be JSON
btw.

------
isuckatcoding
This might be the only reason why I give Docker another try.

------
rcarmo
I like the simplicity, but have some issues with the stdin/stdout approach -
firing up a new interpreter for every invocation has the potential to become
costly in terms of time to first byte...

iron.io seems a trifle better in that regard, although and I've been fiddling
with it and trying to figure out the amount of work involved in getting it to
run on ARM, which seems to be quite a bit more.

~~~
alexellisuk
This works on ARM natively, just use files named .armhf. there is a cost
involved with process pipes but you can optimize this by providing your own
web server listening on port 8080, it just has to accept a POST.

Here's a quick-start guide for ARM:
[https://gist.github.com/alexellis/665332cd8bd9657c9649d0cd6c...](https://gist.github.com/alexellis/665332cd8bd9657c9649d0cd6c2dc187)

~~~
rcarmo
It would be nice to see an example of a function that accepts POST, btw.,
since that would make it easy to do a long-running function that took
advantage of recurring requests to cache/optimize parts of a computation.

I went through the repo and didn't spot anything obvious (might have missed
it).

~~~
alexellisuk
The post is handled in the watchdog function which is embedded into each
function.
[https://github.com/alexellis/faas/blob/master/watchdog/main....](https://github.com/alexellis/faas/blob/master/watchdog/main.go)

All sample functions are using a POST - within your function you receive that
value through STDIN and output response via STDOUT.

Example Alexa Skill:

[https://github.com/alexellis/faas/blob/master/sample-
functio...](https://github.com/alexellis/faas/blob/master/sample-
functions/ChangeColorIntent/handler.js)

Markdown example:

[https://github.com/alexellis/faas/tree/master/sample-
functio...](https://github.com/alexellis/faas/tree/master/sample-
functions/MarkdownRender)

------
detaro
Why does this field love to name projects as generically as possible? First
"Serverless framework", now this... Either not googleable, or poisoning the
search results for the general thing.

------
vegasbrianc
The Docker FaaS UI and built-in Prometheus metrics is a great way to build a
Serverless configuration. Not to mention how easy it is to install and deploy
with one command.

------
mankash666
There's also [http://fission.io](http://fission.io)

~~~
alexellisuk
I think we're trying to do related but slightly different things. This is for
Kubernetes only, FaaS is built on Swarm features which are baked into Docker.
I would think either could target both orchestrators in the future.

