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

Provide Extension API to OpenSearch #74

Merged
merged 15 commits into from
Aug 20, 2022
Merged

Provide Extension API to OpenSearch #74

merged 15 commits into from
Aug 20, 2022

Conversation

dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented Aug 2, 2022

Signed-off-by: Daniel Widdis widdis@gmail.com

Description

Companion PR: opensearch-project/OpenSearch#4100

Extensions will report their APIs to the ExtensionsOrchestrator upon initial registration and potentially later in the Extension's lifecycle. These APIs will be registered and mapped so that when Users submit API requests they can be forwarded to the appropriate extensions.

This PR handles the communication of the REST API from the Extension to OpenSearch. Future PRs will complete the process of registering the REST Handlers and redirecting inbound requests.

Issues Resolved

Fixes #68

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.

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis dbwiddis requested a review from ryanbogan August 3, 2022 05:17
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
@dbwiddis
Copy link
Member Author

dbwiddis commented Aug 4, 2022

On extension orchestrator log:

[2022-08-04T16:20:43,929][INFO ][o.o.e.ExtensionsOrchestrator] [dev-dsk-widdisd-2a-8f5e7316.us-west-2.amazon.com] Initialized extension: sample-extension
[2022-08-04T16:20:43,930][INFO ][o.o.e.ExtensionsOrchestrator] [dev-dsk-widdisd-2a-8f5e7316.us-west-2.amazon.com] Registering: GET /_extensions/sample-extension/api_1
[2022-08-04T16:20:43,930][INFO ][o.o.e.ExtensionsOrchestrator] [dev-dsk-widdisd-2a-8f5e7316.us-west-2.amazon.com] Registering: PUT /_extensions/sample-extension/api_2
[2022-08-04T16:20:43,930][INFO ][o.o.e.ExtensionsOrchestrator] [dev-dsk-widdisd-2a-8f5e7316.us-west-2.amazon.com] Registering: POST /_extensions/sample-extension/api_3

On extension runner log:

MESSAGE RECEIVED:E-ǣ�pRegistered node opensearch-sdk-1, extension sample-extension to handle API [GET /api_1, PUT /api_2, POST /api_3]

@dbwiddis dbwiddis marked this pull request as draft August 4, 2022 17:29
@dbwiddis dbwiddis marked this pull request as ready for review August 4, 2022 19:50
@dbwiddis dbwiddis requested a review from joshpalis August 4, 2022 21:00
joshpalis
joshpalis previously approved these changes Aug 4, 2022
Copy link
Member

@joshpalis joshpalis left a comment

Choose a reason for hiding this comment

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

LGTM! Just a small suggestion regarding missing javadocs

joshpalis
joshpalis previously approved these changes Aug 9, 2022
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
joshpalis and others added 4 commits August 16, 2022 17:14
…ce setter in ExtensionsRunner for testing purporses

Signed-off-by: Joshua Palis <jpalis@amazon.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Fixed testHandleExtensionInitRequest
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Copy link
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Thanks @dbwiddis. This is a great start for RestAPIs.
Could you update the DESIGN.md.

@dbwiddis
Copy link
Member Author

Thanks @dbwiddis. This is a great start for RestAPIs. Could you update the DESIGN.md.

I can do that as part of the follow-on PR to address #69 (based a lot on the comment discussing my plan there) to avoid delaying this PR any further.

Any other changes needed before this and the companion PR is merged?

Copy link
Member

@peternied peternied left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, looks good for my perspective

Copy link
Member

@saratvemulapalli saratvemulapalli left a comment

Choose a reason for hiding this comment

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

Thanks @dbwiddis.
Gradle check is failing probably because of the PR pending in OpenSearch.

@dbwiddis
Copy link
Member Author

Thanks @dbwiddis.

Gradle check is failing probably because of the PR pending in OpenSearch.

Indeed as it passes locally when they branch is published to maven local.

What will it take to get that companion PR approved? I'd like to continue work on both branches.

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

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

One small ask :) Rest LGTM!

@dbwiddis dbwiddis merged commit 1fe933f into opensearch-project:main Aug 20, 2022
@dbwiddis dbwiddis deleted the registerApi branch August 20, 2022 00:03
kokibas pushed a commit to kokibas/opensearch-sdk-java that referenced this pull request Mar 17, 2023
* Provide Extension API to OpenSearch

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix newline, add test

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Clarify Valid API format

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Store uniqueID of extensions

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Fix errors in merge commit

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Rename Api to RestApi

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Delay sending REST API until after responding to initialization

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Move YAML file to classpath

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Temporarily disable failing test for debug

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* fixed testHandleExtensionInitRequest, added protected transport service setter in ExtensionsRunner for testing purporses

Signed-off-by: Joshua Palis <jpalis@amazon.com>

* Change transport service setter to package privage

Signed-off-by: Daniel Widdis <widdis@gmail.com>

* Rename RestApi to RestActions or RestPaths

Signed-off-by: Daniel Widdis <widdis@gmail.com>

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Joshua Palis <jpalis@amazon.com>
Co-authored-by: Joshua Palis <jpalis@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.

[FEATURE] Send required REST APIs to OpenSearch
5 participants