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
150 stars 68 forks source link

Add Multi-Architecture Support (x86_64, arm64) for Benchmarks #192

Closed prajinkhadka closed 2 weeks ago

prajinkhadka commented 8 months ago

This PR resolves issue #92 by adding support for multiple architectures (x86_64 and arm64) across all benchmarks, with the exception of 411.image-recognition. for AWS Lambda with Python3.8.

Key Changes:

  1. Introduced a new architecture parameter in config/example.json, accepting either x86_64 or arm64 as values.
  2. The architecture parameter is now passed to the Docker container and accessed as an environment variable during dependency installation.
  3. Modified dockerfiles/pythoninstaller.sh to set the appropriate flag for PIP package installations based on the architecture (arm64 or x86_64).
  4. Updated the benchmarks (excluding 411.image-recognition) with a new requirements file, requirements.txt.arm.3.8, when necessary. Benchmarks without specific arm64 dependencies remain unchanged.
  5. For the 200.multimedia/220.video-processing benchmark, which requires FFmpeg, the init.sh script now checks the architecture and downloads the corresponding FFmpeg binary. The architecture parameter for init.sh is passed through the add_benchmark_data function in sebs/benchmark.py.
  6. The architecture parameter is passed while creating the lambda function.

Testing:

I've tested the benchmarks with Python 3.8, and they all function as expected. However, it's important to note that benchmarks 020.network-benchmark, 030.clock-synchronization, and 040.server-reply currently do not run due to issue #191. The changes introduced in this PR do not impact these benchmarks, as they do not rely on Python dependencies.

For Testers:

To test these changes, you must first build the Docker image locally using python3 build_docker_images.py --deployment aws --type build --language python --language-version 3.8. Otherwise, Docker will pull an image from Docker Hub that does not include the latest changes.

mcopik commented 8 months ago

@prajinkhadka Thank you! I scheduled a review of this PR.

mcopik commented 8 months ago

@prajinkhadka Did you test all functions on AWS?

prajinkhadka commented 8 months ago

@mcopik yes, I did. I can run once again today and export the logs.

prajinkhadka commented 8 months ago

hi @mcopik, I did run the regression test and it works for AWS.

Test Scenario

Platform -> AWS Python -> Python3.8 Architecture -> (x86_64 and arm64 )

Here are the logs from regression tests : Regreesion Test Logs

prajinkhadka commented 7 months ago

@mcopik any updates on this ?

mcopik commented 6 months ago

@prajinkhadka Thanks for your help; it's almost there! There are two pending tasks:

prajinkhadka commented 5 months ago

@prajinkhadka Thanks for your help; it's almost there! There are two pending tasks:

* We also need to test it on other Python versions; I can help with that, but it should be simple: just run Python 3.9/3.10 (another PR) and update package versions as needed.

* We do not have support for Node.js functions. Do you see any problems there? It hopefully should work out of the box and npm has a flag `--target_arch`. I can help in case the Node and NPM environments are too difficult.

-> I tested for python3.8/3.9 ( updated the required files here in this PR ) and performed the regression test. -> Also, I tested for nodejs 16 ( updated the files here in this PR ). Needed to change the sharp package version as sharp 0.28 version didn't have the required prebuilt library for the arm so upgraded it to 0.32.

( Not tested on nodejs14, Python3.7 as lambda has dropped the support )

Not tested on Python3.10 as it is not supported in SeBs as of now in this PR. When 3.10 supports get merged, I can do that.

@mcopik

mcopik commented 4 months ago

@prajinkhadka Sounds great! we have to merge first the PR updating the version of benchmarks, and then we can finalize this one :-) We will work on this soon.

mcopik commented 2 weeks ago

@prajinkhadka Thank you so much for your work! I merged your contributions through the PR #227