File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed
deployments/container/nvbandwidth Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ RUN git clone --branch ${NVBANDWIDTH_VERSION} --depth 1 --single-branch https://
4040
4141FROM nvcr.io/nvidia/cuda:12.6.2-base-ubuntu22.04
4242
43+ ARG port=2222
44+
4345RUN apt-get update && apt-get install -y --no-install-recommends \
4446 openmpi-bin \
4547 openmpi-common \
@@ -50,6 +52,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5052
5153RUN mkdir -p /var/run/sshd
5254
55+ # Got it from mpi-operator/build/base/Dockerfile
56+ # Allow OpenSSH to talk to containers without asking for confirmation
57+ # by disabling StrictHostKeyChecking.
58+ # mpi-operator mounts the .ssh folder from a Secret. For that to work, we need
59+ # to disable UserKnownHostsFile to avoid write permissions.
60+ # Disabling StrictModes avoids directory and files read permission checks.
61+ RUN sed -i 's/[ #]\( .*StrictHostKeyChecking \) .*/ \1 no/g' /etc/ssh/ssh_config && \
62+ echo " UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config && \
63+ sed -i 's/#\( StrictModes \) .*/\1 no/g' /etc/ssh/sshd_config
64+
65+ RUN useradd -m mpiuser
66+ WORKDIR /home/mpiuser
67+
68+ COPY --chown=mpiuser ./deployments/container/nvbandwidth/sshd_config .sshd_config
69+ RUN echo "Port $port" >> /home/mpiuser/.sshd_config
70+
5371COPY --from=builder /bandwidthtest/nvbandwidth/nvbandwidth /usr/bin
5472
5573ENTRYPOINT ["mpirun" ]
Original file line number Diff line number Diff line change 1+ PidFile /home/mpiuser/sshd.pid
2+ HostKey /home/mpiuser/.ssh/id_rsa
3+ StrictModes no
You can’t perform that action at this time.
0 commit comments