Partial implementation of the EDGELESS features with state-of-the-art tools
- Linux server with multipass installed (tested with Ubuntu 20.04)
- The current user has
sudoprivileges - The OpenFaaS CLI faas-cli
Create two faasd virtual machines:
sudo VM_NAME=faasd1 scripts/create_faasd_vm.sh
sudo VM_NAME=faasd2 scripts/create_faasd_vm.shThis will create two directories called faasd1 and faasd2 containing the SSH keys to enter the VMs, the secret to login with faas-cli, and a Bash file with pre-configured environment setup, e.g., to verify that you can connect via the CLI to faasd1 run:
cd faasd1 && . environment && faas-cli listWe will deploy:
- on
faasd1a functionincrwhich reads a single integer number and increments it, - on
faasd2a functiondoublewhich reads a single integer number and doubles it,
with the following commands:
cd faasd1 && . environment && cd ..
OPENFAAS_URL1=$OPENFAAS_URL
cd faasd2 && . environment && cd ..
OPENFAAS_URL2=$OPENFAAS_URL
faas template pull https://github.com/openfaas-incubator/rust-http-template
faas-cli deploy -f examples/incr.yml --gateway $OPENFAAS_URL1
faas-cli deploy -f examples/double.yml --gateway $OPENFAAS_URL2Try them with curl (theexpected answer is (99+1)*2=200):
curl $OPENFAAS_URL1/function/double -d $(curl $OPENFAAS_URL2/function/incr -d 99)Download and build ServerlessOnEdge in another multipass VM, see quick start instructions.
Make sure that sudo multipass list shows at least the following VMs: faasd1, faasd2, soe-bionic.
First, download the example script into the VM and make it executable:
sudo multipass exec soe-bionic -- bash -c "wget https://raw.githubusercontent.com/edgeless-project/prototype-legacy/main/scripts/setup-soe-faasd-chain.sh"
sudo multipass exec soe-bionic -- bash -c "chmod 755 setup-soe-faasd-chain.sh"Then, you can run the experiment:
sudo multipass exec soe-bionic -- bash -c "VERBOSITY=2 EXEC_DIR=serverlessonedge/build/debug/Executables ADDRESS=\$(hostname -I | cut -f 1 -d ' ') OPENFAAS_URL1=http://10.203.18.112:8080 OPENFAAS_URL2=http://10.203.18.75:8080 ./setup-soe-faasd-chain.sh"The script will execute in background:
- two edgecomputers active as brokers towards
faasd1andfaasd2, respectively - two local (called companion) edgerouters, interconnected to one edgecomputer each
- one main edgerouter, which provides the client with access to the FaaS platforms
and it will configure the forwarding tables of all the edgerouters.
Afterwards, it will create an edgeclient that will execute a simple function chain incr-double with input equal to 99.
First, download the example script into the VM and make it executable:
sudo multipass exec soe-bionic -- bash -c "wget https://raw.githubusercontent.com/edgeless-project/prototype-legacy/main/scripts/setup-soe-only-chain.sh"
sudo multipass exec soe-bionic -- bash -c "chmod 755 setup-soe-only-chain.sh"Then, you can run the experiment:
sudo multipass exec soe-bionic -- bash -c "EXEC_DIR=serverlessonedge/build/debug/Executables ADDRESS=\$(hostname -I | cut -f 1 -d ' ') ./setup-soe-only-chain.sh"The environment is the same as the chain example with FaaS but:
- the edgecomputers simulate a FaaS platform, each offering one lambda function (
lambda1orlambda2) - both lambda functions simply copy the input into the output
- the chain of functions invoked by the client is
lambda1-lambda2