-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: jumpstart gated model artifacts #4215
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: jumpstart gated model artifacts #4215
Conversation
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 |
|
||
private_bucket_to_return: Optional[str] = None | ||
if ( | ||
constants.ENV_VARIABLE_JUMPSTART_CONTENT_BUCKET_OVERRIDE in os.environ |
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.
why not if os.environ.get(constants.ENV_VARIABLE_JUMPSTART_CONTENT_BUCKET_OVERRIDE):
] | ||
info_logs.append(f"Using JumpStart private bucket override: '{private_bucket_to_return}'") | ||
else: | ||
try: |
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 think it would be cleaner to use os.environ.get
and then throw a value error if the result is None
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.
In the interest of consistency with the other method for public buckets, I'm going to keep as is. Later, I agree it can be refactored
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 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4215 +/- ##
==========================================
+ Coverage 90.27% 90.30% +0.03%
==========================================
Files 993 320 -673
Lines 87861 29687 -58174
==========================================
- Hits 79313 26809 -52504
+ Misses 8548 2878 -5670
☔ View full report in Codecov by Sentry. |
src/sagemaker/jumpstart/accessors.py
Outdated
@@ -127,6 +127,7 @@ class JumpStartModelsAccessor(object): | |||
_curr_region = JUMPSTART_DEFAULT_REGION_NAME | |||
|
|||
_content_bucket: Optional[str] = None | |||
_private_content_bucket: Optional[str] = None |
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.
how about renaming gated_content_bucket
?
same comment throughout the PR
get_jumpstart_private_content_bucket(region) | ||
if model_specs.private_bucket | ||
else get_jumpstart_content_bucket(region) | ||
) |
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.
why not add support for env var override here?
|
||
Raises: | ||
ValueError: If JumpStart is not launched in ``region`` or private content | ||
unavailable in that region. |
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.
nit: missing 'is'; [...] or private content is unavailable [...]
src/sagemaker/jumpstart/types.py
Outdated
@@ -763,6 +769,7 @@ def from_json(self, json_obj: Dict[str, Any]) -> None: | |||
if json_obj.get("default_payloads") | |||
else None | |||
) | |||
self.private_bucket = json_obj.get("private_bucket", False) |
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.
Question - this means private_bucket
should be present in the spec file for a gated model? Just wanted to settle on this flag name as I'm also working on MH change that'll make use of the flag.
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.
private_bucket
should equal True
for gated models
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.
Actually, I'm changing private
--> gated
so it'll be gated_bucket
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 |
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.
Fix typo in docstring please, then LGTM
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 |
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 |
* feat: jumpstart private model artifacts * chore: use gated instead of private keyword
Issue #, if available:
Description of changes:
Enable JumpStart to reference S3 artifacts stored in private bucket.
Testing done:
Unit tests written, integration tests to be added later.
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.