-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
92 lines (80 loc) · 3.62 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM cmusatyalab/gabriel
MAINTAINER Satyalab, satya-group@lists.andrew.cmu.edu
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
--no-install-recommends \
apt-utils
#############################################
# install py-faster-rcnn without cudnn
#############################################
# install py-faster-rcnn dependency
RUN apt-get update && apt-get install -y \
build-essential \
git \
libopencv-dev \
python-opencv \
python-dev \
libprotobuf-dev \
libleveldb-dev \
libsnappy-dev \
libhdf5-serial-dev \
libatlas-base-dev \
protobuf-compiler \
wget
RUN apt-get install -y --no-install-recommends libboost-all-dev
RUN apt-get install -y apt-utils libgflags-dev libgoogle-glog-dev liblmdb-dev
# fix bug for hdf5 for Caffe. See https://github.com/NVIDIA/DIGITS/issues/156
RUN cd /usr/lib/x86_64-linux-gnu && ln -s libhdf5_serial.so libhdf5.so && \
ln -s libhdf5_serial_hl.so libhdf5_hl.so
RUN wget -O /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py && \
python /tmp/get-pip.py && \
pip install -U pip setuptools
# download py-faster-rcnn
WORKDIR /
RUN git clone --recursive https://github.com/rbgirshick/py-faster-rcnn.git
# install python dependencies
WORKDIR /py-faster-rcnn/caffe-fast-rcnn
RUN pip install easydict && \
pip install cython && \
pip install -r python/requirements.txt
# must be this version of numpy, or it will crash: https://github.com/rbgirshick/py-faster-rcnn/issues/480; no need for this anymore?
RUN pip install -Iv numpy==1.11.1
RUN pip install -U python-dateutil
# compile py-faster-rcnn
WORKDIR /py-faster-rcnn
RUN cd lib && \
make -j$(nproc)
RUN cd caffe-fast-rcnn && \
cp Makefile.config.example Makefile.config && \
sed -i 's%/usr/lib/python2.7/dist-packages/numpy/core/include%/usr/local/lib/python2.7/dist-packages/numpy/core/include%' Makefile.config && \
sed -i 's%INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include%INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/%' Makefile.config && \
sed -i 's%LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib%LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/%' Makefile.config && \
sed -i 's%# WITH_PYTHON_LAYER := 1%WITH_PYTHON_LAYER := 1%' Makefile.config && \
make -j$(nproc) && \
make -j$(nproc) pycaffe
#############################################
# install DiskTray application
#############################################
WORKDIR /
RUN git clone https://github.com/cmusatyalab/gabriel-disk-tray.git /gabriel-disk-tray
WORKDIR /gabriel-disk-tray
RUN pip install -r requirements.txt
# matplotlib needs six > 1.10.0
RUN pip install -U six
# remove the debug display since X11 forwarding inside Docker is painful
RUN sed -i 's%DISPLAY_LIST_TASK.*$%DISPLAY_LIST_TASK = []%' disktray/config.py
RUN python setup.py install
RUN bash -e /gabriel-disk-tray/scripts/download_asset.sh
WORKDIR /
ENV DISKTRAY_FASTER_RCNN_ROOT /py-faster-rcnn
# DISKTRAY_VIDEO_SERVER_URL needs to be explicitly set when running the container
# It should be the url for your video instruction server "http://<server-public-ip>:8080".
ENV DISKTRAY_VIDEO_SERVER_URL ""
EXPOSE 9098 9111 22222 8080 7070
# Start gabriel, disktray application, and a twistd server for serving video instructions
# twistd by default listens on port 8080
CMD ["bash", "-c", "gabriel-control -d -n eth0 -l -d & sleep 5; \
gabriel-ucomm -s 127.0.0.1:8021 & sleep 5; \
cd /gabriel-disk-tray; twistd -n web --path feedbacks/videos & disktrayapp -s 127.0.0.1:8021"]