Skip to content

Commit afc84fb

Browse files
authored
Merge branch 'master' into asyncWaiterTimeoutHandle
2 parents 127d835 + a58654e commit afc84fb

File tree

5 files changed

+39
-13
lines changed

5 files changed

+39
-13
lines changed

CHANGELOG.md

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## v2.237.3 (2025-01-09)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* pin metadata-version to 2.3
8+
* model server might have already done a serialization. honor that by not decoding the request again if it is not already bytes or bytestream
9+
* Disable jumpstart tests missing clean up logic
10+
* Jumpstart ap southeast 5
11+
* add autogluon 1.2
12+
* updated inference script to cover context
13+
* security update -> use sha256 instead of md5 for file hashing
14+
* Fix Flake8 Violations
15+
* Added parsing string support for situations where custom code might be used (ie. mlflow)
16+
* Updating Inference Optimization Validations
17+
318
## v2.237.2 (2024-12-17)
419

520
### Bug Fixes and Other Changes

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.237.3.dev0
1+
2.237.4.dev0

pyproject.toml

+2
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ pattern = "(?P<version>.+)"
7373
[tool.hatch.metadata.hooks.custom]
7474

7575
[tool.hatch.build.targets.wheel]
76+
core-metadata-version = "2.3"
7677
packages = ["src/sagemaker"]
7778
exclude = ["src/sagemaker/serve/model_server/triton/pack_conda_env.sh"]
7879

7980
[tool.hatch.build.targets.wheel.shared-scripts]
8081
"src/sagemaker/serve/model_server/triton/pack_conda_env.sh" = "pack_conda_env.sh"
8182

8283
[tool.hatch.build.targets.sdist]
84+
core-metadata-version = "2.3"
8385
only-include = [
8486
"/requirements/extras",
8587
"/src",

src/sagemaker/modules/local_core/local_container.py

+10
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ class _LocalContainer(BaseModel):
108108
container_entrypoint: Optional[List[str]]
109109
container_arguments: Optional[List[str]]
110110

111+
_temporary_folders: List[str] = []
112+
111113
def model_post_init(self, __context: Any):
112114
"""Post init method to perform custom validation and set default values."""
113115
self.hosts = [f"algo-{i}" for i in range(1, self.instance_count + 1)]
@@ -201,6 +203,13 @@ def train(
201203

202204
# Print our Job Complete line
203205
logger.info("Local training job completed, output artifacts saved to %s", artifacts)
206+
207+
shutil.rmtree(os.path.join(self.container_root, "input"))
208+
shutil.rmtree(os.path.join(self.container_root, "shared"))
209+
for host in self.hosts:
210+
shutil.rmtree(os.path.join(self.container_root, host))
211+
for folder in self._temporary_folders:
212+
shutil.rmtree(os.path.join(self.container_root, folder))
204213
return artifacts
205214

206215
def retrieve_artifacts(
@@ -540,6 +549,7 @@ def _get_data_source_local_path(self, data_source: DataSource):
540549
uri = data_source.s3_data_source.s3_uri
541550
parsed_uri = urlparse(uri)
542551
local_dir = TemporaryDirectory(prefix=os.path.join(self.container_root + "/")).name
552+
self._temporary_folders.append(local_dir)
543553
download_folder(parsed_uri.netloc, parsed_uri.path, local_dir, self.sagemaker_session)
544554
return local_dir
545555
else:

tests/integ/sagemaker/modules/train/test_local_model_trainer.py

+11-12
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,7 @@ def test_single_container_local_mode_local_data(modules_sagemaker_session):
9292
"compressed_artifacts",
9393
"artifacts",
9494
"model",
95-
"shared",
96-
"input",
9795
"output",
98-
"algo-1",
9996
]
10097

10198
for directory in directories:
@@ -149,14 +146,16 @@ def test_single_container_local_mode_s3_data(modules_sagemaker_session):
149146
assert os.path.exists(os.path.join(CWD, "compressed_artifacts/model.tar.gz"))
150147
finally:
151148
subprocess.run(["docker", "compose", "down", "-v"])
149+
150+
assert not os.path.exists(os.path.join(CWD, "shared"))
151+
assert not os.path.exists(os.path.join(CWD, "input"))
152+
assert not os.path.exists(os.path.join(CWD, "algo-1"))
153+
152154
directories = [
153155
"compressed_artifacts",
154156
"artifacts",
155157
"model",
156-
"shared",
157-
"input",
158158
"output",
159-
"algo-1",
160159
]
161160

162161
for directory in directories:
@@ -204,20 +203,20 @@ def test_multi_container_local_mode(modules_sagemaker_session):
204203

205204
model_trainer.train()
206205
assert os.path.exists(os.path.join(CWD, "compressed_artifacts/model.tar.gz"))
207-
assert os.path.exists(os.path.join(CWD, "algo-1"))
208-
assert os.path.exists(os.path.join(CWD, "algo-2"))
209206

210207
finally:
211208
subprocess.run(["docker", "compose", "down", "-v"])
209+
210+
assert not os.path.exists(os.path.join(CWD, "shared"))
211+
assert not os.path.exists(os.path.join(CWD, "input"))
212+
assert not os.path.exists(os.path.join(CWD, "algo-1"))
213+
assert not os.path.exists(os.path.join(CWD, "algo-2"))
214+
212215
directories = [
213216
"compressed_artifacts",
214217
"artifacts",
215218
"model",
216-
"shared",
217-
"input",
218219
"output",
219-
"algo-1",
220-
"algo-2",
221220
]
222221

223222
for directory in directories:

0 commit comments

Comments
 (0)