-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: enable kms support for repack_model #1061
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
Changes from 1 commit
dc07547
92814f7
60cdfa1
392216a
1a19e9f
5c7b4e8
c3ed16c
45ec7d5
0cb4d9a
e77701b
4bcb042
f992f2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -547,6 +547,7 @@ def deploy( | |
) | ||
model = self._compiled_models[family] | ||
else: | ||
kwargs["output_kms_key"] = self.output_kms_key | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realize that I'm probably the source of this problem (with one of my recent code changes), but should we distinguish more between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we repack the model the new model tar ball is uploaded to the same bucket. we need to use the same output_kms_key in the estimator, otherwise uploading the repacked tar ball will fail. I can't really think of any use case where you would want a different kms key since we don't allow user to specify a new bucket when deploy is called. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe let's rename the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i will do model_kms_key |
||
model = self.create_model(**kwargs) | ||
model.name = model_name | ||
return model.deploy( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,6 +79,7 @@ def __init__( | |
vpc_config=None, | ||
sagemaker_session=None, | ||
enable_network_isolation=False, | ||
output_kms_key=None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. docstring? (same for the rest) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. k |
||
): | ||
"""Initialize an SageMaker ``Model``. | ||
|
||
|
@@ -127,6 +128,7 @@ def __init__( | |
self.endpoint_name = None | ||
self._is_compiled_model = False | ||
self._enable_network_isolation = enable_network_isolation | ||
self.output_kms_key = output_kms_key | ||
|
||
def prepare_container_def( | ||
self, instance_type, accelerator_type=None | ||
|
@@ -799,6 +801,7 @@ def _upload_code(self, key_prefix, repack=False): | |
model_uri=self.model_data, | ||
repacked_model_uri=repacked_model_data, | ||
sagemaker_session=self.sagemaker_session, | ||
kms_key=self.output_kms_key, | ||
) | ||
|
||
self.repacked_model_data = repacked_model_data | ||
|
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.
is there something here that should actually get used?
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 am only fixing TensorFlow and SKLearn for now. I think all other frameworks needs more fixes than this one(similar to the fixes I added to sklearn). That work should be properly scheduled and we should add integ tests as well.