Skip to content

Commit c528069

Browse files
added sudo and vim
1 parent 6dffd08 commit c528069

File tree

1 file changed

+29
-69
lines changed

1 file changed

+29
-69
lines changed
Lines changed: 29 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,4 @@
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
1+
# Stage 1: Main image for ppc64le Ubuntu
132
FROM --platform=linux/ppc64le ubuntu:22.04
143

154
# Set non-interactive mode for apt
@@ -21,80 +10,51 @@ RUN echo "deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports jammy main res
2110
echo "deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
2211
echo "deb [arch=ppc64el] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricted universe multiverse" >> /etc/apt/sources.list
2312

24-
# Update and clean apt
13+
# Update and install basic tools
2514
RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
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 \
15+
apt-get update -o Acquire::Retries=5 -o Acquire::http::Timeout="10" && \
16+
apt-get -y install --no-install-recommends \
3017
build-essential \
31-
sudo \
32-
vim \
33-
cmake \
3418
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 && \
19+
sudo \
20+
gnupg-agent \
21+
iptables iptables-legacy \
22+
ca-certificates \
23+
software-properties-common && \
5624
apt-get clean && rm -rf /var/lib/apt/lists/*
5725

58-
# Replace apt sources for ppc64el
59-
RUN sed -i 's|http://archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' /etc/apt/sources.list && \
60-
sed -i 's|http://security.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' /etc/apt/sources.list
26+
# Switch to iptables-legacy
27+
RUN update-alternatives --set iptables /usr/sbin/iptables-legacy && \
28+
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
6129

62-
# Install additional dependencies
63-
RUN apt-get update && apt-get install -y \
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 && \
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 && \
7133
apt-get update && apt-get install -y \
7234
docker-ce \
7335
docker-ce-cli \
7436
containerd.io && \
7537
apt-get clean && rm -rf /var/lib/apt/lists/*
7638

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
82-
83-
# Copy custom scripts
84-
COPY fs/ /
85-
RUN chmod 777 /usr/bin/actions-runner /usr/bin/entrypoint
39+
# Replace apt sources for ppc64el
40+
RUN sed -i 's|http://archive.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' /etc/apt/sources.list && \
41+
sed -i 's|http://security.ubuntu.com/ubuntu|http://ports.ubuntu.com/ubuntu-ports|g' /etc/apt/sources.list
8642

87-
# Configure GitHub Actions Runner for amd64
88-
#RUN useradd -m actions-runner
89-
#USER actions-runner
90-
#WORKDIR /home/actions-runner
43+
# Install additional dependencies
44+
RUN apt-get update && apt-get install -y \
45+
vim \
46+
python3 \
47+
python3-dev \
48+
python3-pip \
49+
virtualenv && \
50+
apt-get clean && rm -rf /var/lib/apt/lists/*
9151

9252
# Set up Python virtual environment
9353
RUN virtualenv --system-site-packages venv
9454

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
55+
# Copy custom scripts
56+
COPY fs/ /
57+
RUN chmod 777 /usr/bin/actions-runner /usr/bin/entrypoint
9758

9859
# Download and extract GitHub Actions Runner
9960
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-

0 commit comments

Comments
 (0)