Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add openssh to ompp image for mpi-operator v2 #123

Merged
merged 8 commits into from
Aug 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions ompp-run-ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ ARG DEBIAN_FRONTEND=noninteractive

# For OncoSim MPI inject to the default bashrc as non other exist, can change later
RUN echo "ulimit -S -s 65536" >> etc/bash.bashrc && \
# update base image, install dependencies, cleanup
# update base image, install dependencies, cleanup, install OpenSSH for MPI to communicate between containers
apt-get update && \
apt-get install -y \
openssh-client \
openssh-server \
apt-utils \
curl \
jq \
Expand All @@ -52,6 +54,7 @@ RUN echo "ulimit -S -s 65536" >> etc/bash.bashrc && \
apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/*

# Install kubectl cli to be able to utilize file transfer functionality between containers
ARG KUBECTL_VERSION=v1.28.2
ARG KUBECTL_URL=https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl
ARG KUBECTL_SHA=c922440b043e5de1afa3c1382f8c663a25f055978cbc6e8423493ec157579ec5
Expand All @@ -63,7 +66,16 @@ RUN curl -LO "${KUBECTL_URL}" \

# set local openM++ timezone
RUN rm -f /etc/localtime && \
ln -s /usr/share/zoneinfo/America/Toronto /etc/localtime
ln -s /usr/share/zoneinfo/America/Toronto /etc/localtime && \
mkdir -p /var/run/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.
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

# Done with installation
# set user, work directory and entry point
Expand All @@ -90,4 +102,4 @@ USER $OMPP_USER
SHELL ["/bin/bash"]

# default command check MPIEXEC verson, when used as a kubernetes container override with custom mpiexec execution
CMD mpiexec -V && ulimit -S -s
CMD mpiexec -V && ulimit -S -s
Loading