Skip to content

fix: don't try to use local output path for KMS key in Local Mode #1516

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
merged 2 commits into from
May 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/sagemaker/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1722,11 +1722,14 @@ def _stage_user_code_in_s3(self):
code_bucket = self.sagemaker_session.default_bucket()
code_s3_prefix = "{}/{}".format(self._current_job_name, "source")
kms_key = None

elif self.code_location is None:
code_bucket, _ = parse_s3_url(self.output_path)
code_s3_prefix = "{}/{}".format(self._current_job_name, "source")
kms_key = self.output_kms_key
elif local_mode:
code_bucket, key_prefix = parse_s3_url(self.code_location)
code_s3_prefix = "/".join(filter(None, [key_prefix, self._current_job_name, "source"]))
kms_key = None
else:
code_bucket, key_prefix = parse_s3_url(self.code_location)
code_s3_prefix = "/".join(filter(None, [key_prefix, self._current_job_name, "source"]))
Expand Down
1 change: 1 addition & 0 deletions tests/integ/test_local_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ def test_mxnet_training_failure(sagemaker_local_session, mxnet_full_version, tmp
train_instance_count=1,
train_instance_type="local",
sagemaker_session=sagemaker_local_session,
code_location="s3://{}".format(sagemaker_local_session.default_bucket()),
output_path="file://{}".format(tmpdir),
)

Expand Down