grpc_bench icon indicating copy to clipboard operation
grpc_bench copied to clipboard

Error while running bench.sh for d_grpc on linux arm64

Open odidev opened this issue 2 years ago • 10 comments

@LesnyRumcajs, I was trying to run d_grpc_bench for arm64 locally but getting errors while build.sh and bench.sh.

I did the below changes for running build.sh

I found that the image dlang2/ldc-ubuntu:1.26.0 present in the dockerfile is not available for arm64. So, I build the image and updated it in the dockerfile but while building the image from dlang-docker, I have used ldc compiler for dlang because by default it uses dmd and dmd doesn’t support arm64 architecture. Please have a look https://dlang.org/download.html

when I ran build.sh, I was getting error related to dub command because the binary is not present for arm64. I found the binary on ubuntu.pkgs.org and updated it in the dockerfile.

After that I ran build.sh again and getting Error: The LLVMgold.so plugin (needed for LTO) was not found. You can specify its path with -flto-binary=<file>. So, I modified the dub.json file and added the -flto-binary path that is "dflags-ldc": ["-flto=/usr/lib/llvm-10/lib/LLVMgold.so"]

Updated Dockerfile: dockerfile.txt

Now the build.sh for d_grpc_bench is running successfully but bench.sh is failing with the below errors.

ubuntu@ip-172-31-19-230:~grpc_bench$ sudo ./bench.sh d_grpc_bench 

==> Running benchmark for d_grpc_bench... 

Waiting for server to come up... ready. 

Warming up the service for 5s... done. 

Benchmarking now... 

                done. 

                Results: 

                    Requests/sec:       5586.37 

Error response from daemon: No such container: d_grpc_bench 

----- 

Benchmark finished. Detailed results are located in: results/221711T054811 

/analyze/results_analyze.rb:25:in `block in <main>': undefined method `[]' for nil:NilClass (NoMethodError) 

        from /analyze/results_analyze.rb:15:in `each' 

        from /analyze/results_analyze.rb:15:in `<main>' 

Failed miserably analysing d_grpc. 

Analysis fiascoed. 

total 12K 

drwxr-xr-x  2 root root 4.0K Nov 17 05:48 . 

drwxr-xr-x 33 root root 4.0K Nov 17 05:48 .. 

-rw-r--r--  1 root root  623 Nov 17 05:48 d_grpc_bench.report 

-rw-r--r--  1 root root    0 Nov 17 05:48 d_grpc_bench.stats 

results/221711T054811/d_grpc_bench.report 

Summary: 

  Count:        112868 

  Total:        20.20 s 

  Slowest:      0 ns 

  Fastest:      0 ns 

  Average:      10.81 ms 

  Requests/sec: 5586.37 

Response time histogram: 

Latency distribution: 

Status code distribution: 

  [Unavailable]   112104 responses 

  [Canceled]      764 responses 

Error distribution: 

  [112104]   rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:50051: connect: connection refused" 

  [764]      rpc error: code = Canceled desc = grpc: the client connection is closing                                                  

 results/221711T054811/d_grpc_bench.stats

Could you please share your feedback regarding the same.

odidev avatar Nov 17 '22 08:11 odidev

Hi @odidev. This means that the server could not handle any request - you can see it in the status code distribution. There's not a single success. I admit the error message is rather cryptic.

LesnyRumcajs avatar Nov 17 '22 19:11 LesnyRumcajs

@LesnyRumcajs I think this issue is because of bench.sh failed to create d_grpc_bench conatiner while running the sudo ./bench.sh d_grpc_bench

Error response from daemon: No such container: d_grpc_bench

I tried to create conatiner for d_grpc_bench but getting the below error:

ubuntu@ip-172-31-19-230:~/grpc_bench$ docker run -it --name grpc_cont grpc_bench:d_grpc_bench-complex_proto bash   

/app/server: error while loading shared libraries: libphobos2-ldc-shared.so.98: cannot open shared object file: No such file or directory 

Could you please share your pointers on the same.

odidev avatar Nov 28 '22 09:11 odidev

@odidev Have you tried installing the missing dependency? Something along the lines of sudo apt-get install -y libphobos2-ldc-shared-dev?

LesnyRumcajs avatar Nov 29 '22 14:11 LesnyRumcajs

