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

Replace Argparse with ConfigCommand #266

Merged
merged 36 commits into from
Feb 12, 2025

Conversation

nv-braf
Copy link
Contributor

@nv-braf nv-braf commented Feb 3, 2025

Replaces the use of Argparse throughout GAP with the ConfigCommand class. Here is a high level overview of the changes:

  • Added logic that checks for arg validity in ConfigCommand
  • Added logic that infers arg values in ConfigCommand
  • Replaces the use of ArgParse in all classes with ConfigCommand

These are the sections of the code that underwent larger changes:

  • Argparse is still used to process the command-line
    • We now accept either the CLI as it works today, or just the config file as an argument (-v is still allowed)
  • Profile/Analyze subcommands were rewritten to use ConfigCommand
  • PA Config Generator was reworked and the "ignore_args" field has been removed

@nv-braf nv-braf marked this pull request as ready for review February 5, 2025 15:47
@nv-braf nv-braf requested a review from debermudez February 5, 2025 15:47
"or 'https'."
)

valid_localhost = parsed_url.hostname in ["localhost", "127.0.0.1"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically, [::1] is also a valid localhost value, when using IPv6.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My goal here was parity with the checks we currently have in place (in argparse). I'm reluctant to change this check on this branch/in this story.

Copy link
Contributor

@debermudez debermudez left a comment

Choose a reason for hiding this comment

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

clean up the codeQL issues and fix the Value Error bug that @nicolasnoble highlighted. Then this is good to go.

@nv-braf nv-braf merged commit 58efd02 into config_file_support Feb 12, 2025
6 of 7 checks passed
@nv-braf nv-braf deleted the replace_argparse_with_config branch February 12, 2025 15:22
nv-braf added a commit that referenced this pull request Feb 12, 2025
* Ported over logic infer logic from parser

* Added unit testing for inferred input/endpoint logic

* Completed porting of all inferred and checked fields from parser

* Adding missing goodput parsing

* Initial changes to get profile working

* CLI unit tests passing

* Fixing CLI tests that I missed

* Telemetry tests passing

* Test artifacts passing

* Telemetry data collector tests passing

* Passing common unit tests

* Fixing console exporter unit tests

* Fixing CSV exporter unit tests

* Partial for for JSON exporter unit tests

* Adding library function to convert BaseConfig into a JSON readable dictionary

* JSON Exporter unit tests passing

* Fixing Tokenizer unit tests

* PA Config unit tests passing

* Fixing Results and RunConfig unit tests

* All unit tests passing

* Fixing codeql issues

* Moving generation of artifact directory into PA Config generator class

* Fixing exporters to use PA config

* Progress on analyze. Need to add checkpoint support to base config class.

* Fixed GAP config generator. All unit tests passing

* Getting analyze working with CLI

* Analyze working with config file

* fixing codeql

* Fixed PA config to work with multiple sweep parameters

* Fixing message when config found in checkpoint

* Refactoring path method

* Removing commented out lines

* Fixing issue around specifing url/server metrics url

* Changes based on Elias' PR

* Fixing codeql issue

* Missing check for None
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.

3 participants