Skip to content

Commit f3f70fa

Browse files
Yadan-WeiYadan Wei
and
Yadan Wei
authored
[PyTorch][Training][SageMaker] PyTorch 2.5.1 Currency Release (#4423)
* add sm build spec * fix allowlist * add more vuln in allowlist * oin cloudpickle * run all tests * revert toml * fix toml test name * remove blank line --------- Co-authored-by: Yadan Wei <[email protected]>
1 parent 9053206 commit f3f70fa

6 files changed

+92
-3
lines changed

pytorch/training/buildspec-2-5-sm.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
account_id: &ACCOUNT_ID <set-$ACCOUNT_ID-in-environment>
2+
prod_account_id: &PROD_ACCOUNT_ID 763104351884
3+
region: &REGION <set-$REGION-in-environment>
4+
framework: &FRAMEWORK pytorch
5+
version: &VERSION 2.5.1
6+
short_version: &SHORT_VERSION "2.5"
7+
arch_type: x86
8+
# autopatch_build: "True"
9+
10+
repository_info:
11+
training_repository: &TRAINING_REPOSITORY
12+
image_type: &TRAINING_IMAGE_TYPE training
13+
root: !join [ *FRAMEWORK, "/", *TRAINING_IMAGE_TYPE ]
14+
repository_name: &REPOSITORY_NAME !join [ pr, "-", *FRAMEWORK, "-", *TRAINING_IMAGE_TYPE ]
15+
repository: &REPOSITORY !join [ *ACCOUNT_ID, .dkr.ecr., *REGION, .amazonaws.com/, *REPOSITORY_NAME ]
16+
release_repository_name: &RELEASE_REPOSITORY_NAME !join [ *FRAMEWORK, "-", *TRAINING_IMAGE_TYPE ]
17+
release_repository: &RELEASE_REPOSITORY !join [ *PROD_ACCOUNT_ID, .dkr.ecr., *REGION, .amazonaws.com/, *RELEASE_REPOSITORY_NAME ]
18+
19+
context:
20+
training_context: &TRAINING_CONTEXT
21+
changehostname:
22+
source: docker/build_artifacts/changehostname.c
23+
target: changehostname.c
24+
start_with_right_hostname:
25+
source: docker/build_artifacts/start_with_right_hostname.sh
26+
target: start_with_right_hostname.sh
27+
example_mnist_file:
28+
source: docker/build_artifacts/mnist.py
29+
target: mnist.py
30+
deep_learning_container:
31+
source: ../../src/deep_learning_container.py
32+
target: deep_learning_container.py
33+
34+
images:
35+
BuildSageMakerCPUPTTrainPy3DockerImage:
36+
<<: *TRAINING_REPOSITORY
37+
build: &PYTORCH_CPU_TRAINING_PY3 false
38+
image_size_baseline: 6200
39+
device_type: &DEVICE_TYPE cpu
40+
python_version: &DOCKER_PYTHON_VERSION py3
41+
tag_python_version: &TAG_PYTHON_VERSION py311
42+
os_version: &OS_VERSION ubuntu22.04
43+
tag: !join [ *VERSION, "-", *DEVICE_TYPE, "-", *TAG_PYTHON_VERSION, "-", *OS_VERSION, "-sagemaker" ]
44+
latest_release_tag: !join [ *VERSION, "-", *DEVICE_TYPE, "-", *TAG_PYTHON_VERSION, "-", *OS_VERSION, "-sagemaker" ]
45+
# build_tag_override: "beta:2.5.1-cpu-py311-ubuntu22.04-sagemaker"
46+
docker_file: !join [ docker/, *SHORT_VERSION, /, *DOCKER_PYTHON_VERSION, /Dockerfile., *DEVICE_TYPE ]
47+
target: sagemaker
48+
context:
49+
<<: *TRAINING_CONTEXT
50+
BuildSageMakerGPUPTTrainPy3DockerImage:
51+
<<: *TRAINING_REPOSITORY
52+
build: &PYTORCH_GPU_TRAINING_PY3 false
53+
image_size_baseline: 21500
54+
device_type: &DEVICE_TYPE gpu
55+
python_version: &DOCKER_PYTHON_VERSION py3
56+
tag_python_version: &TAG_PYTHON_VERSION py311
57+
cuda_version: &CUDA_VERSION cu124
58+
os_version: &OS_VERSION ubuntu22.04
59+
tag: !join [ *VERSION, "-", *DEVICE_TYPE, "-", *TAG_PYTHON_VERSION, "-", *CUDA_VERSION, "-", *OS_VERSION, "-sagemaker" ]
60+
latest_release_tag: !join [ *VERSION, "-", *DEVICE_TYPE, "-", *TAG_PYTHON_VERSION, "-", *CUDA_VERSION, "-", *OS_VERSION, "-sagemaker" ]
61+
# build_tag_override: "beta:2.5.1-gpu-py311-cu124-ubuntu22.04-sagemaker"
62+
docker_file: !join [ docker/, *SHORT_VERSION, /, *DOCKER_PYTHON_VERSION, /, *CUDA_VERSION, /Dockerfile.,
63+
*DEVICE_TYPE ]
64+
target: sagemaker
65+
context:
66+
<<: *TRAINING_CONTEXT

pytorch/training/buildspec.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
buildspec_pointer: buildspec-2-5-ec2.yml
1+
buildspec_pointer: buildspec-2-5-sm.yml

pytorch/training/docker/2.5/py3/Dockerfile.cpu

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ RUN /opt/conda/bin/mamba install -y -c conda-forge \
310310
scikit-learn \
311311
seaborn \
312312
shap \
313-
# pinned for sagemaker==2.232.2
313+
# pinned for sagemaker==2.233.0
314314
"cloudpickle==2.2.1" \
315315
&& /opt/conda/bin/mamba clean -afy
316316

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"70612": "[pkg: jinja2] In Jinja2, the from_string function is prone to Server Side Template Injection (SSTI) where it takes the source parameter as a template object, renders it, and then returns it. The attacker can exploit it with INJECTION COMMANDS in a URI. \r\nNOTE: The maintainer and multiple third parties believe that this vulnerability isn't valid because users shouldn't use untrusted templates without sandboxing, reason_to_ignore='N/A', spec='>=0'",
3+
"71584": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform affected versions, enabling a maliciously uploaded LightGBM scikit-learn model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.23.0'",
4+
"71693": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in affected versions of the MLflow platform, enabling a maliciously uploaded pmdarima model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.24.0'",
5+
"71692": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in affected versions of the MLflow platform, enabling a maliciously uploaded Tensorflow model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=2.0.0rc0'",
6+
"71587": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in affected versions of the MLflow platform, enabling a maliciously uploaded PyFunc model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=0.9.0'",
7+
"71589": "[pkg: mlflow] Required by sagemaker. advisory='A path traversal vulnerability exists in mlflow/mlflow version 2.9.2, allowing attackers to access arbitrary files on the server. By crafting a series of HTTP POST requests with specially crafted 'artifact_location' and 'source' parameters, using a local URI with '#' instead of '?', an attacker can traverse the server's directory structure. The issue occurs due to insufficient validation of user-supplied input in the server's handlers.', reason_to_ignore='N/A', spec='>=2.9.2'",
8+
"71577": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.1.0 or newer, enabling a maliciously uploaded scikit-learn model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.1.0'",
9+
"71578": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.1.0 or newer, enabling a maliciously uploaded scikit-learn model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.1.0'",
10+
"71579": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.27.0 or newer, enabling a maliciously crafted Recipe to execute arbitrary code on an end user’s system when run.', reason_to_ignore='N/A', spec='>=1.27.0'"
11+
}

