-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add base images and make PI samples inherit from it
- Loading branch information
1 parent
8f5bbd8
commit dab4633
Showing
11 changed files
with
102 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM debian:buster | ||
|
||
RUN apt update && apt install -y --no-install-recommends \ | ||
openssh-server \ | ||
openssh-client \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Add priviledge separation directoy to run sshd as root. | ||
RUN mkdir -p /var/run/sshd | ||
# Add capability to run sshd as non-root. | ||
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/sbin/sshd | ||
|
||
# Allow OpenSSH to talk to containers without asking for confirmation | ||
# by disabling StrictHostKeyChecking. | ||
# mpi-operator mounts the .ssh folder from a Secret. For that to work, we need | ||
# to disable UserKnownHostsFile to avoid write permissions. | ||
# Disabling StrictModes avoids directory and files read permission checks. | ||
RUN sed -i 's/[ #]\(.*StrictHostKeyChecking \).*/ \1no/g' /etc/ssh/ssh_config \ | ||
&& echo " UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config \ | ||
&& sed -i 's/#\(StrictModes \).*/\1no/g' /etc/ssh/sshd_config | ||
|
||
RUN useradd -m mpiuser | ||
WORKDIR /home/mpiuser | ||
# Configurations for running sshd as non-root. | ||
COPY --chown=mpiuser sshd_config .sshd_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM bash AS downloader | ||
|
||
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB -O key.PUB | ||
|
||
FROM debian:buster | ||
|
||
COPY --from=downloader key.PUB /tmp/key.PUB | ||
|
||
# Install Intel oneAPI keys. | ||
RUN apt update \ | ||
&& apt install -y --no-install-recommends gnupg2 ca-certificates \ | ||
&& apt-key add /tmp/key.PUB \ | ||
&& rm /tmp/key.PUB \ | ||
&& echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list \ | ||
&& apt remove -y gnupg2 ca-certificates \ | ||
&& apt autoremove -y \ | ||
&& apt update \ | ||
&& apt install -y --no-install-recommends \ | ||
libstdc++-8-dev binutils \ | ||
intel-oneapi-compiler-dpcpp-cpp \ | ||
intel-oneapi-mpi-devel \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV I_MPI_CC=clang I_MPI_CXX=clang++ |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM bash AS downloader | ||
|
||
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB -O key.PUB | ||
|
||
|
||
FROM mpioperator/base | ||
|
||
COPY --from=downloader key.PUB /tmp/key.PUB | ||
|
||
# Install Intel oneAPI keys. | ||
RUN apt update \ | ||
&& apt install -y --no-install-recommends gnupg2 ca-certificates \ | ||
&& apt-key add /tmp/key.PUB \ | ||
&& rm /tmp/key.PUB \ | ||
&& echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list \ | ||
&& apt remove -y gnupg2 ca-certificates \ | ||
&& apt autoremove -y \ | ||
&& apt update \ | ||
&& apt install -y --no-install-recommends \ | ||
dnsutils \ | ||
intel-oneapi-mpi \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
COPY intel-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
FROM debian:buster as builder | ||
|
||
RUN apt update && apt install -y --no-install-recommends \ | ||
g++ \ | ||
libopenmpi-dev \ | ||
&& rm -rf /var/lib/apt/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM mpioperator/base | ||
|
||
RUN apt update && \ | ||
apt install -y --no-install-recommends openmpi-bin && \ | ||
rm -rf /var/lib/apt/lists/* |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,9 @@ | ||
FROM debian:buster as builder | ||
|
||
RUN apt update && apt install -y --no-install-recommends \ | ||
g++ \ | ||
libopenmpi-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
FROM mpioperator/openmpi-builder as builder | ||
|
||
COPY pi.cc /src/pi.cc | ||
RUN mpic++ /src/pi.cc -o /pi | ||
|
||
|
||
FROM debian:buster | ||
|
||
RUN apt update && apt install -y --no-install-recommends \ | ||
openmpi-bin \ | ||
openssh-server \ | ||
openssh-client \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
# Add priviledge separation directoy to run sshd as root. | ||
RUN mkdir -p /var/run/sshd | ||
# Add capability to run sshd as non-root. | ||
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/sbin/sshd | ||
FROM mpioperator/openmpi | ||
|
||
RUN useradd -m mpiuser | ||
WORKDIR /home/mpiuser | ||
COPY --chown=mpiuser sshd_config .sshd_config | ||
# Allow OpenSSH to talk to containers without asking for confirmation | ||
# by disabling StrictHostKeyChecking. | ||
# mpi-operator mounts the .ssh folder from a Secret. For that to work, we need | ||
# to disable UserKnownHostsFile to avoid write permissions. | ||
# Disabling StrictModes avoids directory and files read permission checks. | ||
RUN sed -i 's/[ #]\(.*StrictHostKeyChecking \).*/ \1no/g' /etc/ssh/ssh_config && \ | ||
echo " UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config && \ | ||
sed -i 's/#\(StrictModes \).*/\1no/g' /etc/ssh/sshd_config | ||
COPY --from=builder /pi /home/mpiuser/pi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,9 @@ | ||
FROM bash AS downloader | ||
FROM mpioperator/intel-builder as builder | ||
|
||
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB -O key.PUB | ||
|
||
|
||
FROM debian:buster as base | ||
|
||
COPY --from=downloader key.PUB /tmp/key.PUB | ||
|
||
# Install Intel oneAPI keys. | ||
RUN apt update \ | ||
&& apt install -y --no-install-recommends gnupg2 ca-certificates \ | ||
&& apt-key add /tmp/key.PUB \ | ||
&& rm /tmp/key.PUB \ | ||
&& echo "deb https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list \ | ||
&& apt remove -y gnupg2 ca-certificates \ | ||
&& apt autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
FROM base as builder | ||
|
||
RUN apt update \ | ||
&& apt install -y --no-install-recommends \ | ||
libstdc++-8-dev binutils \ | ||
intel-oneapi-compiler-dpcpp-cpp \ | ||
intel-oneapi-mpi-devel \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV I_MPI_CC=clang I_MPI_CXX=clang++ | ||
COPY pi.cc /src/pi.cc | ||
RUN bash -c "source /opt/intel/oneapi/setvars.sh && mpicxx /src/pi.cc -o /pi" | ||
|
||
|
||
FROM base | ||
|
||
RUN apt update \ | ||
&& apt install -y --no-install-recommends \ | ||
openssh-server \ | ||
openssh-client \ | ||
dnsutils \ | ||
intel-oneapi-mpi \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Add priviledge separation directoy to run sshd as root. | ||
RUN mkdir -p /var/run/sshd | ||
# Add capability to run sshd as non-root. | ||
RUN setcap CAP_NET_BIND_SERVICE=+eip /usr/sbin/sshd | ||
|
||
RUN useradd -m mpiuser | ||
WORKDIR /home/mpiuser | ||
COPY intel-entrypoint.sh /entrypoint.sh | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
COPY --chown=mpiuser sshd_config .sshd_config | ||
# Allow OpenSSH to talk to containers without asking for confirmation | ||
# by disabling StrictHostKeyChecking. | ||
# mpi-operator mounts the .ssh folder from a Secret. For that to work, we need | ||
# to disable UserKnownHostsFile to avoid write permissions. | ||
# Disabling StrictModes avoids directory and files read permission checks. | ||
RUN sed -i 's/[ #]\(.*StrictHostKeyChecking \).*/ \1no/g' /etc/ssh/ssh_config && \ | ||
echo " UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config && \ | ||
sed -i 's/#\(StrictModes \).*/\1no/g' /etc/ssh/sshd_config | ||
FROM mpioperator/intel | ||
|
||
COPY --from=builder /pi /home/mpiuser/pi |