Skip to content

Commit a67b5b1

Browse files
author
Bhanu Teja Goshikonda
committed
fix: move setuptools install to EC2/SageMaker stages for pkg_resources
1 parent f333b46 commit a67b5b1

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,6 @@ RUN echo 'source /usr/local/bin/bash_telemetry.sh' >> /etc/bash.bashrc
229229
# Removing the cache as it is needed for security verification
230230
RUN rm -rf /root/.cache | true
231231

232-
# Install setuptools for pkg_resources required by piplicenses (Python 3.12+ compatibility)
233-
RUN pip install --no-cache-dir setuptools
234-
235232
########################################################
236233
# _____ ____ ____ ___
237234
# | ____/ ___|___ \ |_ _|_ __ ___ __ _ __ _ ___
@@ -251,6 +248,9 @@ FROM common AS ec2
251248

252249
WORKDIR /
253250

251+
# Ensure setuptools is available for OSS compliance (pkg_resources needed by piplicenses)
252+
RUN pip install --no-cache-dir setuptools
253+
254254
COPY setup_oss_compliance.sh setup_oss_compliance.sh
255255
RUN bash setup_oss_compliance.sh ${PYTHON} && rm setup_oss_compliance.sh
256256

@@ -311,6 +311,9 @@ COPY start_with_right_hostname.sh /usr/local/bin/start_with_right_hostname.sh
311311

312312
RUN chmod +x /usr/local/bin/start_with_right_hostname.sh
313313

314+
# Ensure setuptools is available for OSS compliance (pkg_resources needed by piplicenses)
315+
RUN pip install --no-cache-dir setuptools
316+
314317
COPY setup_oss_compliance.sh setup_oss_compliance.sh
315318
RUN bash setup_oss_compliance.sh ${PYTHON} && rm setup_oss_compliance.sh
316319

pytorch/training/docker/2.10/py3/cu130/Dockerfile.gpu

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,6 @@ RUN apt-get update \
184184
# Removing the cache as it is needed for security verification
185185
RUN rm -rf /root/.cache | true
186186

187-
# Install setuptools for pkg_resources required by piplicenses (Python 3.12+ compatibility)
188-
RUN pip install --no-cache-dir setuptools
189-
190187
########################################################
191188
# _____ ____ ____ ___
192189
# | ____/ ___|___ \ |_ _|_ __ ___ __ _ __ _ ___
@@ -211,6 +208,9 @@ WORKDIR /
211208
COPY dockerd_entrypoint.sh /usr/local/bin/dockerd_entrypoint.sh
212209
RUN chmod +x /usr/local/bin/dockerd_entrypoint.sh
213210

211+
# Ensure setuptools is available for OSS compliance (pkg_resources needed by piplicenses)
212+
RUN pip install --no-cache-dir setuptools
213+
214214
COPY setup_oss_compliance.sh setup_oss_compliance.sh
215215
RUN bash setup_oss_compliance.sh ${PYTHON} && rm setup_oss_compliance.sh
216216

@@ -272,6 +272,9 @@ RUN pip install --no-cache-dir -U \
272272
seaborn \
273273
cloudpickle
274274

275+
# Ensure setuptools is available for OSS compliance (pkg_resources needed by piplicenses)
276+
RUN pip install --no-cache-dir setuptools
277+
275278
COPY setup_oss_compliance.sh setup_oss_compliance.sh
276279
RUN bash setup_oss_compliance.sh ${PYTHON} && rm setup_oss_compliance.sh
277280

0 commit comments

Comments
 (0)