quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.76k stars 380 forks source link

Allow running perf client and server within dockers #1659

Open stormshield-damiend opened 1 year ago

stormshield-damiend commented 1 year ago

Add a way to run perf_client and perf_server within two dockers with optional simulated latency.

To build the binaries and the docker, use : build.sh

To launch the server, use : ./run-server.sh -l 10 -c -o

This will :

To launch the client, use : ./run-client.sh -l 10

This will launch perf_client for 5sec with a simulated latency of 10ms (we will the have a RTT of 10ms).

/!\ For now the GSO is disabled otherwise wireshark is not capable of deciphering packets.

Ralith commented 10 months ago

This gets further now, but still fails before doing any testing:

> ./build.sh
[...]
[+] Building 33.1s (12/12) FINISHED                                             docker:default
 => [server internal] load build definition from Dockerfile                               0.0s
 => => transferring dockerfile: 353B                                                      0.0s
 => [server internal] load .dockerignore                                                  0.0s
 => => transferring context: 2B                                                           0.0s
 => [server internal] load metadata for docker.io/library/debian:bookworm-slim            0.0s
 => [server 1/7] FROM docker.io/library/debian:bookworm-slim                              0.0s
 => [server internal] load build context                                                  1.3s
 => => transferring context: 207.54MB                                                     1.3s
 => [server 2/7] RUN apt-get update && apt-get install -y procps iputils-ping iproute2   24.9s
 => [server 3/7] WORKDIR /root                                                            0.0s
 => [server 4/7] RUN mkdir -p .local/share/quinn                                          0.4s
 => [server 5/7] COPY ./entrypoint.sh .                                                   0.0s 
 => [server 6/7] COPY ./target/perf_client .                                              3.6s 
 => [server 7/7] COPY ./target/perf_server .                                              3.7s 
 => [server] exporting to image                                                           0.5s 
 => => exporting layers                                                                   0.5s
 => => writing image sha256:9daaad82df8dffc2849b4d3fb52d3121012ea804ff536c829ca67d6d518d  0.0s
 => => naming to docker.io/library/quinn_perf                                             0.0s
> ./run-server.sh -l 10 -c -o
Launching docker server
[+] Building 0.0s (0/0)                                                         docker:default
[+] Running 2/2
 ✔ Network docker_quinn-perf  Created                                                     0.1s 
 ✔ Container docker-server-1  Started                                                     0.0s 
Enforcing a latency of 10ms
Starting capture within docker
Launching quinn perf server
Error response from daemon: OCI runtime exec failed: exec failed: unable to start container process: exec /root/perf_server: no such file or directory: unknown
stormshield-damiend commented 9 months ago

This gets further now, but still fails before doing any testing:

> ./build.sh
[...]
[+] Building 33.1s (12/12) FINISHED                                             docker:default
 => [server internal] load build definition from Dockerfile                               0.0s
 => => transferring dockerfile: 353B                                                      0.0s
 => [server internal] load .dockerignore                                                  0.0s
 => => transferring context: 2B                                                           0.0s
 => [server internal] load metadata for docker.io/library/debian:bookworm-slim            0.0s
 => [server 1/7] FROM docker.io/library/debian:bookworm-slim                              0.0s
 => [server internal] load build context                                                  1.3s
 => => transferring context: 207.54MB                                                     1.3s
 => [server 2/7] RUN apt-get update && apt-get install -y procps iputils-ping iproute2   24.9s
 => [server 3/7] WORKDIR /root                                                            0.0s
 => [server 4/7] RUN mkdir -p .local/share/quinn                                          0.4s
 => [server 5/7] COPY ./entrypoint.sh .                                                   0.0s 
 => [server 6/7] COPY ./target/perf_client .                                              3.6s 
 => [server 7/7] COPY ./target/perf_server .                                              3.7s 
 => [server] exporting to image                                                           0.5s 
 => => exporting layers                                                                   0.5s
 => => writing image sha256:9daaad82df8dffc2849b4d3fb52d3121012ea804ff536c829ca67d6d518d  0.0s
 => => naming to docker.io/library/quinn_perf                                             0.0s
> ./run-server.sh -l 10 -c -o
Launching docker server
[+] Building 0.0s (0/0)                                                         docker:default
[+] Running 2/2
 ✔ Network docker_quinn-perf  Created                                                     0.1s 
 ✔ Container docker-server-1  Started                                                     0.0s 
Enforcing a latency of 10ms
Starting capture within docker
Launching quinn perf server
Error response from daemon: OCI runtime exec failed: exec failed: unable to start container process: exec /root/perf_server: no such file or directory: unknown

i will rebase the work as it is quite old and see if i also have the issue.