Skip to content

Commit aea4e74

Browse files
add uv
1 parent 61dc4df commit aea4e74

File tree

5 files changed

+15
-25
lines changed

5 files changed

+15
-25
lines changed

data/common-safety-ignorelist.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@
22
"51358": "Safety is not packaged with container, it is the result of security scanning process",
33
"76769" : "A vulnerability, which was classified as problematic, was found in PyTorch 2.6.0. Which was built with container and cannot be patched.",
44
"76771" : "A vulnerability, which was classified as problematic, was found in Pytorch version 2.5.1 and prior. Which was built with container and cannot be patched.",
5-
"78828" : "A DoS vulnerability in MKLDNN pooling implementation affecting PyTorch versions < 2.7.1-rc1. Container is PyTorch 2.6.0 and cannot be upgraded to 2.7.1.",
6-
"85151": "Protobuf DoS vulnerability - upgrading to 6.x would break TensorFlow compatibility. Mitigated by input validation.",
7-
"85691": "SageMaker SSL certificate validation issue - fixed in 2.256.0",
8-
"85692": "SageMaker HMAC secret disclosure - fixed in 2.256.0"
5+
"78828" : "A DoS vulnerability in MKLDNN pooling implementation affecting PyTorch versions < 2.7.1-rc1. Container is PyTorch 2.6.0 and cannot be upgraded to 2.7.1."
96
}

tensorflow/training/docker/2.19/py3/Dockerfile.cpu

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ RUN apt-get update \
247247
&& rm -rf /var/lib/apt/lists/* \
248248
&& apt-get clean
249249

250+
# Install UV for faster package installation
251+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
252+
ENV PATH="/root/.cargo/bin:${PATH}"
253+
250254
# https://github.com/yaml/pyyaml/issues/601
251255
# PyYaml less than 6.0.1 failes to build with cython v3 and above.
252256
# tf-models-official uses older versions, breaking the install.
@@ -255,31 +259,26 @@ RUN apt-get update \
255259
# and this is fine since sagemaker is more important than the models and
256260
# the models still work on pyyaml 6 in this context.
257261
# Need to install wheel before we can fix the pyyaml issue below
258-
RUN pip install --no-cache-dir -U \
262+
RUN uv pip install --system --no-cache-dir \
259263
wheel \
260264
"cython<3" \
261265
"pyyaml<6" \
262266
--no-build-isolation
263267

264268
# https://github.com/tensorflow/models/issues/9267
265269
# tf-models does not respect existing installations of TF and always installs open source TF
266-
RUN ${PIP} install \
267-
--default-timeout=300 \
268-
--retries 5 \
269-
--no-cache-dir -U \
270+
RUN uv pip install --system --no-cache-dir \
270271
"tf-models-official==${TF_VERSION}.1" \
271272
"tensorflow-text==${TF_VERSION}.0" \
272273
&& ${PIP} uninstall -y tensorflow tensorflow-gpu \
273-
&& ${PIP} install --no-cache-dir -U \
274+
&& uv pip install --system --no-cache-dir \
274275
${TF_URL} \
275276
"tensorflow-io==0.37.*" \
276277
tensorflow-datasets
277278

278-
# Install rust and cargo
279-
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
280-
ENV PATH="/root/.cargo/bin:${PATH}"
279+
# Rust/cargo already installed with UV
281280

282-
RUN $PYTHON -m pip install --no-cache-dir -U \
281+
RUN uv pip install --system --no-cache-dir \
283282
numba \
284283
bokeh \
285284
imageio \
@@ -288,7 +287,7 @@ RUN $PYTHON -m pip install --no-cache-dir -U \
288287
seaborn \
289288
shap
290289

291-
RUN $PYTHON -m pip install --no-cache-dir -U \
290+
RUN uv pip install --system --no-cache-dir \
292291
sagemaker \
293292
sagemaker-experiments \
294293
sagemaker-tensorflow-training \

tensorflow/training/docker/2.19/py3/Dockerfile.sagemaker.cpu.core_packages.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"setuptools": {
3-
"version_specifier": ">=81.0.0"
4-
},
52
"awscli": {
63
"version_specifier": "<2"
74
},

tensorflow/training/docker/2.19/py3/cu125/Dockerfile.gpu

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,13 @@ RUN $PYTHON -m pip install --no-cache-dir -U \
362362

363363
RUN $PYTHON -m pip install --no-cache-dir -U \
364364
sagemaker \
365-
sagemaker-experiments \
365+
sagemaker-experiments==0.1.45 \
366366
sagemaker-tensorflow-training \
367-
sagemaker-training \
367+
sagemaker-training\
368368
y-py \
369369
sagemaker-studio-analytics-extension \
370-
"sparkmagic<1" \
371-
sagemaker-studio-sparkmagic-lib \
370+
sparkmagic==0.22.0 \
371+
sagemaker-studio-sparkmagic-lib==0.1.4 \
372372
smclarify
373373

374374
# Re-pin numpy after all installs to ensure TF compatibility

tensorflow/training/docker/2.19/py3/cu125/Dockerfile.sagemaker.gpu.core_packages.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"setuptools": {
3-
"version_specifier": ">=81.0.0"
4-
},
52
"awscli": {
63
"version_specifier": "<2"
74
},

0 commit comments

Comments
 (0)