Skip to content

Commit c8c6f1e

Browse files
author
Namrata Madan
committed
fix: rename signing key
1 parent 2eb73c9 commit c8c6f1e

134 files changed

Lines changed: 1937 additions & 1680 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎sagemaker-core/pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencies = [
3838
"cloudpickle>=2.0.0",
3939
"paramiko>=2.11.0",
4040
"tblib>=1.7.0",
41+
"cryptography>=46.0.0",
4142
]
4243
requires-python = ">=3.9"
4344
classifiers = [
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
"""Namespace package for SageMaker."""
2-
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2+
3+
__path__ = __import__("pkgutil").extend_path(__path__, __name__)

‎sagemaker-core/src/sagemaker/core/common_utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ def _create_or_update_code_dir(
686686
"""Placeholder docstring"""
687687
code_dir = os.path.join(model_dir, "code")
688688
resolved_code_dir = _get_resolved_path(code_dir)
689-
689+
690690
# Validate that code_dir does not resolve to a sensitive system path
691691
for sensitive_path in _SENSITIVE_SYSTEM_PATHS:
692692
if resolved_code_dir != "/" and resolved_code_dir.startswith(sensitive_path):

‎sagemaker-core/src/sagemaker/core/fw_utils.py‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,7 @@ def tar_and_upload_dir(
458458

459459
try:
460460
source_files = _list_files_to_compress(script, directory) + dependencies
461-
tar_file = utils.create_tar_file(
462-
source_files, os.path.join(tmp, _TAR_SOURCE_FILENAME)
463-
)
461+
tar_file = utils.create_tar_file(source_files, os.path.join(tmp, _TAR_SOURCE_FILENAME))
464462

465463
if kms_key:
466464
extra_args = {"ServerSideEncryption": "aws:kms", "SSEKMSKeyId": kms_key}
@@ -1208,7 +1206,7 @@ def create_image_uri(
12081206
the image uri
12091207
"""
12101208
from sagemaker.core import image_uris
1211-
1209+
12121210
renamed_warning("The method create_image_uri")
12131211
return image_uris.retrieve(
12141212
framework=framework,

‎sagemaker-core/src/sagemaker/core/git_utils.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
from pathlib import Path
2525
from urllib.parse import urlparse
2626

27+
2728
def _sanitize_git_url(repo_url):
2829
"""Sanitize Git repository URL to prevent URL injection attacks.
2930
@@ -84,6 +85,7 @@ def _sanitize_git_url(repo_url):
8485

8586
return repo_url
8687

88+
8789
def git_clone_repo(git_config, entry_point, source_dir=None, dependencies=None):
8890
"""Git clone repo containing the training code and serving code.
8991

‎sagemaker-core/src/sagemaker/core/helper/session_helper.py‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ def _initialize(
240240
self.sagemaker_client = sagemaker_client
241241
else:
242242
from sagemaker.core.user_agent import get_user_agent_extra_suffix
243+
243244
config = botocore.config.Config(user_agent_extra=get_user_agent_extra_suffix())
244245
self.sagemaker_client = self.boto_session.client("sagemaker", config=config)
245246

@@ -1877,7 +1878,7 @@ def expand_role(self, role):
18771878
if "/" in role:
18781879
return role
18791880
return self.boto_session.resource("iam").Role(role).arn
1880-
1881+
18811882

18821883
def _expand_container_def(c_def):
18831884
"""Placeholder docstring"""
@@ -2714,7 +2715,9 @@ def _live_logging_deploy_done(sagemaker_client, endpoint_name, paginator, pagina
27142715
if endpoint_status != "Creating":
27152716
stop = True
27162717
if endpoint_status == "InService":
2717-
LOGGER.info("Created endpoint with name %s. Waiting for it to be InService", endpoint_name)
2718+
LOGGER.info(
2719+
"Created endpoint with name %s. Waiting for it to be InService", endpoint_name
2720+
)
27182721
else:
27192722
time.sleep(poll)
27202723

@@ -2974,4 +2977,4 @@ def container_def(
29742977
c_def["Mode"] = container_mode
29752978
if image_config:
29762979
c_def["ImageConfig"] = image_config
2977-
return c_def
2980+
return c_def

‎sagemaker-core/src/sagemaker/core/image_retriever/image_retriever_utils.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ def _validate_for_suppported_frameworks_and_instance_type(framework, instance_ty
185185

186186
def config_for_framework(framework):
187187
"""Loads the JSON config for the given framework."""
188-
fname = os.path.join(os.path.dirname(__file__), "..", "image_uri_config", "{}.json".format(framework))
188+
fname = os.path.join(
189+
os.path.dirname(__file__), "..", "image_uri_config", "{}.json".format(framework)
190+
)
189191
with open(fname) as f:
190192
return json.load(f)
191193

‎sagemaker-core/src/sagemaker/core/iterators.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def __next__(self):
183183
# print and move on to next response byte
184184
print("Unknown event type:" + chunk)
185185
continue
186-
186+
187187
# Check buffer size before writing to prevent unbounded memory consumption
188188
chunk_size = len(chunk["PayloadPart"]["Bytes"])
189189
current_size = self.buffer.getbuffer().nbytes
@@ -192,6 +192,6 @@ def __next__(self):
192192
f"Line buffer exceeded maximum size of {_MAX_BUFFER_SIZE} bytes. "
193193
f"No newline found in stream."
194194
)
195-
195+
196196
self.buffer.seek(0, io.SEEK_END)
197197
self.buffer.write(chunk["PayloadPart"]["Bytes"])

‎sagemaker-core/src/sagemaker/core/local/data.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,15 @@ def __init__(self, root_path):
121121
super(LocalFileDataSource, self).__init__()
122122

123123
self.root_path = os.path.abspath(root_path)
124-
124+
125125
# Validate that the path is not in restricted locations
126126
for restricted_path in _SENSITIVE_SYSTEM_PATHS:
127127
if self.root_path != "/" and self.root_path.startswith(restricted_path):
128128
raise ValueError(
129129
f"Local Mode does not support mounting from restricted system paths. "
130130
f"Got: {root_path}"
131131
)
132-
132+
133133
if not os.path.exists(self.root_path):
134134
raise RuntimeError("Invalid data source: %s does not exist." % self.root_path)
135135

‎sagemaker-core/src/sagemaker/core/local/utils.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ def get_child_process_ids(pid):
136136
"""
137137
if not str(pid).isdigit():
138138
raise ValueError("Invalid PID")
139-
139+
140140
cmd = ["pgrep", "-P", str(pid)]
141-
141+
142142
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
143143
output, err = process.communicate()
144144
if err:

0 commit comments

Comments
 (0)