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

[POC] Use DynamoDB as a metadata store for Flow Framework system indices #631

Closed
wants to merge 2 commits into from

Conversation

dbwiddis
Copy link
Member

@dbwiddis dbwiddis commented Apr 1, 2024

This PR is for educational/reference purposes only.

Do not merge this PR.

Description

Demonstrates the ability to use DynamoDB in place of OpenSearch system indices for the Flow Framework plugin

  • Migrated all APIs except “search”
  • Minimal changes to plugin code for create, index, get, and delete APIs using a wrapper client
  • Some changes required to WorkflowState class to handle updating state with get/modify/put sequence

Setup

  1. Uses a local DynamoDB instance running in a Docker container. Follow setup instructions here: https://github.com/awslabs/amazon-dynamodb-local-samples?tab=readme-ov-file#running-dynamodb-local-as-a-docker-image
  2. Update src/main/plugin-metadata/plugin-security.policy as appropriate (this PR got a minimal config needed, it can probably be tuned or better restricted)

Demo

Created (POST) and updated (PUT) a template for a chat agent using ML Commons. Used GET to read the template and (unprovisioned) state. Provisioned the template and queried the resources:

{
    "workflow_id": "Gk9Ako4Bqm_TOBvIrImu",
    "state": "COMPLETED",
    "provisioning_progress": "DONE",
    "provision_start_time": 1711850695907,
    "provision_end_time": 1711850704738,
    "resources_created": [
        {
            "resource_id": "G09Ako4Bqm_TOBvIsYkc",
            "resource_type": "connector_id",
            "workflow_step_id": "create_connector_1",
            "workflow_step_name": "create_connector"
        },
        {
            "resource_id": "Hk9Ako4Bqm_TOBvIw4kO",
            "resource_type": "model_id",
            "workflow_step_name": "register_remote_model",
            "workflow_step_id": "register_model_2"
        },
        {
            "resource_id": "Hk9Ako4Bqm_TOBvIw4kO",
            "resource_type": "model_id",
            "workflow_step_id": "register_model_2",
            "workflow_step_name": "deploy_model"
        },
        {
            "resource_id": "IE9Ako4Bqm_TOBvIzYmZ",
            "resource_type": "agent_id",
            "workflow_step_name": "register_agent",
            "workflow_step_id": "sub_agent"
        },
        {
            "resource_id": "IU9Ako4Bqm_TOBvIz4kU",
            "resource_type": "agent_id",
            "workflow_step_id": "root_agent",
            "workflow_step_name": "register_agent"
        }
    ]
}

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.

@github-actions github-actions bot added the backport 2.x backport PRs to 2.x branch label Apr 1, 2024
@dbwiddis dbwiddis changed the title Dynamo db poc [POC] Use DynamoDB as a metadata store for Flow Framework system indices Apr 1, 2024
@dbwiddis dbwiddis added discuss and removed backport 2.x backport PRs to 2.x branch labels Apr 1, 2024
@dbwiddis
Copy link
Member Author

dbwiddis commented Apr 4, 2024

Closing this PR as it's served its purpose and is unlikely to be iterated on.

It will remain here for reference for a potential future datastore-as-index integration!

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

Successfully merging this pull request may close these issues.

1 participant