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

agave-validator revamp #4082

Open
yihau opened this issue Dec 12, 2024 · 3 comments
Open

agave-validator revamp #4082

yihau opened this issue Dec 12, 2024 · 3 comments

Comments

@yihau
Copy link
Member

yihau commented Dec 12, 2024

Motivation

I would like to get agave-validator capture environment variables directly so that we can avoid this hardcoded logic:

while [[ -n $1 ]]; do
if [[ ${1:0:1} = - ]]; then
if [[ $1 = --init-complete-file ]]; then
args+=("$1" "$2")
shift 2

currently, we are using clap v2, which has a known bug
ref: https://www.github.com/clap-rs/clap/issues/1476#issuecomment-850292210

it's super painful to upgrade v2 to v4/v5 directly and we also lack sufficient tests to ensure the behavior.

Proposed Solution

  • Refactor agave-validator (the vision for the future: [wip] agave-validator revamp all #4083.)
    • reorganize commands and executors
    • extract clap arg parsing logic and add tests
  • Upgrade to clap v3
  • Upgrade to clap v4/v5
  • Get agave-validator capture environment variables directly
@steviez
Copy link

steviez commented Dec 16, 2024

Before I go review the PR's, I want to ensure I understand the underlying issue / your plan of attack.

  • The snippet you linked to shows us having some hard-coded / duplicate logic for parsing our CLI arguments.
  • You want to avoid this stuff altogether / get new CLI args supported in this script for free
  • The version of CLAP we're on does not support this
  • Upgrading to a new version of CLAP has proven to be painful in the past
  • You want to break things into separate modules / files and then upgrade CLAP versions

So to confirm, the main goal of this issue & the related PR's would be to get agave-validator to a newer version of CLAP ? I guess you remove that snippet from bootstrap-validator.sh once we do so, but that seems like a smaller piece than actually getting us to a new CLAP version

@yihau
Copy link
Member Author

yihau commented Dec 16, 2024

yeah, the main goal is to upgrade agave-validator to a newer version of clap. however the current code structure makes this process hard and painful. imo, there several blockers atm:

  1. all args parsing logic is tightly coupled with the core business logic. it's very difficult for us to write some unit tests.
  2. there are no existing tests for ensuring agave-validator use cases, increasing the risk of breaking existing features during code changes.

I plan to reorganize the code by extracting arg parsing logic to some other places and adding more tests to ensure functionality.

@yihau
Copy link
Member Author

yihau commented Dec 16, 2024

btw, here's the vision for the future: #4083.

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

No branches or pull requests

2 participants