-
Notifications
You must be signed in to change notification settings - Fork 37
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] Resources created in state index and de-provisioning mapping #136
Comments
Just a thought, if we rely on the deprovision API to ascertain the order of deletion from the nodes and edges provided by the use case template (rather than the order the resource appears in the Perhaps something like this :
|
A few thoughts here:
WDYT? |
I think it is important to be transparent to the user regarding what this plugin will be creating behind the scenes when the user creates a workflow. This is critical for users to know what is going on and to keep track of how the different resources are connected and interacting with one another, as well as what the implications are should they choose to de-provision it. I think it is almost equally important to show the associated resources, regardless of if they were created from provision, or just hooking up some existing resource. For example, a user may re-purpose some knn index, or external model connector. It would still be useful to provide that information so the user understands the impacts when those resources change or be deleted, it may cause problems with the workflow (not feasible to dynamically warn the user, but by statically providing the associated resources, it gives the user more transparency). Perhaps we have 2 categories of resources within the state index:
This allows us to both 1/ show everything (created from or just associated with) a workflow, and 2/ have validation logic when de-provisioning to let users be aware of what will be deleted should they proceed. Maybe these could be configured within the step type itself - e.g., create connector step would have a connector created resource tied to it somehow, query index step would have a knn index associated resource tied to it somehow |
Do you suggest having something like adding a variable to each step that highlights the resource it creates (create_connector -> connector) (register_model -> model) and so on? |
Either the resource it creates or an associated resource if it is just utilizing some existing one. |
There could be cases where we can't delete a model because some agent is using it (not 100% sure on current API response in those cases but its possible. Also for example if you delete a running detector before stopping it, it will fail, so you have to have some order of stopping then deleting). Keeping some order of deletion could be helpful so we don't have to think about edge cases, but not an absolute must if we can handle those separately.
Making some internal deletion template makes sense to me so we keep an order of what we want to delete, for adding more detail like you mention we might want to add some variable in each step with the resource name. so its easy for the user to understand and read |
I am okay with that, just wanted to keep to the tenant of as little work as possible for onboarding new steps, this is super small though so probably not a big deal, just meant the less domain knowledge we need to add on each new step is the best but adding a variable for the resource name is very low effort if thats what we go with |
Understood - I think its reasonable that for any new steps onboarded, adding resource-related details (if applicable) is a requirement. I still think separating into 2 parts (created or just associated) will be needed, or at least some way to discern the two so the de-provision / delete APIs can work as expected. |
@amitgalitz In terms of having another id in the So, the status API should return "resources_created": [
{
"type": "create_index_step",
"index_name": "xyz"
},
{
"type": "register_model",
"model_id": "abc",
"model_status": "CREATED"
}
]
We already have a workflowID to map the resources created for that specific provisioning and user can use the same to retrieve the information. |
Are you okay with doing something like:
|
We can just query the "resources_created": [
"create_index_step": {
"index_name": "xyz"
},
"register_model": {
"model_id": "abc",
"model_status": "CREATED"
}
] |
No strong opinion on that part. My only suggestion is we need a separate field in the state index to persist associated resources - ones not created from provision, but associated with some existing resource. I think however we are generating the |
I'll say yes in general, as I need two pieces of information to properly deprovision these resources:
It's nice to have the step that created it as well. Might need another entry for "dependent resource" such as if the model ID is associated with a connector, I need to delete the model first and then the connector (I think?). For the specific example with a model_id, I'm not sure that's the correct resource name/type. Is it a connector-based model ID? Local? Remote? More information is better. |
After some additional conversation the current solution I'll go ahead with is having a mapping more similar to what @owaiskazi19 suggested: I do agree about potentially having associated resources as a separate field and dependent resources but this wont be apart of the first implemented solution.
|
@amitgalitz I think this can probably be closed given work in #231 and related PRs. I know we are still considering adding a timestamp for creation time but otherwise the existing implementation is sufficient. |
Is your feature request related to a problem?
Right now we have a resources created field in the state index but there are a few ways on how we want to store this information.
What solution would you like?
We can either map the ID of what was created to the type/name of the workflow step that created it or to the object name itself.
Option 1 [Preferred]:
Option 2:
I think it makes sense to map the created objected to the step that created it, in order to avoid adding another category of things like
model/index/agent
.However two things we need to consider are:
The order of the created objects in terms of de-provisioning order. Especially if some things depend on each other. For example do we need to delete the agent first before deleting the model that uses it. We can also potentially get this order from the use case template's nodes and edges themselves and delete in reverse order.
How will we map each workflow step that created the resources to the workflow step that deletes the resources. We should probably have a way to match the create request to the equivalent delete request when we add workflow nodes/steps.
There could be a global delete map that looks something like this, this would be however another thing to maintain when adding new steps:
create_api:delete_api
Current Solution:
Additional Context
Right now we have some implementation of updating the resources created field in CreateConnectorStep. We should decide if we want to add more information here by fetching the resource name from some enum.
Additionally we can abstract the method in CreateConnectorStep to be used by all steps easily as mentioned in this comment: #148 (comment)
The text was updated successfully, but these errors were encountered: