- Install Docker CE for Ubuntu here
- Install Docker CE for Raspbian here
- Install faas-cli. Instructions here
- Python3 installed with the yml module (this is used to create the configuration files)
- Template for
my_rig_config.json
{
"name": "pi001",
"maxCapacity": 1001,
"thing": true,
"localUrl": "http://192.168.78.1",
"localPort": 8080,
"serverUrl": "http://192.168.78.130",
"serverPort": "8080",
"prometheusPort":9090,
"write_timeout": 10,
"read_timeout": 10,
"mongo": "openfaas-db-mongodb"
}
- Clone the openfaas repository
$ git clone https://github.com/openfaas/faas && \
cd faas && \
git checkout 0.7.7 && \
cd ..
- Initiate a docker swarm. In some cases, the flag --advertise-addr might be needed to specify the advertised address.
$ sudo docker swarm init
- Deploy faas and remove unnecessary functions that come preinstalled.
$ sudo ./deploy_faas.sh
- Continue instalation process process for IoT swarm or Cloud swarm
- Create a mongodb Docker Service
$ docker service create --network=func_functions --name openfaas-db-mongodb --publish 27017:27017 mongo mongod
- Create configuration files
$ python3 create_my_functions.py sample-functions/stack.yml
- Deploy my functions.
$ sudo ./deploy_my_functions.sh
- Create configuration files
$ python3 create_my_functions.py sample-functions/stack.yml
- Deploy my functions.
$ sudo ./deploy_my_functions.sh --server