Faasm on bare metal/ VMs

Faasm can run on any standard bare metal machine or VM with Ubuntu 18.04.

Set-up

The set-up is automated with Ansible and run through a set of Faasm CLI functions.

Inventory file

First you need to create a file at ansible/inventory/bare_metal.yml which groups themachines into their roles in Faasm.

To avoid ambiguity on machines with multiple network interfaces, you must explicitlyspecify the hostname or IP to be used by Faasm with faasm_hostname=…. If themachines only have a single network interface, this is just the machine's normalhostname or IP.

The file will look something like:

  1. [all]
  2. host1 faasm_hostname=<hostname/ IP>
  3. host2 faasm_hostname=<hostname/ IP>
  4. host3 faasm_hostname=<hostname/ IP>
  5. host4 faasm_hostname=<hostname/ IP>
  6.  
  7. [worker]
  8. # Can be one or more hosts
  9. host1
  10. host2
  11.  
  12. [upload]
  13. # Must be a single host
  14. host3
  15.  
  16. [redis]
  17. # Must be a single host
  18. host3
  19.  
  20. [edge]
  21. # Must be a single host
  22. host4

Set-up and install

You can then run the set-up on all the machines with the Faasm CLI:

  1. # Initial machine set-up
  2. inv bm.setup
  3.  
  4. # Faasm deploy
  5. inv bm.deploy

Checks

To check that Faasm is set up properly (and to run any subsequent Faasm commands),you can SSH onto your upload host and run the following:

  1. cd /usr/local/code/faasm
  2. source workon.sh
  3.  
  4. inv upload demo hello
  5. inv invoke demo hello --input="hello!"

Troubleshooting

Faasm is run using supervisor on eachof the hosts.

Logs can be found at:

  • /var/log/faasm_upload.log - upload server logs (on the upload host)
  • /var/log/faasm_worker.log - worker logs (on worker hosts)