-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Adding scan and tagging utility #4499
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
feat: Adding scan and tagging utility #4499
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
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.
Nice revision Chris! Few questions but I think this looks good overall. Can you please:
- Make the tagging logic specific for unsupported models
- Move the logging into the
add_tags
function
|
||
# Model does not exist in Hub, sync | ||
if not matched_model: | ||
if not matched_model or Version(matched_model.hub_content_version) < Version(model.version): |
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.
Sorry, can you please bring this logic back? Is there a reason you removed it?
@@ -19,6 +19,16 @@ | |||
|
|||
from sagemaker.jumpstart.types import JumpStartDataHolderType, JumpStartModelSpecs | |||
|
|||
class CuratedHubTagName(str, Enum): |
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.
Hmm I still disagree. This enum should only be for UnsupportedFlag
s since it's trying to perform a specific job. If you want to make enums for all tags for CuratedHub models, you can create a new enum, then have a aggregator type
class CuratedHubUnsupportedFlag(str, Enum):
...
class CuratedHubBlahBlah(str, Enum):
...
CuratedHubTag = CuratedHubUnsupportedFlag | CuratedHubBlahBlah
I'd prefer if we didn't overthink this to be generalizable, and cross that bridge when we get there. This is a private beta, and we need to keep the logic rigid.
key: CuratedHubTagName | ||
value: str |
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.
Okay, I'll disagree and commit :). But if you're going to keep this, why not make the key/value
be capitalized so it's compatible with sagemaker:AddTags
?
) | ||
hub_content_versions = list_versions_response["HubContentSummaries"] | ||
|
||
tag_name_to_versions_map: Dict[CuratedHubTagName, List[str]] = {} |
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.
I still disagree here Chris. If you make everything super generalized it loses it's context and makes it really difficult for people to read and understand. Have you heard of any use cases where we want to add additional tags?
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master-jumpstart-curated-hub #4499 +/- ##
===============================================================
Coverage ? 87.15%
===============================================================
Files ? 397
Lines ? 37340
Branches ? 0
===============================================================
Hits ? 32545
Misses ? 4795
Partials ? 0 ☔ View full report in Codecov by Sentry. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue #, if available:
Description of changes:
Testing done:
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
unique_name_from_base
to create resource names in integ tests (if appropriate)By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.