Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

How to get and run multi node Intel Caffe in Docker

Tian, Feng edited this page Mar 2, 2018 · 6 revisions

How to get and run multi-node Intel Caffe in Docker

1. Install Docker and start Docker service

Refer to https://docs.docker.com/install/linux/docker-ce/

2. Pull Docker image from Dockerhub

# docker pull bvlc/caffe:intel_multinode

3. Create a container with host network mode

# docker run -tid --net host --name test --privileged --shm-size=40G bvlc/caffe:intel_multinode

You also can add other parameters. Such as “-v /host/path:/container/path” to mount local directory.

4. Login container and configure ssh of containers

[host]

# docker exec -ti test /bin/bash

[container]

# ssh-keygen -t rsa # cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys # vi ~/.ssh/config

In ~/.ssh/config file, we should specify Port for each Hostname like following format, otherwise ssh will connect by default 22 port

Host ${hostname} Port 10010

For security, you can modify the root user’s password of container. Default is “123456”.

5. Password-less config [suggested]

[Each container]

# ssh-copy-id -i id_rsa.pub MasterContainer

[MasterContainer]

# scp authorized_key root@SlaveContainer:~/.ssh/

Please change the MasterContainer and SlaveContainer to fit yourself hostname/ip.

6. Run multi-node Intel Caffe test in containers under host network mode

# cd /opt/caffe # scripts/run_benchmark.sh --topology alexnet --hostfile host.txt --network tcp --netmask eno3

Please change the host.txt file and netmask by your own conditions. Before you run run_benchmark.sh scripts, you need install “bc” command in container.

Problem

Use Docker by non-root user Please add non-root user to group docker, and then restart the docker service. If there is no docker group in your host, please create directly.

Clone this wiki locally