Docker Sheep

shepherd.sheep.DockerSheep does exactly the same as bare sheep except it runs the runner in a docker. Similarly to the bare sheep’s runner, docker runner is expected to listen for incoming jobs at a socket bind to port 9999.

Configuration

Docker sheep’s config is even simpler than in the bare sheep case:

cpu_sheep_1:
  port: 9001
  type: docker
  devices:
    - /dev/nvidia0

This simple configuration even enables GPU for your container if you have properly installed nvidia docker 2.

Model Name and Version

When new model name and version is encountered, docker sheep pulls the docker image from the configured docker registry.

Example Dockerfile follows:

FROM iterait/emloop

RUN pacman -Syu --noconfirm --needed python-pyzmq openssh python-numpy

ADD ssh /root/.ssh
RUN chmod 600 -R /root/.ssh
RUN ssh-keyscan -H github.com >> /root/.ssh/known_hosts

RUN pip install git+ssh://git@github.com/iterait/shepherd.git

ENV LD_LIBRARY_PATH /usr/local/lib

EXPOSE 9999

WORKDIR /project

ADD . .

# Replace this with your model of choice
ADD emloop-test /project/config.yaml

CMD shepherd-runner /project