forked from jonmarty/ffbo.neurokernel_component
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
102 lines (77 loc) · 4.11 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
93
94
95
96
97
98
99
100
101
102
###########################################
# run using:
# nvidia-docker run --name neurokernel_component -v $(dirname `pwd`):/neurokernel_component -v $(dirname $(dirname `pwd`))/ffbo.neuroarch:/neuroarch -it ffbo/neurokernel_component:develop sh /neurokernel_component/neurokernel_component/run_component_docker.sh
# build using : nvidia-docker build -t ffbo/neurokernel_component:develop .
# require: nvidia-driver and nvidia-docker to be installed on host
###########################################
FROM nvidia/cuda
MAINTAINER "Yiyin Zhou <[email protected]>"
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:${LD_LIBRARY_PATH}
RUN apt-get -y update
RUN apt-get -y install linux-source build-essential linux-headers-`uname -r`
RUN apt-get -y install wget libibverbs1 libnuma1 libpmi0 libslurm29 libtorque2 libhwloc-dev git libffi-dev libssl-dev
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
RUN adduser --disabled-password --gecos '' nk
ADD . /home/nk/neurokernel_component
# Copy over private key, and set permissions
WORKDIR /home/nk
RUN mkdir .ssh
RUN chown -R nk:nk /home/nk/.ssh
USER nk
RUN echo "export PATH=/usr/local/cuda/bin:\$PATH" >> /home/nk/.bashrc
RUN echo "export LD_LIBRARY_PATH=/usr/local/cuda/lib64:/user/local/nvidia/lib64:/user/local/nvidia/lib:\$LD_LIBRARY_PATH" >> /home/nk/.bashrc
RUN wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O /home/nk/miniconda.sh
RUN bash /home/nk/miniconda.sh -b -p /home/nk/miniconda
RUN rm miniconda.sh
# Add additional channels to .condarc
RUN echo "channels:" >> /home/nk/.condarc
RUN echo "- https://conda.binstar.org/neurokernel/channel/ubuntu1404" >> /home/nk/.condarc
RUN echo "- defaults" >> /home/nk/.condarc
#RUN echo "export PATH=/home/nk/miniconda/bin:\$PATH" >> /home/nk/.bashrc
# Setup conda environment
ENV PATH /home/nk/miniconda/bin:$PATH
RUN conda create -n NK -y python
ENV PATH /home/nk/miniconda/envs/NK/bin:$PATH
# Install dependencies
RUN conda install -n NK --yes neurokernel_deps
# NOTE: Returns "Skipping pycuda as it is not installed."
#RUN pip uninstall --yes pycuda
RUN pip install numpy
RUN pip install --upgrade --ignore-installed pycuda
RUN pip install autobahn[twisted] simplejson pyOpenSSL service_identity
RUN pip install configparser
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && echo $PATH && conda create -n NK -y python
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && conda install --yes neurokernel_deps
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && pip uninstall --yes pycuda && yes | pip install pycuda
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && pip install autobahn[twisted]
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && pip install simplejson && pip install pyOpenSSL && pip install service_identity
# Clone git repositories
RUN git clone https://github.com/neurokernel/neurokernel.git
RUN git clone https://github.com/neurokernel/neurodriver.git
RUN git clone https://github.com/neurokernel/neuroarch.git
RUN git clone https://github.com/neurokernel/retina.git
# Setup git repositories
WORKDIR /home/nk/neurokernel
# These two commands don't seem to do anything
# were they maybe useful at a previous time?
#RUN git fetch
#RUN git checkout feature/nk_integration
RUN python setup.py develop
WORKDIR /home/nk/neurodriver
RUN python setup.py develop
WORKDIR /home/nk/retina
RUN python setup.py develop
WORKDIR /home/nk/neuroarch
RUN python setup.py develop
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && git fetch && git checkout feature/nk_integration && python setup.py develop
#WORKDIR /home/nk/neurodriver
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && python setup.py develop
#WORKDIR /home/nk/retina
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && python setup.py develop
#WORKDIR /home/nk/neuroarch
#RUN export PATH="/home/nk/miniconda/bin:${PATH}" && source activate NK && python setup.py develop
# Clear the cache
WORKDIR /home/nk/
RUN rm -rf .cache
WORKDIR /home/nk/neurokernel_component/neurokernel_component
CMD sh run_component_docker.sh