Skip to content

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

Merged

Conversation

chrstfu
Copy link
Contributor

@chrstfu chrstfu commented Mar 13, 2024

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

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used 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.

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 5f8119b
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link
Collaborator

@bencrabtree bencrabtree left a 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:

  1. Make the tagging logic specific for unsupported models
  2. 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):
Copy link
Collaborator

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):
Copy link
Collaborator

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 UnsupportedFlags 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.

Comment on lines 46 to 47
key: CuratedHubTagName
value: str
Copy link
Collaborator

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]] = {}
Copy link
Collaborator

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?

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 554dd20
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 6d5f599
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 79.13043% with 24 lines in your changes are missing coverage. Please review.

❗ No coverage uploaded for pull request base (master-jumpstart-curated-hub@a632795). Click here to learn what that means.

Files Patch % Lines
src/sagemaker/jumpstart/curated_hub/curated_hub.py 34.37% 21 Missing ⚠️
src/sagemaker/jumpstart/cache.py 72.72% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 77d7b50
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 42efbaa
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 0deb20e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: d21fd41
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 6b107a2
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: bd02739
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@bencrabtree bencrabtree self-requested a review March 19, 2024 13:54
@mufaddal-rohawala
Copy link
Member

AWS CodeBuild CI Report

  • CodeBuild project: sagemaker-python-sdk-pr
  • Commit ID: 4c829c9
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@chrstfu chrstfu marked this pull request as ready for review March 19, 2024 17:32
@chrstfu chrstfu requested a review from a team as a code owner March 19, 2024 17:32
@chrstfu chrstfu requested review from knikure and removed request for a team March 19, 2024 17:32
@benieric benieric merged commit 74bbb09 into aws:master-jumpstart-curated-hub Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants