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

Set tenant ID for predict request #2619

Conversation

arjunkumargiri
Copy link
Contributor

Description

Tenant ID changes to support predict API. With this change was able to successfully test predict API with remote model and multi tenancy enabled. Following changes are included in this PR:

  • Set tenant ID during predict request
  • MLModelManager to support getModel using tenantID. Removed passing SDKClient as input and moved it to class object.
  • Pass SDKClient to MLModelManager. TODO: SDKModule is being initialized twice. Move to a uniform mechanism to initialize SDKClientModule.
  • Bug fix in DDB client to pass tenant ID.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff

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.

arjunkumargiri and others added 10 commits June 17, 2024 10:32
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
…ctor (opensearch-project#2546)

* multi-tenancy for models (create, get, delete)

Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>

* added update connector + update model

Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>

---------

Signed-off-by: Dhrubo Saha <dhrubo@amazon.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
…search-project#2489)

* Add source map to GetDataObjectResponse

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

* Add test for map getter in clients

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

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
…onnector Implementations (opensearch-project#2520)

* Restore original exception handling expectations

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

* Add UpdateDataObject to interface and implementations

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

* Implement UpdateConnector action

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

* Move CompletionException handling to a common method

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

* Add tests for SDKClient exceptions refactored from Transport Action

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

---------

Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
Signed-off-by: arjunkumargiri <142054468+arjunkumargiri@users.noreply.github.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
Signed-off-by: arjunkumargiri <142054468+arjunkumargiri@users.noreply.github.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
Signed-off-by: Arjun kumar Giri <arjung@amazon.com>
@arjunkumargiri
Copy link
Contributor Author

LGTM.

Except integ tests are failing. Not sure why, is it the two client thing?

After this is merged, I'll pick up the TODOs with the injection:

* I'll change SdkClient from an interface to a concrete class, with an internal implementation as a field that it delegates to.  Then we can inject it in CreateComponents

* I'll have the class take settings when instantiating to choose which client to implement

* I'll update the SdkClientModule to be a util class to help with all the above

* I'll add a new client for Aws Sigv4 support per https://github.com/opensearch-project/opensearch-java/blob/main/guides/auth.md

Integ tests were failing due to transient exception. Rerunning integ tests succeeded.

Thanks for quick turnaround with SDKClient module refactoring in PR: #2638

@@ -99,7 +99,8 @@ protected void doExecute(Task task, ActionRequest request, ActionListener<MLCrea

try (ThreadContext.StoredContext context = client.threadPool().getThreadContext().stashContext()) {
ActionListener<MLCreateControllerResponse> wrappedListener = ActionListener.runBefore(actionListener, context::restore);
mlModelManager.getModel(modelId, null, excludes, ActionListener.wrap(mlModel -> {
// TODO: Add support for multi tenancy
Copy link
Collaborator

Choose a reason for hiding this comment

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

This Controller actions will be disabled for multi-tenancy. @b4sjoo is working on this.

@dhrubo-os dhrubo-os merged commit 8c80f43 into opensearch-project:feature/multi_tenancy Jul 11, 2024
7 of 10 checks passed
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