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

[FEATURE] Create GlobalContext Index to Store Use-case Template information #51

Closed
jackiehanyang opened this issue Sep 22, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jackiehanyang
Copy link
Collaborator

jackiehanyang commented Sep 22, 2023

Is your feature request related to a problem?

When receiving a use-case template from the frontend, we need a location to store information about the template. This ensures global access, allowing subsequent executions to query this information.

What solution would you like?

We are going to create an OpenSearch Index called the GlobalContext index to store this use-case template. The index mapping largely aligns with the use-case template fields, except for an additional field named resource_created. This field keeps a record of all resources that have been created during the process. This makes it easier for us to clean up resources later when the workflow is deleted.

The workflow field value of the use-case template will be stored as a string in the GlobalContext index to avoid limitations imposed by the index mapping type.

The responses field in the index mapping will store only the API responses mentioned in the global_context field of the use-case template. This ensures that subsequent executions can more easily look up the values they need.

{
    "dynamic": false,
    "_meta": {
        "schema_version": 1
    },
    "properties": {
        "workflow_id": {
            "type": "keyword"
        },
        "name": {
            "type": "text",
            "fields": {
                "keyword": {
                    "type": "keyword",
                    "ignore_above": 256
                }
            }
        },
        "description": {
            "type": "text"
        },
        "use_case": {
            "type": "keyword"
        },
        "operations": {
            "type": "keyword"
        },
        "version": {
            "type": "nested",
            "properties": {
                "template": {
                    "type": "integer"
                },
                "compatibility": {
                    "type": "integer"
                }
            }
        },
        "user_inputs": {
            "type": "nested",
            "properties": {
                "model_id": {
                    "type": "keyword"
                },
                "input_field": {
                    "type": "keyword"
                },
                "output_field": {
                    "type": "keyword"
                },
                "ingest_pipeline_name": {
                    "type": "keyword"
                },
                "index_name": {
                    "type": "keyword"
                }
            }
        },
        "workflows": {
            "type": "text"
        },
        "user_outputs": {
            "type": "text"
        },
        "resources_created": {
            "type": "text"
        }  
    }
}

Do you have any additional context?
Later, we will have a separate index to store information related to workflow states for the Stats API to use.

@minalsha
Copy link
Collaborator

@jackiehanyang I am closing this issue since #65 is merged.

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

No branches or pull requests

2 participants