@@ -6,11 +6,11 @@ ENV LC_ALL=C.UTF-8
66ENV LANG=C.UTF-8
77ENV LANGUAGE=C.UTF-8
88
9- ARG DEVTOOLSET_VERSION=13
9+ ARG DEVTOOLSET_VERSION=14
1010
1111# Create symbolic links for Python 3.12
12- RUN ln -sf /opt/python/cp312-cp312/bin/python3.12 /usr/bin/python3 && \
13- ln -sf /opt/python/cp312-cp312/bin/python3.12 /usr/bin/python
12+ # RUN ln -sf /opt/python/cp312-cp312/bin/python3.12 /usr/bin/python3 && \
13+ # ln -sf /opt/python/cp312-cp312/bin/python3.12 /usr/bin/python
1414
1515# Install required system dependencies
1616RUN yum -y install epel-release && \
@@ -67,7 +67,7 @@ RUN yum -y install epel-release && \
6767
6868
6969# Ensure the correct Python version is used
70- ENV PATH=/opt/python/cp312-cp312/bin:$PATH
70+ # ENV PATH=/opt/python/cp312-cp312/bin:$PATH
7171# Add gcc-toolset to the path
7272ENV PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/bin:$PATH
7373ENV LD_LIBRARY_PATH=/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib64:/opt/rh/gcc-toolset-${DEVTOOLSET_VERSION}/root/usr/lib:$LD_LIBRARY_PATH
@@ -78,24 +78,36 @@ RUN git config --global --add safe.directory "*"
7878# installed python doesn't have development parts. Rebuild it from scratch
7979RUN /bin/rm -rf /opt/_internal /opt/python /usr/local/*/*
8080
81- RUN alternatives --set python /usr/bin/python3.12
82- RUN alternatives --set python3 /usr/bin/python3.12
83-
84- RUN pip-3.12 install typing_extensions
85-
8681# EPEL for cmake
8782FROM base as patchelf
83+
84+ # Instead of ADD ./common/install_cpython.sh ...
85+ RUN git clone --depth 1 --branch temp-gha-runner-v2 https://github.com/sandeepgupta12/pytorch.git /tmp/pytorch && \
86+ cp /tmp/pytorch/.ci/docker/common/install_patchelf.sh /build_scripts/install_patchelf.sh
8887# Install patchelf
89- ADD ./common/install_patchelf.sh install_patchelf.sh
90- RUN bash ./install_patchelf.sh && rm install_patchelf.sh
88+ # ADD ./common/install_patchelf.sh install_patchelf.sh
89+ #RUN bash ./install_patchelf.sh && rm install_patchelf.sh
90+ #ENV CPYTHON_VERSIONS="3.10.1"
91+ #RUN echo "CPYTHON_VERSIONS=$CPYTHON_VERSIONS" && bash -x /build_scripts/install_cpython.sh
92+ #ENV SSL_CERT_FILE=""
93+ #RUN curl -fL https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
94+ RUN bash /build_scripts/install_patchelf.sh && rm -r /build_scripts
9195RUN cp $(which patchelf) /patchelf
9296
9397FROM patchelf as python
98+
99+ # Clone only required scripts from the PyTorch repo
100+ RUN mkdir -p /build_scripts && \
101+ cp -r /tmp/pytorch/.ci/docker/manywheel/build_scripts/* /build_scripts/ && \
102+ cp /tmp/pytorch/.ci/docker/common/install_cpython.sh /build_scripts/install_cpython.sh && \
103+ rm -rf /tmp/pytorch
94104# build python
95- COPY manywheel/build_scripts /build_scripts
96- ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh
105+ # COPY manywheel/build_scripts /build_scripts
106+ # ADD ./common/install_cpython.sh /build_scripts/install_cpython.sh
97107ENV SSL_CERT_FILE=
98- RUN bash build_scripts/build.sh && rm -r build_scripts
108+ # Run the build script
109+ RUN bash /build_scripts/build.sh && rm -r /build_scripts
110+ #RUN bash build_scripts/build.sh && rm -r build_scripts
99111#RUN bash build_scripts/build.sh || (echo "Checksum verification failed!" && exit 1)
100112
101113FROM base as final
@@ -104,6 +116,11 @@ COPY --from=python /opt/_internal /opt/_inter
104116COPY --from=python /opt/python/cp39-cp39/bin/auditwheel /usr/local/bin/auditwheel
105117COPY --from=patchelf /usr/local/bin/patchelf /usr/local/bin/patchelf
106118
119+ RUN alternatives --set python /usr/bin/python3.12
120+ RUN alternatives --set python3 /usr/bin/python3.12
121+
122+ RUN pip-3.12 install typing_extensions
123+
107124# Install required Python packages
108125#RUN pip install --upgrade pip
109126#RUN pip install typing_extensions pyyaml setuptools
0 commit comments