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: allow configuring validators from envvar #585

Merged

Conversation

AgustinRamiroDiaz
Copy link
Contributor

Fixes #567

What

Allows configuring validators from the envvar VALIDATORS_CONFIG_JSON

Why

To make deployment easier

Testing done

  • unit tests
  • tested with VALIDATORS_CONFIG_JSON = '[{"stake": 100, "provider": "openai", "model": "gpt-4o", "amount": 2}]' and VALIDATORS_CONFIG_JSON = ''

Decisions made

  • I did it in the same component as the jsonrpc server so that we don't need a new component, which would make deployment more complex
  • I didn't use threads to do it since it doesn't take much time, and also threading would've made it more complex given that exception handling across threads is hard

Checks

  • I have tested this code
  • I have reviewed my own PR
  • I have created an issue for this PR
  • I have set a descriptive PR title compliant with conventional commits

Reviewing tips

Read unit tests first to understand the behavior

Extra

Maybe this feature is useful in the genlayer CLI? @denishacquin @cristiam86

User facing release notes

Now you can easily start up your validators from the envvar VALIDATORS_CONFIG_JSON

Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Copy link

codecov bot commented Nov 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 17.78%. Comparing base (19cc640) to head (8814540).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #585   +/-   ##
=======================================
  Coverage   17.78%   17.78%           
=======================================
  Files         122      122           
  Lines        9558     9558           
  Branches      283      283           
=======================================
  Hits         1700     1700           
  Misses       7775     7775           
  Partials       83       83           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Signed-off-by: Agustín Ramiro Díaz <[email protected]>
Copy link

sonarcloud bot commented Nov 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

e2e tests were broken prior to this PR

@AgustinRamiroDiaz AgustinRamiroDiaz merged commit b3e83d0 into main Nov 11, 2024
21 of 24 checks passed
Copy link
Contributor

🎉 This PR is included in version 0.19.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

SIM-Deploy-Allow configuring validators from a file
2 participants