-
Notifications
You must be signed in to change notification settings - Fork 473
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
Netgoal: Update netgoal generate flags and variables #4656
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4656 +/- ##
==========================================
- Coverage 54.35% 54.35% -0.01%
==========================================
Files 402 402
Lines 51793 51793
==========================================
- Hits 28154 28151 -3
- Misses 21272 21274 +2
- Partials 2367 2368 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree on using long-form params, especially in a README, but it's non-blocking, so I'll approve as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
var nodeHostsToGenerate int | ||
var nonPartnodesToGenerate int | ||
var nonPartnodesHostsToGenerate int | ||
var participationAlgodNodes int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable renaming is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this with the loadgenerator recipe and it generates the same net.json (just change -H to -x or the long-form).
just some random markdown comments about using links.
generateCmd.Flags().IntVarP(&npnAlgodNodes, "npn-algod-nodes", "x", 0, "Total non-participation algod nodes to generate") | ||
generateCmd.Flags().IntVarP(&npnHostMachines, "npn-host-machines", "X", 0, "Host machines to generate for non-participation algod nodes, default=npn-algod-nodes") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might get some questions about these, since this does make it breaking. on the other hand, it does make it more consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I posted these changes in #performance and #devops. I think they're the only ones who really know about the new X flag anyways. Not sure what else I should do besides answer questions if it comes up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also updated all of the recipes' Makefiles in go-algorand, so hopefully that will help.
Co-authored-by: algolucky <[email protected]>
@egieseke Can you review the new netgoal changes to make sure you're aligned with it? |
### Short-Form Flags Example | ||
The following will result in the same outcome as the command above. | ||
``` | ||
netgoal generate -t net -r /tmp/wat -o net.json -w 100 -R 8 -N 20 -n 100 -X 5 -x 10 --node-template node.json --relay-template relay.json --non-participating-node-template nonPartNode.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, it's still using shorthand flags here in readme. Should we set a better example by using long form flags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The long form flags example is right above the shorthand flags in the readme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be easier to read in this format: https://github.com/algorand/go-algorand/blob/af0c57a67fc3cb6a88990f69d56f4565d6f79725/cmd/netgoal/README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. One other change that would be nice is to allow specifying the network name so that it is used for the hostname suffix in the net.json file. Currently, that has to be added manually.
Thanks! I will ask to merge this in as is for now. Maybe we can consider adding the hostname suffix in a follow up iteration/ticket. |
Summary
generate_network.py
with better variable names and the new npn variable. Used for mainnet-model and custom recipe.generate_network.py
to fix conditional for "ConsensusProtocol". Noticed it will error on mainnet-model otherwise.Important - Functional Changes
Netgoal generate short and long-form flags have changed!
Test Plan