-
Notifications
You must be signed in to change notification settings - Fork 210
/
Dockerfile_intel
131 lines (90 loc) · 4.33 KB
/
Dockerfile_intel
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
FROM ubuntu:22.04
LABEL maintainer="David Lung ([email protected]); Padraig Gleeson ([email protected])"
ARG USR=ow
ENV USER=$USR
RUN apt-get update && \
apt-get upgrade -y && \
apt-get dist-upgrade -y
RUN mkdir -p /etc/sudoers.d && \
export uid=1000 gid=1000 && \
mkdir -p /home/$USER && \
echo "$USER:x:${uid}:${gid}:$USER,,,:/home/$USER:/bin/bash" >> /etc/passwd && \
echo "$USER:x:${uid}:" >> /etc/group && \
echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER && \
chmod 0440 /etc/sudoers.d/$USER && \
chown ${uid}:${gid} -R /home/$USER
ENV DEBIAN_FRONTEND noninteractive # TODO: change
################################################################################
######## Update/install essential libraries
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
wget nano htop build-essential make git automake autoconf \
g++ rpm libtool libncurses5-dev zlib1g-dev bison flex lsb-core \
sudo xorg openbox x11-xserver-utils \
libxext-dev libncurses-dev python3-dev mercurial \
freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip python3-lxml python3-scipy python3-tk \
kmod dkms linux-source linux-headers-generic \
maven openjdk-8-jdk \
python3-setuptools python3-yaml libnuma1 \
openmpi-bin libopenmpi-dev \
libgl1-mesa-glx libgl1-mesa-dri libfreetype6-dev \
libxft-dev python3-matplotlib unzip ffmpeg xvfb tmux
#RUN sudo pip install --upgrade pip
RUN sudo usermod -a -G video $USER
#USER $USER
ENV HOME /home/$USER
WORKDIR $HOME
#### TODO: check that this is the best way to switch to py3...
RUN sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
RUN sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10
################################################################################
######## Install NEURON simulator
RUN pip3 install neuron==8.0.1
################################################################################
######## Install c302 for building neuronal network models
RUN git clone https://github.com/openworm/c302.git && \
cd c302 && \
git checkout ow-0.9.4 && \
sudo pip install .
# Note: pyNeuroML installed with the above library
RUN pip3 install owmeta-core==0.13.5
RUN owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'
################################################################################
######## Install Sibernetic for the worm body model
RUN git clone https://github.com/openworm/sibernetic.git && \
cd sibernetic && \
git checkout ow-0.9.4 # fixed to a specific branch
################################################################################
######## Set some paths//environment variables
ENV C302_HOME=$HOME/c302/c302
ENV SIBERNETIC_HOME=$HOME/sibernetic
ENV PYTHONPATH=$PYTHONPATH:$HOME/c302:$SIBERNETIC_HOME
################################################################################
######## Install Intel OpenCL libraries needed for Sibernetic
# Legacy install of Intel's OpenCL Drivers:
RUN mkdir intel-opencl-tmp && \
cd intel-opencl-tmp && \
mkdir intel-opencl && \
wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip && \
unzip SRB5.0_linux64.zip && \
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz && \
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz && \
tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz && \
sudo cp -R intel-opencl/* / && \
sudo ldconfig && \
cd .. && \
sudo rm -r intel-opencl-tmp
RUN sudo cp -R /opt/intel/opencl/include/CL /usr/include/ && \
sudo apt install -y ocl-icd-opencl-dev vim
RUN echo "OpenCL Driver Installation Complete"
################################################################################
######## Build Sibernetic
RUN cd sibernetic && \
make clean && make all && ldd ./Release/Sibernetic # Use python 3 libs
################################################################################
######## Copy master python script
# Not working with --chown=$USER:$USER
COPY ./master_openworm.py $HOME/master_openworm.py
RUN sudo chown $USER:$USER $HOME/master_openworm.py
RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc
RUN pip list
RUN echo "Built the OpenWorm Docker image!"