spcl / serverless-benchmarks

SeBS: serverless benchmarking suite for automatic performance analysis of FaaS platforms.
https://mcopik.github.io/projects/sebs/
BSD 3-Clause "New" or "Revised" License
149 stars 67 forks source link

configuring example.json for benchmarking on GCP #154

Closed mariechu3 closed 1 year ago

mariechu3 commented 1 year ago

Hi, I'm interesting in using SeBS but am very new to cloud computing and benchmarking. I was trying to follow the instructions on the README and ran the regression test but it failed with the results that I pasted below. Looking into the error I believe it's due to the fact that I configured the example.json file incorrectly. I'm unsure what exactly the "credentials" for gcp should be. I tried the "OAuth 2 Client ID", "Key ID", and the path to the json file for the service account that was generated but all of them seem to still result in the failed test.

Screen Shot 2023-05-01 at 9 13 00 PM

Additionally I was wondering for running these benchmarks is it sufficient to clone the repository onto my local machine and run the different experiments on my local machine or am I supposed to create an instance in gcp and clone the repo to that instance to run commands such as ./sebs.py experiment invoke perf-cost --config config/example.json --deployment gcp in cloud shell?

mcopik commented 1 year ago

@mariechu3 SeBS benchmarks can be launched from (almost) any machine, and there is no need to be in the Google Cloud (although the machine location will, of course, affect the client's latency).

The error indicates that SeBS cannot find the libraries necessary for working with Google Cloud. The install.py script creates a Python virtual environment that needs to be active - see the README. It looks that this environment is not active, which would explain the issue - the environment variable activating Google Cloud support is not visible.

Please let me know if this solution does not solve your problem.

mariechu3 commented 1 year ago

I see, thank you for the clarification. My python venv is active when I run the regression test and I checked that install.py also added the export lines to my python-venv/bin/activate file. I also change the config/example.json to have:

"gcp": {
      "region": "us-west1",
      "project_name": "{GCP-Project-ID}",
      "credentials": "{absolute path to json key's file produced by the service account generation}"
    },

before running ./sebs.py experiment invoke perf-cost --config config/example.json --deployment gcp

mcopik commented 1 year ago

@mariechu3 The configuration is correct, and the error message indicates that SeBS does not see support for GCP. What do you see when running this command?

echo ${SEBS_WITH_GCP}
mariechu3 commented 1 year ago
Screen Shot 2023-05-15 at 10 00 02 AM
mcopik commented 1 year ago

@mariechu3 I am really surprised by this. Does the issue persist if your python-venv is activated and you run without sudo?

mcopik commented 1 year ago

@mariechu3 Can you please apply this patch, run the regression test again, and show the beginning of the output? Look for lines WARNING:root:SEBS_WITH_GCP. patch.txt

mariechu3 commented 1 year ago

I've been running the regression tests with sudo since I got some permission error with Docker without it and applying the patch and running the regression test gives me something of the form: WARNING:root:SEBS_WITH_GCP , value loaded false

mcopik commented 1 year ago

@mariechu3 Looks like interference of sudo - you can run without sudo by adding your user to the docker group, e.g., see here. I hope this will resolve the issue.

mariechu3 commented 1 year ago

That resolved the issue and the regression test runs now! Thank you for your help!

mcopik commented 1 year ago

You're welcome, happy to hear it works! :)