Or perhaps only this one is needed. https://pkgs.org/download/libphobos2-ldc-shared90

LesnyRumcajs avatar Nov 29 '22 14:11 LesnyRumcajs

@LesnyRumcajs I found that the image that I build for arm64 using dlang-docker for ldc require bin folder so I added it in the dockerfile after that the error related to dub command not found and Error: The LLVMgold.so plugin is resolved while running the build.sh but when I ran bench.sh I am getting the same error.

Please have a look at the updated dockerfile: dockerfile

ubuntu@ip-172-31-19-230:~/priya/grpc_bench$ sudo ./bench.sh d_grpc_bench 

==> Running benchmark for d_grpc_bench... 

Waiting for server to come up... ready. 

Warming up the service for 5s... done. 

Benchmarking now... 

                done. 

                Results: 

                    Requests/sec:       5498.17 

Error response from daemon: No such container: d_grpc_bench 

----- 

Benchmark finished. Detailed results are located in: results/220812T103837 

/analyze/results_analyze.rb:25:in `block in <main>': undefined method `[]' for nil:NilClass (NoMethodError) 

        from /analyze/results_analyze.rb:15:in `each' 

        from /analyze/results_analyze.rb:15:in `<main>' 

Failed miserably analysing d_grpc. 

Analysis fiascoed. 

total 12K 

drwxr-xr-x  2 root root 4.0K Dec  8 10:38 . 

drwxr-xr-x 12 root root 4.0K Dec  8 10:38 .. 

-rw-r--r--  1 root root  623 Dec  8 10:39 d_grpc_bench.report 

-rw-r--r--  1 root root    0 Dec  8 10:38 d_grpc_bench.stats 

  

  

results/220812T103837/d_grpc_bench.report 

  

Summary: 

  Count:        110513 

  Total:        20.10 s 

  Slowest:      0 ns 

  Fastest:      0 ns 

  Average:      11.02 ms 

  Requests/sec: 5498.17 

  

Response time histogram: 

  

Latency distribution: 

  

Status code distribution: 

  [Unavailable]   109838 responses 

  [Canceled]      675 responses 

  

Error distribution: 

  [109838]   rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:50051: connect: connection refused" 

  [675]      rpc error: code = Canceled desc = grpc: the client connection is closing                                                  

  

  

  

results/220812T103837/d_grpc_bench.stats 

Now when I am trying to create container for d_grpc_bench I am getting the below error:

ubuntu@ip-172-31-19-230:~/priya/grpc_bench$  docker run -it --name d_grpc_bench grpc_bench:d_grpc_bench-complex_proto bash 

/app/server: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /app/server) 

/app/server: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /app/server) 

/app/server: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by /app/server) 

I tried the same on amd64, I built the image for dlang2/ldc-ubuntu of latest release 1.30.0 but getting same error on both arch while creating the container.

Could you please share your feedback for the same?

odidev avatar Dec 09 '22 04:12 odidev

@LesnyRumcajs Could you please share your feedback regarding the above issue.

odidev avatar Dec 16 '22 14:12 odidev

Sorry, I was on vacation. This error would typically mean that you compiled the binary on a different platform. It would be best if you try to compile a minimal Hello World application in D using the official D lang Dockerfile on your machine.

LesnyRumcajs avatar Jan 07 '23 10:01 LesnyRumcajs

@LesnyRumcajs I have successfully compiled the Hello World application inside the docker container using the docker image that I built for arm64 by their official dockerfile. I have updated the variables in this dockerfile for building the dlang image.

Please have a look at the logs:

ubuntu@ip-172-31-23-20:~/dlang-docker$ sudo docker run -it --name hello ldchello:hello_world bash  

root@b8d9f6f4c3ff:/# vi hello.d 

root@b8d9f6f4c3ff:/# ldc2 hello 

root@b8d9f6f4c3ff:/# ./hello 

Hello, World! 

Could you please share your feedback regarding the same.

odidev avatar Jan 13 '23 10:01 odidev

@LesnyRumcajs Could you please share your feedback regarding the above issue?

odidev avatar Feb 07 '23 11:02 odidev

Not at the moment. I'm a bit pushed for time, and it'd require a longer investigation. Sorry.

LesnyRumcajs avatar Feb 08 '23 08:02 LesnyRumcajs