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

Generate Daily Benchmark Results #2367

Merged
merged 121 commits into from
May 23, 2023

Conversation

jdjaustin
Copy link
Contributor

@jdjaustin jdjaustin commented Dec 15, 2022

Summary of changes
Changes introduced in this pull request:
Generate the following daily benchmark results:

  1. Time to load a mainnet snapshot.
  2. Validation time in tipsets per second.

Reference issue to close (if applicable)

Closes #2208

Other information and links

This PR is just for the script. The script will be added to forest-iac under a separate PR.

@jdjaustin
Copy link
Contributor Author

jdjaustin commented Dec 15, 2022

@elmattic I mentioned I would tag you once I had a draft PR; if you have some guidance on how to handle the case where I need to have the node running and run commands in a separate window (my plan was to open a new terminal with system 'gnome-terminal' but if there's a better strategy, I'm open to ideas), that would be helpful! I'm not finding a lot of documentation on how to implement that task...

@elmattic
Copy link
Contributor

elmattic commented Dec 15, 2022

@jdjaustin What is the purpose of opening the gnome terminal?

Generaly speaking I would more first perform all commands related to Forest, then Lotus (or vice versa). Otherwise you will have to keep both db in-between and this will require to double the size.

@elmattic
Copy link
Contributor

You can find inspiration in my db script, if you need to run a command while the node is running, ie this one I'm using a thread to monitor RSS of the process and sample the value 2 times per second.

@jdjaustin
Copy link
Contributor Author

@elmattic I've uploaded my calcs for Forest import time and validation time if you want to take a look and see if you have any suggestions. I've started the task of replicating this for Lotus, then I'll work on the logic to move all these calcs into the bench.rb file. rss doesn't seem to be updating for memory usage during the import step, so I need to troubleshoot that as well.

@CLAassistant
Copy link

CLAassistant commented Jan 27, 2023

CLA assistant check
All committers have signed the CLA.

@jdjaustin
Copy link
Contributor Author

Tested all the latest changes with mainnet on a droplet running Fedora 37.
Screen Shot 2023-05-11 at 4 28 30 PM

@jdjaustin jdjaustin marked this pull request as ready for review May 12, 2023 20:55
@LesnyRumcajs
Copy link
Member

LesnyRumcajs commented May 16, 2023

  1. Lingering files in the repository. Should they be git-ignored?
Untracked files:
  (use "git add <file>..." to include in what will be committed)
        scripts/benchmark_db/.bundle/
        scripts/benchmark_db/result_1684246301.md
        scripts/benchmark_db/vendor/

  1. Ruby gem missing when following instructions. Please try the instructions from README from a brand-new, clean droplet.

@LesnyRumcajs
Copy link
Member

How about we put at least a dry run in the CI?

Copy link
Member

@LesnyRumcajs LesnyRumcajs left a comment

Choose a reason for hiding this comment

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

In general, it looks good, it doesn't affect Forest so I'm good with merging it as is. It'd be great to go through all of the instructions and possible flags on a clean VPS, just to be sure the README is up-to-date.

I'd also add it in the CI in at least some form unless we want to migrate it soon to forest-iac.

scripts/benchmark_db/benchmark_base.rb Show resolved Hide resolved
scripts/benchmark_db/benchmark_base.rb Show resolved Hide resolved
@LesnyRumcajs LesnyRumcajs mentioned this pull request May 16, 2023
4 tasks
@jdjaustin
Copy link
Contributor Author

2. Ruby gem missing when following instructions. Please try the instructions from README from a brand-new, clean droplet.

I was able to reproduce this issue, but I'm not sure how to fix it yet. bundle install says it is successful, but then the script says cannot load such file for the offending gems (concurrent-ruby, deep_merge, tomlrb, and toml-rb). Interestingly, a manual gem install of these seems to work. @elmattic did you encounter this when you were testing on Fedora 37? I'm tempted to just add a gem install step to the instructions, unless y'all have any suggestions for a better fix.

@elmattic
Copy link
Contributor

elmattic commented May 19, 2023

How about we put at least a dry run in the CI?

This is a good idea. However I would like a true dry run flag for forest-cli and forest binary, so we can validate inputs. (edit: added to them a --dry-run flag).

scripts/benchmark_db/forest_bench.rb Outdated Show resolved Hide resolved
scripts/benchmark_db/benchmark_base.rb Show resolved Hide resolved
scripts/benchmark_db/benchmark_base.rb Show resolved Hide resolved
scripts/benchmark_db/lotus_bench.rb Show resolved Hide resolved
@elmattic
Copy link
Contributor

2. Ruby gem missing when following instructions. Please try the instructions from README from a brand-new, clean droplet.

I was able to reproduce this issue, but I'm not sure how to fix it yet. bundle install says it is successful, but then the script says cannot load such file for the offending gems (concurrent-ruby, deep_merge, tomlrb, and toml-rb). Interestingly, a manual gem install of these seems to work. @elmattic did you encounter this when you were testing on Fedora 37? I'm tempted to just add a gem install step to the instructions, unless y'all have any suggestions for a better fix.

I let you know, will try the script on a fresh Fedora 37.

@elmattic
Copy link
Contributor

I've tested on Ubuntu 22.04 (LTS) x64 and did manage to reproduce the issue.

$ bundle config set --local path 'vendor/bundle'
$ bundle install
Bundler 2.3.5 is running, but your lockfile was generated with 2.4.6. Installing Bundler 2.4.6 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.4.6
Installing bundler 2.4.6
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using bundler 2.4.6
Fetching concurrent-ruby 1.2.2
Fetching deep_merge 1.2.2
Fetching citrus 3.0.2
Fetching csv 3.2.6
Installing deep_merge 1.2.2
Installing citrus 3.0.2
Installing csv 3.2.6
Fetching fileutils 1.7.0
Installing fileutils 1.7.0
Fetching logger 1.5.3
Installing concurrent-ruby 1.2.2
Fetching open3 0.1.2
Fetching optparse 0.3.1
Installing open3 0.1.2
Installing logger 1.5.3
Installing optparse 0.3.1
Fetching set 1.0.3
Fetching tomlrb 2.0.3
Installing set 1.0.3
Installing tomlrb 2.0.3
Fetching tmpdir 0.1.3
Fetching toml-rb 2.2.0
Installing tmpdir 0.1.3
Installing toml-rb 2.2.0
Bundle complete! 11 Gemfile dependencies, 13 gems now installed.
Bundled gems are installed into `./vendor/bundle`
$ cd ..
$ ./scripts/benchmark_db/bench.rb --daily --chain calibnet --tempdir ../benchdir
<internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- concurrent-ruby (LoadError)
	from <internal:/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from ./scripts/benchmark_db/bench.rb:7:in `<main>'

@elmattic
Copy link
Contributor

elmattic commented May 23, 2023

I think the error is due to improperly setting the path where GEMs are installed,vendor/bundle (check using bundler env).
A cleaner way to install and run the script could be:

  • cd to scripts/benchmark_db
  • bundle config set --local path 'vendor/bundle'
  • bundle config set --local deployment true
  • bundle install
  • bundle exec bench.rb --daily --chain calibnet ...

@elmattic elmattic merged commit 9e6450c into main May 23, 2023
@elmattic elmattic deleted the jdjaustin/issue-2208-generate-daily-benchmark-results branch May 23, 2023 11:55
aatifsyed pushed a commit that referenced this pull request May 24, 2023
aatifsyed pushed a commit that referenced this pull request May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Generate daily benchmark results
5 participants