-
Notifications
You must be signed in to change notification settings - Fork 42
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
Implement multi tenancy in Flow Framework #980
Conversation
60e881d
to
f611e41
Compare
090727f
to
8cd5b8f
Compare
7c10eac
to
04da6bd
Compare
04da6bd
to
1a9f856
Compare
4afd9ad
to
0583004
Compare
54cfc86
to
a5cbf25
Compare
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>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
8dc5c06
to
72e3076
Compare
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
Signed-off-by: Daniel Widdis <widdis@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are discrepancies at few places between INTERNAL_SERVER_ERROR
and BAD_REQUEST
rest status for the request calls
src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/indices/FlowFrameworkIndicesHandler.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/transport/CreateWorkflowTransportAction.java
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/EncryptorUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/RestActionUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/flowframework/util/TenantAwareHelper.java
Outdated
Show resolved
Hide resolved
b8a4ce8
to
5e63f56
Compare
Signed-off-by: Daniel Widdis <widdis@gmail.com>
5e63f56
to
3550786
Compare
@owaiskazi19 @amitgalitz Can we try to get this merged today? I think I've addressed all your comments or at least answered them. All tests are passing.
|
src/main/java/org/opensearch/flowframework/transport/GetWorkflowStateTransportAction.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments. Not blocking the PR for the ones that can be addressed later
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/flow-framework/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/flow-framework/backport-2.x
# Create a new branch
git switch --create backport/backport-980-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d8a5a4bdbcb39bd45e7fb3b6aa9f800b59b1ddfb
# Push it to GitHub
git push --set-upstream origin backport/backport-980-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/flow-framework/backport-2.x Then, create a pull request where the |
* Import SdkClient and inject it Signed-off-by: Daniel Widdis <widdis@gmail.com> * Pass sdkClient to IndicesHandler and EncryptorUtils classes Signed-off-by: Daniel Widdis <widdis@gmail.com> * Extract tenant id from REST header into RestAction Signed-off-by: Daniel Widdis <widdis@gmail.com> * Pass tenant id to transport actions in template Signed-off-by: Daniel Widdis <widdis@gmail.com> * Validate tenant id existence in workflow transport actions Signed-off-by: Daniel Widdis <widdis@gmail.com> * Pass SdkClient and tenant id to util used for access control checks Signed-off-by: Daniel Widdis <widdis@gmail.com> * Perform tenant id validation checks for workflow APIs Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate Update workflow get action to SdkCleint Signed-off-by: Daniel Widdis <widdis@gmail.com> * Pass tenantId to IndicesHandler and use in EncryptorUtils Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate EncryptorUtils getting master key from index Signed-off-by: Daniel Widdis <widdis@gmail.com> * Refactor fetching master key to permit reuse Signed-off-by: Daniel Widdis <widdis@gmail.com> * Refactor initializeMasterKey to use common code Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate indexing new key to config Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate template indexing to sdkClient Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate template deletion to sdkClient Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate get template to sdkClient Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate provision template to sdkClient Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate max workflow search to sdkClient Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add tenantId to GetWorkflowStateRequest Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate GetWorkflowStateRequest to multitenant client Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate getProvisioningProgress to avoid repetition Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate canDeleteWorkflowStateDoc to avoid repetition Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate initial state document creation to metadata client Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate state document deletion to metadata client Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add Tenant aware Rest Tests for Workflows Signed-off-by: Daniel Widdis <widdis@gmail.com> * Fix javadocs Signed-off-by: Daniel Widdis <widdis@gmail.com> * Add publishToMavenLocal for more CI Signed-off-by: Daniel Widdis <widdis@gmail.com> * Fix some CI Signed-off-by: Daniel Widdis <widdis@gmail.com> * Enable tenant aware search Signed-off-by: Daniel Widdis <widdis@gmail.com> * Refactor state index update method using multitenant client Signed-off-by: Daniel Widdis <widdis@gmail.com> * Get metadata client artifacts from Maven Snapshot Signed-off-by: Daniel Widdis <widdis@gmail.com> * Update tests for new update async code Signed-off-by: Daniel Widdis <widdis@gmail.com> * Switch SdkClient to use default generic thread executor Signed-off-by: Daniel Widdis <widdis@gmail.com> * Migrate last updates to sdkClient Signed-off-by: Daniel Widdis <widdis@gmail.com> * Revert (most) changes to unit tests based on async client changes Signed-off-by: Daniel Widdis <widdis@gmail.com> * Pass tenant id when updating state during provisioning Signed-off-by: Daniel Widdis <widdis@gmail.com> * Integrate tenantId with synchronous provisioning Signed-off-by: Daniel Widdis <widdis@gmail.com> * Fix failing integ tests after rebase, code review updates Signed-off-by: Daniel Widdis <widdis@gmail.com> * Replace fakeTenantId placeholders with actual tenant id Signed-off-by: Daniel Widdis <widdis@gmail.com> * Use version catalog for commons-lang3 and httpcore dependencies Signed-off-by: Daniel Widdis <widdis@gmail.com> * Exclude transitive httpclient dependency from metadata and rest client Signed-off-by: Daniel Widdis <widdis@gmail.com> * Fix more test errors and tweak dependencies Signed-off-by: Daniel Widdis <widdis@gmail.com> * More code review comments and refactoring Signed-off-by: Daniel Widdis <widdis@gmail.com> --------- Signed-off-by: Daniel Widdis <widdis@gmail.com>
Implement multi tenancy in Flow Framework (#980) * Import SdkClient and inject it * Pass sdkClient to IndicesHandler and EncryptorUtils classes * Extract tenant id from REST header into RestAction * Pass tenant id to transport actions in template * Validate tenant id existence in workflow transport actions * Pass SdkClient and tenant id to util used for access control checks * Perform tenant id validation checks for workflow APIs * Migrate Update workflow get action to SdkCleint * Pass tenantId to IndicesHandler and use in EncryptorUtils * Migrate EncryptorUtils getting master key from index * Refactor fetching master key to permit reuse * Refactor initializeMasterKey to use common code * Migrate indexing new key to config * Migrate template indexing to sdkClient * Migrate template deletion to sdkClient * Migrate get template to sdkClient * Migrate provision template to sdkClient * Migrate max workflow search to sdkClient * Add tenantId to GetWorkflowStateRequest * Migrate GetWorkflowStateRequest to multitenant client * Migrate getProvisioningProgress to avoid repetition * Migrate canDeleteWorkflowStateDoc to avoid repetition * Migrate initial state document creation to metadata client * Migrate state document deletion to metadata client * Add Tenant aware Rest Tests for Workflows * Fix javadocs * Add publishToMavenLocal for more CI * Fix some CI * Enable tenant aware search * Refactor state index update method using multitenant client * Get metadata client artifacts from Maven Snapshot * Update tests for new update async code * Switch SdkClient to use default generic thread executor * Migrate last updates to sdkClient * Revert (most) changes to unit tests based on async client changes * Pass tenant id when updating state during provisioning * Integrate tenantId with synchronous provisioning * Fix failing integ tests after rebase, code review updates * Replace fakeTenantId placeholders with actual tenant id * Use version catalog for commons-lang3 and httpcore dependencies * Exclude transitive httpclient dependency from metadata and rest client * Fix more test errors and tweak dependencies * More code review comments and refactoring --------- Signed-off-by: Daniel Widdis <widdis@gmail.com>
Description
Uses the multitenant remote metadata client developed in ML Commons
feature/multi_tenancy
branch to migrate Flow Framework system indices to use the same pattern.Submitting in logical steps to ease maintainer review. Suggestions:
Check List
--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.