@@ -12,7 +12,7 @@ if [ ! -d $PATCHING_INFO_PATH/patch-details-archive ] ; then \
12
12
echo $LATEST_RELEASED_IMAGE_SHA >> $PATCHING_INFO_PATH /patch-details-archive/first_image_sha.txt ; \
13
13
fi
14
14
15
- # # We use > instead of >> since we want to override the contents of the previous file.
15
+ # We use > instead of >> since we want to override the contents of the previous file
16
16
echo $LATEST_RELEASED_IMAGE_SHA > $PATCHING_INFO_PATH /patch-details-archive/last_released_image_sha.txt
17
17
18
18
# If patch-details is present, move it to patch-details-archive and add image_sha to the folder
27
27
# Rename the patch-details-current folder to patch-details
28
28
mv $PATCHING_INFO_PATH /patch-details-current $PATCHING_INFO_PATH /patch-details
29
29
30
+ # Language patching
31
+ chmod +x $PATCHING_INFO_PATH /patch-details/install_script_language.sh && \
32
+ $PATCHING_INFO_PATH /patch-details/install_script_language.sh
33
+
34
+
35
+ # #### Temporary Fixes #####
36
+
37
+ # For TF 2.18 training sm gpu, replace entrypoint
38
+ if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/tensorflow-training:2\. 18\. 0-gpu(.+)sagemaker ]]; then
39
+ mv /tmp/new-tf-entrypoint /usr/local/bin/dockerd-entrypoint.py
40
+ chmod +x /usr/local/bin/dockerd-entrypoint.py
41
+ fi
42
+
30
43
# For PT 2.4, 2.5 and 2.6 inference, install openssh-client to make mpi4py working
31
44
if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-inference:2\. [4-6]\. [0-9]+-gpu ]]; then
32
45
apt update && apt install -y --no-install-recommends openssh-client openssh-server && echo " Installed openssh-client openssh-server"
@@ -39,29 +52,19 @@ elif [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\.dkr\.ecr\.us-west-2\.amazon
39
52
curl -o /license.txt https://aws-dlc-licenses.s3.amazonaws.com/pytorch-2.7/license.txt
40
53
fi
41
54
42
- # Install packages and derive history and package diff data
43
- chmod +x $PATCHING_INFO_PATH /patch-details/install_script_language.sh && \
44
- $PATCHING_INFO_PATH /patch-details/install_script_language.sh
45
-
46
55
# Upgrade sagemaker-training
47
56
if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-training:2\. [4-6](.+)sagemaker ]]; then
48
57
pip install -U " sagemaker-training>4.7.4" " protobuf>=4.25.8,<6"
49
58
fi
50
59
51
- # For PT inference sagemaker images, replace torchserve-entrypoint.py with the latest one
52
- # replace start_cuda_compat.sh if it's a gpu image
53
- if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-inference(.+)gpu(.+)sagemaker ]]; then
54
- mv /tmp/new-torchserve-entrypoint /usr/local/bin/dockerd-entrypoint.py
60
+ # For PT inference gpu sagemaker images, replace start_cuda_compat.sh
61
+ if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-inference:2\. [4-6]\. [0-9]+-gpu(.+)sagemaker ]]; then
55
62
mv /tmp/new_pytorch_inference_start_cuda_compat /usr/local/bin/start_cuda_compat.sh
56
- chmod +x /usr/local/bin/dockerd-entrypoint.py
57
63
chmod +x /usr/local/bin/start_cuda_compat.sh
58
- elif [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-inference(.+)sagemaker ]]; then
59
- mv /tmp/new-torchserve-entrypoint /usr/local/bin/dockerd-entrypoint.py
60
- chmod +x /usr/local/bin/dockerd-entrypoint.py
61
64
fi
62
65
63
66
# For PT training gpu sagemaker images, add dynamic cuda compat mounting script to entrypoint
64
- if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-training(.+) gpu(.+)sagemaker ]]; then
67
+ if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\. dkr\. ecr\. us-west-2\. amazonaws\. com/pytorch-training:2 \. [4-6] \. [0-9]+- gpu(.+)sagemaker ]]; then
65
68
mv /tmp/new_start_with_right_hostname /usr/local/bin/start_with_right_hostname.sh
66
69
mv /tmp/new_pytorch_training_start_cuda_compat /usr/local/bin/start_cuda_compat.sh
67
70
chmod +x /usr/local/bin/start_with_right_hostname.sh
@@ -74,7 +77,8 @@ if [[ $LATEST_RELEASED_IMAGE_URI =~ ^763104351884\.dkr\.ecr\.us-west-2\.amazonaw
74
77
rm -rf /usr/local/cuda/bin/nvdisasm*
75
78
fi
76
79
77
- pip cache purge
80
+ # ##########################
81
+
78
82
79
83
# # Update GPG key in case Nginx exists
80
84
VARIABLE=$( apt-key list 2>&1 | { grep -c nginx || true ; }) && \
@@ -84,14 +88,12 @@ if [ $VARIABLE != 0 ]; then \
84
88
apt-key add /usr/share/keyrings/nginx-archive-keyring.gpg;
85
89
fi
86
90
91
+ # OS patching
87
92
chmod +x $PATCHING_INFO_PATH /patch-details/install_script_os.sh && \
88
93
$PATCHING_INFO_PATH /patch-details/install_script_os.sh
89
94
90
- rm -rf /var/lib/apt/lists/* && \
91
- apt-get clean
92
-
95
+ # Derive history and package diff data
93
96
python /opt/aws/dlc/miscellaneous_scripts/derive_history.py
94
-
95
97
python /opt/aws/dlc/miscellaneous_scripts/extract_apt_patch_data.py --save-result-path $PATCHING_INFO_PATH /patch-details/os_summary.json --mode_type modify
96
98
97
99
set -e
@@ -106,4 +108,9 @@ HOME_DIR=/root \
106
108
&& ${HOME_DIR} /oss_compliance/generate_oss_compliance.sh ${HOME_DIR} python \
107
109
&& rm -rf ${HOME_DIR} /oss_compliance* || exit
108
110
111
+ # Clean up
112
+ echo " Cleaning up"
113
+ pip cache purge
114
+ rm -rf /var/lib/apt/lists/* && \
115
+ apt-get clean
109
116
rm -rf /tmp/* && rm -rf /opt/aws/dlc/miscellaneous_scripts
0 commit comments