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

Exec format error on aarch64 for 500 series benchmark #224

Closed Subashkatel closed 2 weeks ago

Subashkatel commented 4 weeks ago

Describe the bug Benchmark 500 series of benchmark is not working in an arm aarch64 vm docker.errors.ContainerError: Command 'None' in image 'spcleth/serverless-benchmarks:build.local.python.3.7' returned non-zero exit status 1: b'exec /sebs/entrypoint.sh: exec format error\n' Also needed to add bunch libraries on such as autoconf, automake, autotools -dev

To Reproduce Steps to reproduce the behavior:

  1. Run it on aarch64

Expected behavior Running the benchmark

Logs Please provide the output of SeBS commands causing the problem, executed with the flag --verbose. Please use the Markdown fenced code blocks (...) to format error logs.

=====================================
Running benchmark: 502.graph-mst
=====================================
[01:04:40.653466] SeBS-1690 Created experiment output at /home/kalm/serverless-benchmarks/results-local-20241029_010439/502.graph-mst
[01:04:41.010724] LocalResources-7d86 Using user-provided configuration of storage for local containers.
[01:04:41.163164] Local-6acd Generating unique resource name local-c6e5d64e
[01:04:41.178712] minio.Minio-ec38 Initialize a new bucket for benchmarks
[01:04:41.197256] minio.Minio-ec38 Created bucket sebs-benchmarks-local-c6e5d64e
[01:04:41.201145] Benchmark-6ef1 Building benchmark 502.graph-mst. Reason: no cached code package.
[01:04:41.224677] Benchmark-6ef1 Docker pull of image spcleth/serverless-benchmarks:build.local.python.3.7
[01:05:31.711019] Benchmark-6ef1 Docker build of benchmark dependencies in container of image spcleth/serverless-benchmarks:build.local.python.3.7
[01:05:31.720471] Benchmark-6ef1 Docker mount of benchmark code from path /home/kalm/serverless-benchmarks/results-local-20241029_010439/502.graph-mst/502.graph-mst_code/python/3.7
[01:05:32.652306] Benchmark-6ef1 Package build failed!
[01:05:32.655329] Benchmark-6ef1 Command 'None' in image 'spcleth/serverless-benchmarks:build.local.python.3.7' returned non-zero exit status 1: b'exec /sebs/entrypoint.sh: exec format error\n'
[01:05:32.655464] Benchmark-6ef1 Docker mount volumes: {'/home/kalm/serverless-benchmarks/results-local-20241029_010439/502.graph-mst/502.graph-mst_code/python/3.7': {'bind': '/mnt/function', 'mode': 'rw'}}
ERROR:root:Command 'None' in image 'spcleth/serverless-benchmarks:build.local.python.3.7' returned non-zero exit status 1: b'exec /sebs/entrypoint.sh: exec format error\n'
Traceback (most recent call last):
  File "/home/kalm/serverless-benchmarks/./sebs.py", line 30, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/python-venv/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/python-venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/python-venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/python-venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/python-venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/./sebs.py", line 72, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/./sebs.py", line 103, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/./sebs.py", line 245, in invoke
    func = deployment_client.get_function(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/sebs/faas/system.py", line 213, in get_function
    rebuilt, _ = code_package.build(self.package_code)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/sebs/benchmark.py", line 501, in build
    self.install_dependencies(self._output_dir)
  File "/home/kalm/serverless-benchmarks/sebs/benchmark.py", line 466, in install_dependencies
    raise e
  File "/home/kalm/serverless-benchmarks/sebs/benchmark.py", line 394, in install_dependencies
    stdout = self._docker_client.containers.run(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kalm/serverless-benchmarks/python-venv/lib/python3.12/site-packages/docker/models/containers.py", line 905, in run
    raise ContainerError(
docker.errors.ContainerError: Command 'None' in image 'spcleth/serverless-benchmarks:build.local.python.3.7' returned non-zero exit status 1: b'exec /sebs/entrypoint.sh: exec format error\n'
✗ Error: experiments.json not found for benchmark 502.graph-mst
Check results-local-20241029_010439/502.graph-mst/benchmark.log for details

=====================================
Benchmark run completed at Tue Oct 29 01:05:33 UTC 2024
Results saved in: results-local-20241029_010439
=====================================

System (please complete the following information):

mcopik commented 4 weeks ago

@Subashkatel Hi! Thank you for your interest in SeBS!

Our benchmarking suite runs locally Docker containers to package dependencies in an environment close to the one in the cloud. However, our images are based on the amd64 architecture. If you are on the Mac ARM CPU, then you should be able to run our containers with emulation. At the moment, I don't have access to this CPU to test a solution.

You can try a fix yourself: can you add platform="linux/amd64" to the argument list in the function call linked below? This could hypothetically resolve the issue.

https://github.com/spcl/serverless-benchmarks/blob/master/sebs/benchmark.py#L394

mcopik commented 2 weeks ago

@Subashkatel What CPU are you running on?

mcopik commented 2 weeks ago

@Subashkatel We recently merged two PRs that add support for ARM functions (AWS only) and deploying functions as containers (AWS and OpenWhisk, Knative & Fission WiP). I verified that we can run and build arm64 containers on x64 CPUs, as long as Docker is configured to use QEMU or some other emulation method.

I will close the issue down - the feature is supported, but it requires additional configuration and we added docs on it.

Please let me know if you have further questions, and if we could help.