Skip to content

Instantly share code, notes, and snippets.

@alexellis
Last active June 21, 2019 12:55
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save alexellis/665332cd8bd9657c9649d0cd6c2dc187 to your computer and use it in GitHub Desktop.
Save alexellis/665332cd8bd9657c9649d0cd6c2dc187 to your computer and use it in GitHub Desktop.
FaaS serverless framework bootstrap for Raspberry Pi

FaaS serverless framework bootstrap for Raspberry Pi

This bootstraps FaaS onto your Raspberry Pi or ARM board with Docker.

Any Linux/UNIX process can be made a serverless function. Communication with functions is via an API gateway with an easy to use UI portal.

https://github.com/alexellis/faas

Here's the one-shot equivalent from the TestDrive guide

docker swarm init && \
  git clone https://github.com/alexellis/faas && \
  cd faas && \
  ./deploy_stack.armhf.sh && \
  docker service ls

You will then find a reduced set of built-in sample functions available such as wordcount and nodeinfo.

While the Docker images download you can view the status like this:

watch docker stack ls func

Here's an example of how to create a new function to read the CPU temperature:

Full integration with Github - to count stars

See the following repository for a full integration with Github events:

https://github.com/alexellis/github_counter_faas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment