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 Aug 13, 2018 · 6 revisions

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 of ssh service, like

Host *
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]

# 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
# python scripts/run_benchmark.py

Please change the hostfile, network and netmask field of scripts/benchmark_config_default.json by your own conditions.

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