Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(perf): add nim-libp2p v1.1 #262

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Conversation

lchenut
Copy link

@lchenut lchenut commented Aug 16, 2023

Now that the perf protocol is merged.

I'm a bit rusty with docker though, so I'm not 100% sure if what I did is correct.

@mxinden
Copy link
Member

mxinden commented Aug 16, 2023

@mxinden
Copy link
Member

mxinden commented Aug 16, 2023

@lchenut missing step (2) and (3).

  1. For a new implementation, in impl/Makefile include your implementation in the all target.
  2. For a new version, reference version in runner/src/versions.ts.

https://github.com/libp2p/test-plans/tree/master/perf#adding-a-new-implementation-or-a-new-version

Excited to see the results.

@mxinden
Copy link
Member

mxinden commented Aug 17, 2023

Comment on lines 5 to 6
perf: perf.nim nim-libp2p
docker run --rm --user "$(shell id -u):$(shell id -g)" -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp nimlang/nim:1.6.10 sh -c "cd nim-libp2p && nimble install_pinned && cd - && nim c --NimblePath:nim-libp2p/nimbledeps/pkgs -p:nim-libp2p -d:chronicles_log_level=WARN --threads:off -d:release perf.nim"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI has failed:

bash: line 1: ./impl/nim-libp2p/v1.0/perf: No such file or directory

Is this actually producing a binary under the name perf?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what I was afraid of. It's a Docker problem, it creates an ELF executable, no matter what, where it should create a host-compatible executable.

But it seems that there's no nim image on docker hub with this option.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a bit of research, the problem doesn't come from the executable itself, but come from the linking of the .so...

$ file perf
perf: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=895de8bd9fdf766ac9448fa05056cb4370bb6f54, for GNU/Linux 3.2.0, not stripped

/lib64/ld-linux-x86-64.so.2 isn't found

And I have no idea what I should use instead.

@mxinden
Copy link
Member

mxinden commented Aug 31, 2023

Friendly ping @lchenut. Any progress on the above linking issue?

@lchenut
Copy link
Author

lchenut commented Sep 5, 2023

Hum... I was so sure about this one. After a bit of digging and not finding a clear way to fix this (non-existant). It seems that I forgot to include nim-libp2p/v1.0/. in a .PHONY. So nothing to do with linking.

@mxinden
Copy link
Member

mxinden commented Sep 6, 2023

Cool. Mind resolving the merge conflicts @lchenut? I can then trigger another run.

@lchenut
Copy link
Author

lchenut commented Sep 7, 2023

@mxinden done

@Menduist
Copy link
Contributor

Menduist commented Sep 14, 2023

@mxinden friendly ping to trigger the CI :)

@mxinden
Copy link
Member

mxinden commented Sep 14, 2023

Sorry for the delay. I was out sick with COVID for a week. Resolved conflicts with #299 and triggered CI:

https://github.com/libp2p/test-plans/actions/runs/6188558497/job/16800823070

@mxinden
Copy link
Member

mxinden commented Sep 14, 2023

@lchenut @Menduist CI run failed:

Unable to find image 'nimlang/nim:1.6.10' locally
1.6.10: Pulling from nimlang/nim
675920708c8b: Pulling fs layer
15302ca1b35f: Pulling fs layer
aa23efb4e495: Pulling fs layer
ed29ac11846c: Pulling fs layer
d589f97156d3: Pulling fs layer
ed29ac11846c: Waiting
d589f97156d3: Waiting
aa23efb4e495: Verifying Checksum
aa23efb4e495: Download complete
675920708c8b: Verifying Checksum
675920708c8b: Download complete
675920708c8b: Pull complete
d589f97156d3: Verifying Checksum
d589f97156d3: Download complete
ed29ac11846c: Verifying Checksum
ed29ac11846c: Download complete
15302ca1b35f: Verifying Checksum
15302ca1b35f: Download complete
15302ca1b35f: Pull complete
aa23efb4e495: Pull complete
ed29ac11846c: Pull complete
d589f97156d3: Pull complete
Digest: sha256:e3a842e22e9f7317b83908ee0470f4d983dee2f587840f161e91bc6dab9fa6b2
Status: Downloaded newer image for nimlang/nim:1.6.10
oserr.nim(95)            raiseOSError
Error: unhandled exception: Permission denied
Additional info: /.nimble [OSError]
make[1]: *** [Makefile:6: perf] Error 1
make: *** [Makefile:18: nim-libp2p/v1.0/.] Error 2
Command failed: ssh -o StrictHostKeyChecking=no [email protected] 'cd impl && make'
Error: Process completed with exit code 1.

@lchenut
Copy link
Author

lchenut commented Sep 29, 2023

@mxinden sorry for the delay... it should be good now.

@mxinden
Copy link
Member

mxinden commented Oct 10, 2023

@diegomrsantos
Copy link
Contributor

Hi @mxinden, we often find ourselves needing CI runs for our PRs but lack the necessary permissions. Is there a way to streamline this process to minimize manual coordination? Thanks.

@lchenut lchenut changed the title feat(perf): add nim-libp2p v1.0 feat(perf): add nim-libp2p v1.1 Oct 20, 2023
@mxinden
Copy link
Member

mxinden commented Oct 26, 2023

Is there a way to streamline this process to minimize manual coordination? Thanks.

In case you want to run the perf tests off of your laptop against your own AWS account:

https://github.com/libp2p/test-plans/blob/master/perf/README.md#running-manually

In case you want to run the perf tests off of the nim-libp2p CI, you would need to run against your own AWS account. For that, the ./terraform/modules/long_lived module provides additional tooling, namely an AWS lambda that cleans up left over resources, just in case. Once that is in place, you can trigger the perf workflow off of the nim-libp2p CI with your AWS credentials.

Either way, I can't give you access to the Protocol Labs AWS account.

@mxinden
Copy link
Member

mxinden commented Oct 26, 2023

Triggered a new run:

https://github.com/libp2p/test-plans/actions/runs/6473803273/job/17577296660

In case you have not seen the failures:


=== Starting client nim-libp2p/v1.1/tcp
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory
bash: line 1: ./impl/nim-libp2p/v1.1/perf: No such file or directory

@lchenut
Copy link
Author

lchenut commented Oct 27, 2023

@mxinden It's my bad, I should have pinged you when I pushed last week. Like the last three times, it should work now.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry that this is dragging along.

Unfortunately the output format has changed in the meantime. I don't expect this requires a large change on your end, though you will need to continuously emit the current throughput every 1s.

You can find the larger rational in #261. I expect this to be especially interesting for you, given that you looked into congestion controller slow start for your upcoming Gossipsub optimizations.

dur = dur + (await PerfClient.perf(conn, f.uploadBytes, f.downloadBytes))
let ns = dur.nanos
let s = Second.nanos
echo "{\"latency\": ", fmt"{ns div s}.{ns mod s:09}", "}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the output format has changed with #276.

The pull request updated the documentation. You can find the new output format here:

https://github.com/libp2p/test-plans/blob/master/perf/README.md#adding-a-new-implementation-or-a-new-version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants