Skip to content

Commit 7b97e0f

Browse files
updated dockerfile
1 parent 8a8bfeb commit 7b97e0f

File tree

1 file changed

+11
-37
lines changed

1 file changed

+11
-37
lines changed
Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,21 @@
1-
# Dockerfile.ppc64le
1+
# Use UBI 9.3 as base image
22
FROM registry.access.redhat.com/ubi9/ubi:9.3
33

4-
LABEL maintainer="Md. Shafi Hussain <[email protected]>"
5-
64
# Install necessary dependencies
75
RUN dnf install -y \
86
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
97
dnf install -y git cmake ninja-build gcc-c++ rust cargo \
10-
python39 python39-devel python39-wheel python39-pip python39-setuptools && \
8+
python3 python3-devel && \
119
dnf clean all
1210

13-
# Link Python and pip to expected paths if not available
14-
RUN if ! command -v python; then ln -s $(command -v python3.9) /usr/bin/python; fi && \
15-
if ! command -v pip; then ln -s $(command -v pip3.9) /usr/bin/pip; fi
16-
17-
# Environment variables
18-
ENV PACKAGE_NAME=pytorch \
19-
PACKAGE_VERSION=v2.4.0 \
20-
PACKAGE_URL=https://github.com/pytorch/pytorch.git \
21-
_GLIBCXX_USE_CXX11_ABI=1
22-
23-
# Clone PyTorch repository and apply patch if necessary
24-
RUN git clone $PACKAGE_URL /workspace/$PACKAGE_NAME && \
25-
cd /workspace/$PACKAGE_NAME && \
26-
git checkout tags/$PACKAGE_VERSION && \
27-
PPC64LE_PATCH="69cbf05" && \
28-
if ! git log --pretty=format:"%H" | grep -q "$PPC64LE_PATCH"; then \
29-
git config user.email "[email protected]" && \
30-
git config user.name "Md. Shafi Hussain" && \
31-
git cherry-pick "$PPC64LE_PATCH"; \
32-
else \
33-
echo "POWER patch not needed."; \
34-
fi
35-
36-
# Set up submodules and install dependencies
37-
RUN cd /workspace/$PACKAGE_NAME && \
38-
git submodule sync && \
39-
git submodule update --init --recursive && \
40-
pip install -r requirements.txt
11+
# Set Python and pip aliases to use Python 3.9
12+
RUN ln -sf /usr/bin/python3 /usr/bin/python && \
13+
ln -sf /usr/bin/pip3 /usr/bin/pip
4114

42-
# Copy the build script to the container
43-
COPY .github/scripts/ppc64le-build.sh /workspace/.github/scripts/ppc64le-build.sh
44-
RUN chmod +x /workspace/.github/scripts/ppc64le-build.sh
15+
# Install Python packages via pip
16+
RUN pip install wheel setuptools
4517

46-
# Default command
47-
CMD ["/workspace/.github/scripts/ppc64le-build.sh"]
18+
# Copy and run the build script from your repository
19+
COPY .github/scripts/ppc64le-build.sh /ppc64le-build.sh
20+
RUN chmod +x /ppc64le-build.sh
21+
ENTRYPOINT ["/ppc64le-build.sh"]

0 commit comments

Comments
 (0)