open-mpi / ompi

Open MPI main development repository
https://www.open-mpi.org
Other
2.17k stars 860 forks source link

Can we use OpenMpi on Docker Container? #3625

Closed yoshihingis closed 7 years ago

yoshihingis commented 7 years ago

Dear OpenMpi team staff

I tried to make very simple Dockerfile to check the operation of OpenMpi on the docker container.

But I got the caution about the risk of "root run". Hence I added the option "--allow-run-as-root",because we can start up docker container as root.

But I could not build Docker Image of "OpenMpi test". I got error as below at the end of Dockerfile build.

(1)Could you give me any advices about this error? (2)Can we use OpenMpi on Docke container?

I'd really apprieciate it if you give me any advices.

Regards,

1.Dcokerfile build error

-----> Running in 57f18dea10ed

The value of the MCA parameter "plm_rsh_agent" was set to a path that could not be found:

plm_rsh_agent: ssh : rsh

Please either unset the parameter, or check that the path is correct

The command '/bin/sh -c mpirun --allow-run-as-root -np 4 ./hello' returned a non-zero code: 213

2.Dockerfile

FROM ubuntu:14.04

ENV http_proxy my company http proxy ENV https_proxy my company https proxy

RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ git \ wget \ make \ nano \ wget \ file \ python-dev \ python-pip \ cython && \ rm -rf /var/lib/apt/lists/*

WORKDIR /home/

RUN file -z openmpi-2.1.1.tar.gz

RUN wget http://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.gz

RUN tar xzvf openmpi-2.1.1.tar.gz

WORKDIR openmpi-2.1.1

RUN ./configure RUN make -j4 RUN make install RUN ldconfig

RUN which mpicc RUN mpicc -show RUN which mpiexec RUN mpiexec --version

WORKDIR /home/ RUN mkdir OpenMpi WORKDIR /home/OpenMPi

RUN wget http://www.open-mpi.org/papers/workshop-2006/hello.c

RUN mpicc hello.c -o hello

RUN mpirun --allow-run-as-root -np 4 ./hello

rhc54 commented 7 years ago

I know people have run OMPI in Docker containers (see the “shifter” project), but we don’t actively support it. I suggest you do a little Internet searching to find prior work.

On May 31, 2017, at 4:12 PM, yoshihingis notifications@github.com wrote:

Dear OpenMpi team staff

I tried to make very simple Dockerfile to check the operation of OpenMpi on the docker container.

But I got the caution about the risk of "root run". Hence I added the option "--allow-run-as-root",because we can start up docker container as root.

But I could not build Docker Image of "OpenMpi test". I got error as below at the end of Dockerfile build.

(1)Could you give me any advices about this error? (2)Can we use OpenMpi on Docke container?

I'd really apprieciate it if you give me any advices.

Regards,

1.Dcokerfile build error

-----> Running in 57f18dea10ed

The value of the MCA parameter "plm_rsh_agent" was set to a path that could not be found:

plm_rsh_agent: ssh : rsh

Please either unset the parameter, or check that the path is correct

The command '/bin/sh -c mpirun --allow-run-as-root -np 4 ./hello' returned a non-zero code: 213

2.Dockerfile

FROM ubuntu:14.04

ENV http_proxy my company http proxy ENV https_proxy my company https proxy

RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential git \ wget \ make \ nano \ wget \ file \ python-dev \ python-pip \ cython && \ rm -rf /var/lib/apt/lists/*

WORKDIR /home/

RUN file -z openmpi-2.1.1.tar.gz

RUN wget http://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.gz http://www.open-mpi.org/software/ompi/v2.1/downloads/openmpi-2.1.1.tar.gz RUN tar xzvf openmpi-2.1.1.tar.gz

WORKDIR openmpi-2.1.1

RUN ./configure RUN make -j4 RUN make install RUN ldconfig

RUN which mpicc RUN mpicc -show RUN which mpiexec RUN mpiexec --version

WORKDIR /home/ RUN mkdir OpenMpi WORKDIR /home/OpenMPi

RUN wget http://www.open-mpi.org/papers/workshop-2006/hello.c http://www.open-mpi.org/papers/workshop-2006/hello.c RUN mpicc hello.c -o hello

RUN mpirun --allow-run-as-root -np 4 ./hello

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/open-mpi/ompi/issues/3625, or mute the thread https://github.com/notifications/unsubscribe-auth/ACU-4CI9sn5yFAbbLBR7Nq0MJOwpUrWpks5r_fPigaJpZM4NsTxe.

ggouaillardet commented 7 years ago

the error message suggests ssh client is not installed in your container. if you need containers, singularity is very likely your best choice since it was designed with HPC in mind, and is supported by Open MPI. while there is nothing that prevents you from running Open MPI in a docker container, you are on your own when it comes to spawn containers and allow inter-containers traffic.

yoshihingis commented 7 years ago

Dear ggouaillardet, Thank you for your advice. I installed ssh into my docker container ,my test code operated correctly with No errors.