Follow the next steps to (re-) run the paper experiments:
- To run benchmarks, BeFaaS requires programmatic access to the respective platforms. So the first step is to create access keys for the respective platforms, see Initial provider setup.
- BeFaas also requires some managaing instance to orchestrate the benchmark run (Benchmark Manager). This can either be your local computer or a cloud instance. For simplicity, we limit this description to running the benchmark on an AWS EC2 cloud instance (see Detailed setup and configuration (adv.) if you want to use your own computer as Benchmark Manager).
- Create an AWS EC2-Instance and connect to it. The orchestration of the benchmark itself requires only a few resources, but the logs can contain several GB of data, depending on the size of the application and the duration of the experiment. We therefore recommend an t3.medium instance (Amazon Linux 2 AMI (HVM), SSD Volume Type, x86).
- Install the following dependencies:
sudo yum install git -y sudo yum install docker -y sudo yum install -y sudo yum install gcc -y sudo yum install openssl-devel -y sudo yum install bzip2-devel -y sudo yum install libffi-devel -y sudo wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz sudo tar xzf Python-3.8.1.tgz cd Python-3.8.1/ sudo ./configure --enable-optimizations sudo make altinstall - (Opt.) Copy provider keys to EC2 instance
- Adjust .bashrc and set environment variables (check cloud regions)
Examples:
export AWS_ACCESS_KEY_ID=AAAAAA333333OOOOOBBBB export AWS_SECRET_ACCESS_KEY=xxxxxxxyyyyyyyyyyyzzzzzzzzyyyyyxxxxxxxxx export AWS_REGION=eu-west-1 #Google: export GOOGLE_APPLICATION_CREDENTIALS=<path/to/privatekey.json> export GOOGLE_PROJECT=<project_id> export GOOGLE_REGION=<region e.g. us-east1> #AWS: export AWS_ACCESS_KEY_ID=<access_key> export AWS_SECRET_ACCESS_KEY=<secret_access_key> export AWS_REGION=<region e.g. us-east-1> #Azure: export ARM_TENANT_ID=<tenantId from az account list> export ARM_SUBSCRIPTION_ID=<id from az account list> #tinyFaaS: TINYFAAS_ADDRESS=<Public Adress of your tinyFaaS instance> export TINYFAAS_ADDRESS=141.23.28.204 # Management Port (default 8080) export TINYFAAS_MPORT=60008 # Function Port (default 80) export TINYFAAS_FPORT=60010 #OPENFAAS: export OPENFAAS_GATEWAY=http://<address of openfaas gateway>:8080 export OPENFAAS_TOKEN=<password for openfaas, the one you also use when logging into faas-cli> #OpenWhisk: export OPENWHISK_EXTERNAL=<address of openwhisk api gateway> - Restart terminal to export the environment variables
-
Clone BeFaaS-framwork repository
git clone https://github.com/Be-FaaS/BeFaaS-framework.git -
Start Docker
sudo service docker start -
Adjust deployment file in the respective experiment folder (webserivce or iot)
Adjust the experiment.json (e.g., in experiments/webservice). The default configuration of the webservice application uses AWS, Azure, and Google Cloud.
-
Build Docker container
sudo docker build -t befaas/framework BeFaaS-framework/docker/ -
Start framework service
sudo -E ./BeFaaS-framework/docker/run.sh(-E = Preserve Environments - to transfer the environment variables to the docker container)
The shell now opens a new instance in the container and you can type your BeFaaS commands
-
(Opt.) Run Azure login if you plan to deploy resources on Azure and verify your device
az login -
Build experiment (webservice or iot), see folder experiments/
npm run build webserviceRuns the Deployment Compiler.
-
Deploy experiment
npm run deploy webserviceDeploys artifacs to the respective providers.
-
Trigger Workload generation
fmctl workload webserviceStarts the benchmark run.
-
Wait for experiment to complete ...
-
Get log files from used providers
npm run logs webserviceAll the log are now on your managing instance, see BeFaaS-framework/logs/webservice/.
-
Destroy everything
npm run destroyThis clears all allocated resources.
-
Exit framework container
exit
Tools for analyzing and exporting experiment results are within the analysis repository.
The next steps assume that you've just collected the logs on a managing AWS EC2 instance and want to evaluate them. For more information regaring the evaluation capabilities, please swich to the analysis repository documentation.
-
Clone BeFaaS-analysis repository
git clone https://github.com/Be-FaaS/BeFaaS-analysis.git -
Build Docker container
sudo docker build -t befaas/analysis BeFaaS-analysis/ -
Move log files from experiment folder run to a new results folder
mkdir results sudo mv BeFaaS-framework/logs/webservice/<datetime> results/logs -
Run analysis and create a smaller logdump.json
sudo docker run -it -v `pwd`/results:/analysis/results befaas/analysis results/logs results/This will create a (smaller) logdump.json file with all results and which can be exported for further analysis.
-
(Opt.) Copy logdump.json as result file and terminate the benchmark manager instance