pytorch/training/docker/2.5/py3/cu124/Dockerfile.gpu

+2-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,8 @@ RUN /opt/conda/bin/mamba install -y -c conda-forge \
459459
shap \
460460
scikit-learn \
461461
seaborn \
462-
cloudpickle \
462+
# pinned for sagemaker==2.233.0
463+
"cloudpickle==2.2.1" \
463464
&& /opt/conda/bin/mamba clean -afy
464465

465466
# Copy workaround script for incorrect hostname
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"70612": "[pkg: jinja2] In Jinja2, the from_string function is prone to Server Side Template Injection (SSTI) where it takes the source parameter as a template object, renders it, and then returns it. The attacker can exploit it with INJECTION COMMANDS in a URI. \r\nNOTE: The maintainer and multiple third parties believe that this vulnerability isn't valid because users shouldn't use untrusted templates without sandboxing, reason_to_ignore='N/A', spec='>=0'",
3+
"71584": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform affected versions, enabling a maliciously uploaded LightGBM scikit-learn model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.23.0'",
4+
"71693": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in affected versions of the MLflow platform, enabling a maliciously uploaded pmdarima model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.24.0'",
5+
"71692": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in affected versions of the MLflow platform, enabling a maliciously uploaded Tensorflow model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=2.0.0rc0'",
6+
"71587": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in affected versions of the MLflow platform, enabling a maliciously uploaded PyFunc model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=0.9.0'",
7+
"71589": "[pkg: mlflow] Required by sagemaker. advisory='A path traversal vulnerability exists in mlflow/mlflow version 2.9.2, allowing attackers to access arbitrary files on the server. By crafting a series of HTTP POST requests with specially crafted 'artifact_location' and 'source' parameters, using a local URI with '#' instead of '?', an attacker can traverse the server's directory structure. The issue occurs due to insufficient validation of user-supplied input in the server's handlers.', reason_to_ignore='N/A', spec='>=2.9.2'",
8+
"71577": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.1.0 or newer, enabling a maliciously uploaded scikit-learn model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.1.0'",
9+
"71578": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.1.0 or newer, enabling a maliciously uploaded scikit-learn model to run arbitrary code on an end user’s system when interacted with.', reason_to_ignore='N/A', spec='>=1.1.0'",
10+
"71579": "[pkg: mlflow] Required by sagemaker. advisory='Deserialization of untrusted data can occur in versions of the MLflow platform running version 1.27.0 or newer, enabling a maliciously crafted Recipe to execute arbitrary code on an end user’s system when run.', reason_to_ignore='N/A', spec='>=1.27.0'"
11+
}

0 commit comments

Comments
 (0)