Feature - Add/Modify/Delete tags for model resource#261
Feature - Add/Modify/Delete tags for model resource#261rkurduka wants to merge 6 commits intoaws-controllers-k8s:mainfrom
Conversation
|
/retest |
| AddTags: | ||
| operation_type: Update | ||
| resource_name: Model |
There was a problem hiding this comment.
This generates code that treats AddTags as the Update API Call to update the model.
There was a problem hiding this comment.
@a-hilaly - Thanks for review.
Sagemaker model API do not have any modify /update method , as fields are immutable except tags . Also Sagemaker API resource only have "ADDTAG" and "DELETE TAG" . So to handle update on this resource will have to use one of these two. So chose "ADD TAGS" and handling "DELETE tags" using template hooks.
Let me know if you think any other approach we can consider
There was a problem hiding this comment.
Agree with Amine, need to discuss this further as we need to throw appropriate error if any other fields except Tags are modified as Model does not have udpate API, maybe implement it completely via hooks
There was a problem hiding this comment.
@surajkota - Added check in update_pre hooks to validate field to update, if it is other than tag , reconciler will update "message" status. Please review
Please let me know if you feel anything else is require
helm/Chart.yaml
Outdated
| description: A Helm chart for the ACK service controller for Amazon SageMaker (SageMaker) | ||
| version: 1.2.7 | ||
| appVersion: 1.2.7 | ||
| version: 0.0.0-non-release-version |
There was a problem hiding this comment.
Please pull the controller tags
| metadata: | ||
| annotations: | ||
| controller-gen.kubebuilder.io/version: v0.14.0 | ||
| controller-gen.kubebuilder.io/version: v0.9.2 |
There was a problem hiding this comment.
You need to install controller-gen v0.14.0
| // this to handle delete/remove tags | ||
| _ , err = rm.deleteTags(ctx,desired,latest) | ||
| if err != nil { | ||
| return nil, err | ||
| } No newline at end of file |
There was a problem hiding this comment.
We don't need to delete the tags before performing a tag update.
There was a problem hiding this comment.
@a-hilaly - as I mentioned above , SDK update method is handling ADDTAGS only and hooks are deleting tags , there is no modify API available for sagemaker model resource . So in SDKUPDATE , first "DeletTags" method look for any deletion request , if not then proceed and look for add tags request .
Let me know if anything else is require.
| ) | ||
|
|
||
| // deleteTags is used to keep tags in sync by calling Create and Delete API's | ||
| func (rm *resourceManager) deleteTags( |
There was a problem hiding this comment.
This function should stay, syncTags and also handle tag creation
There was a problem hiding this comment.
@a-hilaly - same comments as above , let me know if any other approach we should consider here
|
/hold |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: rkurduka The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| } | ||
|
|
||
| // computeTagsDelta returns tags to be added and removed from the resource | ||
| func computeTagsDelta( |
There was a problem hiding this comment.
Sagemaker tag API pattern(addTag/deleteTag) resembles memorydb pattern (TagResource/UntagResource).
We have a reference implementation in memorydb which uses ackcompare.GetTagsDifference helper method which can reduce maintenance of SM controller code. https://github.com/aws-controllers-k8s/memorydb-controller/blob/main/pkg/resource/acl/hooks.go#L92
Can you please look into adopting similar pattern?
There was a problem hiding this comment.
Thanks @surajkota for sharing this , and looking into it . But it seems memoryDB - ACL resource do have "UpdateACL" API method . So we can plug tags manipulation in it , using hooks. But in sagemaker -model case , there is NO update method available , so "SDKUPDATE block doesn't get generated by code-generator . So had to generate that using "ADDTags" in "Operation" Block , and later handling tags CRUD operations in it . Let me know if you have any suggestion in this case. Thanks again
|
@rkurduka: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
Issues go stale after 180d of inactivity. |
|
Stale issues rot after 60d of inactivity. |
|
Rotten issues close after 60d of inactivity. |
|
@ack-bot: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Issue 1732, if available:
Description of changes:
Currently tags modification is not supported for model resource . Hence added require changes to support tags modification.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.