Skip to content

Commit 3d37d7d

Browse files
updated docker file
1 parent 3170f9d commit 3d37d7d

File tree

2 files changed

+70
-30
lines changed

2 files changed

+70
-30
lines changed
Lines changed: 69 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# Stage 1: Main image for ppc64le Ubuntu
1+
# Stage 1: Temporary image for amd64 dependencies
2+
#FROM docker.io/amd64/ubuntu:22.04 AS ld-prefix
3+
#ENV DEBIAN_FRONTEND=noninteractive
4+
5+
# Install amd64-specific dependencies
6+
#RUN apt-get update -o Acquire::Retries=3 && apt-get install -y \
7+
# ca-certificates \
8+
# libicu70 \
9+
# libssl3 && \
10+
# apt-get clean && rm -rf /var/lib/apt/lists/*
11+
12+
# Stage 2: Main image for ppc64le Ubuntu
213
FROM --platform=linux/ppc64le ubuntu:22.04
314

415
# Set non-interactive mode for apt
@@ -10,30 +21,38 @@ RUN echo "deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports jammy main res
1021
echo "deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
1122
echo "deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse" >> /etc/apt/sources.list
1223

13-
# Update and install basic tools
24+
# Update and clean apt
1425
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
15-
apt-get update -o Acquire::Retries=5 -o Acquire::http::Timeout="10" && \
16-
apt-get -y install --no-install-recommends \
26+
apt-get update -o Acquire::Retries=5 -o Acquire::http::Timeout="10"
27+
28+
# Install dependencies for building and testing PyTorch
29+
RUN apt-get update && apt-get -y install --no-install-recommends \
1730
build-essential \
18-
curl \
1931
sudo \
20-
gnupg-agent \
21-
iptables iptables-legacy \
22-
ca-certificates \
23-
software-properties-common && \
24-
apt-get clean && rm -rf /var/lib/apt/lists/*
25-
26-
# Switch to iptables-legacy
27-
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy && \
28-
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
29-
30-
# Add Docker GPG key and repository
31-
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
32-
echo "deb [arch=ppc64el signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
33-
apt-get update && apt-get install -y \
34-
docker-ce \
35-
docker-ce-cli \
36-
containerd.io && \
32+
vim \
33+
cmake \
34+
curl \
35+
gcc \
36+
git \
37+
jq \
38+
zip \
39+
libxml2-dev \
40+
libxslt-dev \
41+
ninja-build \
42+
python-is-python3 \
43+
python3 \
44+
python3-dev \
45+
python3-pip \
46+
pybind11-dev \
47+
python3-numpy \
48+
libopenblas-dev \
49+
liblapack-dev \
50+
libgloo-dev \
51+
python3-yaml \
52+
python3-scipy \
53+
virtualenv \
54+
wget \
55+
ca-certificates && \
3756
apt-get clean && rm -rf /var/lib/apt/lists/*
3857

3958
# Replace apt sources for ppc64el
@@ -42,19 +61,40 @@ RUN sed -i 's|http://archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-po
4261

4362
# Install additional dependencies
4463
RUN apt-get update && apt-get install -y \
45-
vim \
46-
python3 \
47-
python3-dev \
48-
python3-pip \
49-
virtualenv && \
64+
apt-transport-https \
65+
ca-certificates \
66+
curl \
67+
gnupg-agent \
68+
software-properties-common && \
69+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
70+
echo "deb [arch=ppc64el] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
71+
apt-get update && apt-get install -y \
72+
docker-ce \
73+
docker-ce-cli \
74+
containerd.io && \
5075
apt-get clean && rm -rf /var/lib/apt/lists/*
5176

52-
# Set up Python virtual environment
53-
RUN virtualenv --system-site-packages venv
77+
# Copy amd64 dependencies from the ld-prefix stage
78+
#COPY --from=ld-prefix / /usr/x86_64-linux-gnu/
79+
#RUN ln -fs ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /usr/x86_64-linux-gnu/lib64/
80+
#RUN ln -fs /etc/resolv.conf /usr/x86_64-linux-gnu/etc/
81+
#ENV QEMU_LD_PREFIX=/usr/x86_64-linux-gnu
5482

5583
# Copy custom scripts
5684
COPY fs/ /
5785
RUN chmod 777 /usr/bin/actions-runner /usr/bin/entrypoint
5886

87+
# Configure GitHub Actions Runner for amd64
88+
#RUN useradd -m actions-runner
89+
#USER actions-runner
90+
#WORKDIR /home/actions-runner
91+
92+
# Set up Python virtual environment
93+
RUN virtualenv --system-site-packages venv
94+
95+
# Copy prebuilt manywheel docker image for builds and tests
96+
COPY --chown=actions-runner:actions-runner manywheel-ppc64le.tar /home/actions-runner/manywheel-ppc64le.tar
97+
5998
# Download and extract GitHub Actions Runner
6099
RUN curl -L https://github.com/actions/runner/releases/download/v2.317.0/actions-runner-linux-x64-2.317.0.tar.gz | tar -xz
100+

.github/workflows/Dockerfile.ppc64le

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ COPY requirements.txt .
1717
# Install Python packages via pip
1818
RUN pip install wheel setuptools pyyaml typing_extensions expecttest
1919

20-
RUN pip install -r requirements.txt
20+
#RUN pip install -r requirements.txt
2121

2222
# Copy the PyTorch source code into the container
2323
COPY . /workspace/pytorch

0 commit comments

Comments
 (0)