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

Modified generator to generate plugins #700

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

saimedhi
Copy link
Collaborator

Description

Modified the generator to generate plugins. Currently, it generates KNN APIs. I will add integration tests.

  • Generated unit tests for all generated APIs is still pending and need to be done.

Issues Resolved

Closes #693
Closes #697

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.14%. Comparing base (b2a1796) to head (39273af).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #700   +/-   ##
=======================================
  Coverage   72.14%   72.14%           
=======================================
  Files          89       89           
  Lines        7945     7945           
=======================================
  Hits         5732     5732           
  Misses       2213     2213           

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

@saimedhi
Copy link
Collaborator Author

Lint is failing. I will fix it in spec.

************* Module opensearchpy._async.plugins.knn
opensearchpy/_async/plugins/knn.py:232:8: C0103: Argument name "nodeId" doesn't conform to snake_case naming style (invalid-name)
************* Module opensearchpy.plugins.knn
opensearchpy/plugins/knn.py:[23](https://github.com/opensearch-project/opensearch-py/actions/runs/8364328461/job/22899396250?pr=700#step:5:24)2:8: C0103: Argument name "nodeId" doesn't conform to snake_case naming style (invalid-name)

@saimedhi
Copy link
Collaborator Author

saimedhi commented Mar 21, 2024

READY FOR REVIEW.

Currently facing issues with testing train_model, which are unrelated to the client. Followed documentation while writing tests.


knn train_model response {'model_id': 'my-model'}

knn get_model response {'model_id': 'my-model', 'model_blob': '', 'state': 'failed', 
'timestamp': '2024-03-22T06:44:52.102263Z', 'description': 'My model description', 
'error': 'Failed to execute training. May be caused by an invalid method definition 
or not enough memory to perform training.', 'space_type': 'l2', 'dimension': 4, 'engine': 'faiss'}
  • All KNN plugin generated APIs are functional and callable.

@saimedhi saimedhi force-pushed the plugin_generator branch 2 times, most recently from 762f46f to 15cc46a Compare March 22, 2024 05:03
Signed-off-by: saimedhi <saimedhi@amazon.com>
@saimedhi saimedhi marked this pull request as ready for review March 22, 2024 06:07
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This works. After you merge this you should refactor it.

Replace is_plugin by inheritance. Create a base class called Component (or another name) and a new class called Plugin inherits from it. Make Module inherit from it as well. The extra functionality of a plugin or module goes into the child classes, and everything common into the base class.

@dblock dblock merged commit 25db5d5 into opensearch-project:main Mar 22, 2024
56 checks passed
AbitraryYu pushed a commit to AbitraryYu/opensearch-py that referenced this pull request Apr 22, 2024
Signed-off-by: saimedhi <saimedhi@amazon.com>
Signed-off-by: AbitraryYu <nikkoyhc@gmail.com>
dblock pushed a commit to dblock/opensearch-py that referenced this pull request Aug 15, 2024
Signed-off-by: saimedhi <saimedhi@amazon.com>
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.

[BUG] API generator failing on main [FEATURE] Generate plugins from opensearch api spec
2 participants