-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: make instance type fields as optional #3135
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
fix: make instance type fields as optional #3135
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 |
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 |
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 Report
@@ Coverage Diff @@
## master #3135 +/- ##
==========================================
- Coverage 89.69% 89.62% -0.07%
==========================================
Files 1048 200 -848
Lines 87811 17391 -70420
==========================================
- Hits 78763 15587 -63176
+ Misses 9048 1804 -7244
Continue to review full report at Codecov.
|
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 |
src/sagemaker/pipeline.py
Outdated
@@ -313,7 +313,7 @@ def register( | |||
if model.model_data is None: | |||
raise ValueError("SageMaker Model Package cannot be created without model data.") | |||
if model_package_group_name is not None: | |||
container_def = self.pipeline_container_def(inference_instances[0]) | |||
container_def = self.pipeline_container_def(inference_instances[0] if inference_instances else 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.
Can you also update the instance_type
argument in pipeline_container_def
and make its default value is None?
https://github.com/aws/sagemaker-python-sdk/blob/master/src/sagemaker/pipeline.py#L87
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.
Done.
raise ValueError( | ||
"content_types, response_types, inference_inferences and transform_instances " | ||
"content_types and response_types " | ||
"must be provided if containers is present." | ||
) |
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.
This thrown error was added by sreedes@. Did you check with her to see if she agree on this?
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.
Discussed the same with Saumitra and got approval for this change
assert pipeline_session_mock.context is None | ||
assert create_step_args.create_model_request | ||
assert not create_step_args.create_model_package_request | ||
assert len(create_step_args.need_runtime_repack) == 1 |
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: seems that you only update the model.register() and this test should focus on your changes - "without instance_types". Thus I guess we don't need to test the model.create case here
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.
Removed.
assert not pipeline_session_mock.context | ||
assert not register_step_args.create_model_request | ||
assert register_step_args.create_model_package_request | ||
assert len(register_step_args.need_runtime_repack) == 0 |
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: same above, these validations should focus on your changes, which is how removing instance_type impacting the register_step_args.create_model_package_request
Please remove the validations of 157, 158 and 160. And elaborate a little bit on line 159 if possible
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.
Changed as per request
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:
Make instance type fields as Optional in SDK, to be in sync with the API.
Testing done:
unit
Commands Used:
tox -e py39 tests/unit
tox -e py39 tests/unit/sagemaker/workflow/test_pipeline_session.py::test_pipeline_session_context_for_model_step_without_instance_types
tox -e py39 tests/unit/test_session.py::test_create_model_package_from_containers_without_instance_types
tox -e py39 tests/unit/test_estimator.py::test_register_default_image_without_instance_type_args
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.