Skip to content

Commit f47c43a

Browse files
authored
Merge pull request #338 from openworm/dev_0.9.4
Release 0.9.4 - uses latest sibernetic and c302, tested with both Intel and AMD drivers
2 parents 86e7af4 + ad624d5 commit f47c43a

File tree

8 files changed

+206
-44
lines changed

8 files changed

+206
-44
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Docker Image Test Build - Intel drivers
2+
3+
on:
4+
push:
5+
branches: [ master, dev* ]
6+
pull_request:
7+
branches: [ master, dev* ]
8+
9+
jobs:
10+
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- name: Build the Docker image
19+
run: |
20+
chmod a+w output/
21+
ls -alt
22+
./build_intel.sh
23+
24+
- name: Info on Docker images
25+
run: |
26+
docker -v
27+
docker images
28+
29+
- name: Run the Docker image
30+
run: |
31+
./run.sh
32+
33+
- name: Info on generated files
34+
run: |
35+
ls -alth
36+
ls -alth output
37+
ls -alth output/*
38+
more output/*/report.json

.github/workflows/docker-image-quickrun.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
./run-quick.sh
2929
- name: Info on generated files
3030
run: |
31-
ls -alt
32-
ls -alt output
33-
ls -alt output/*
31+
ls -alth
32+
ls -alth output
33+
ls -alth output/*

.github/workflows/docker-image.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ jobs:
2828
./run.sh
2929
- name: Info on generated files
3030
run: |
31-
ls -alt
32-
ls -alt output
33-
ls -alt output/*
31+
ls -alth
32+
ls -alth output
33+
ls -alth output/*

.github/workflows/docker-pull.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Docker Pull Test
22

33
on:
44
push:
5-
branches: [ master, dev* ]
5+
branches: [ master ]
66
pull_request:
7-
branches: [ master, dev* ]
7+
branches: [ master ]
88

99
jobs:
1010

@@ -17,7 +17,7 @@ jobs:
1717

1818
- name: Run the Docker image
1919
run: |
20-
# Don't build. Will be pulled when run below
20+
# Don't build. Will be pulled from Dockerhub when run below
2121
./run.sh
2222
2323
- name: Info on Docker images
@@ -38,6 +38,7 @@ jobs:
3838
3939
- name: Info on generated files
4040
run: |
41-
ls -alt
42-
ls -alt output
43-
ls -alt output/*
41+
ls -alth
42+
ls -alth output
43+
ls -alth output/*
44+
more output/*

Dockerfile

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ FROM ubuntu:22.04
22

33
LABEL maintainer="David Lung ([email protected]); Padraig Gleeson ([email protected])"
44

5-
ARG INTEL_SDK_VERSION=2017_7.0.0.2511_x64
6-
7-
#COPY ./silent-intel-sdk.cfg /tmp/silent-intel-sdk.cfg
8-
9-
105
ARG USR=ow
116
ENV USER=$USR
127

@@ -23,12 +18,8 @@ RUN mkdir -p /etc/sudoers.d && \
2318
chmod 0440 /etc/sudoers.d/$USER && \
2419
chown ${uid}:${gid} -R /home/$USER
2520

26-
2721
ENV DEBIAN_FRONTEND noninteractive # TODO: change
2822

29-
#RUN useradd -ms /bin/bash $USER
30-
31-
3223
################################################################################
3324
######## Update/install essential libraries
3425

@@ -46,7 +37,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
4637
libxft-dev python3-matplotlib unzip ffmpeg xvfb tmux
4738

4839
#RUN sudo pip install --upgrade pip
49-
#RUN sudo apt-get install nvidia-opencl-dev
5040

5141
RUN sudo usermod -a -G video $USER
5242

@@ -70,7 +60,7 @@ RUN pip3 install neuron==8.0.1
7060

7161
RUN git clone https://github.com/openworm/c302.git && \
7262
cd c302 && \
73-
git checkout ow-0.9.3a && \
63+
git checkout ow-0.9.4 && \
7464
sudo pip install .
7565

7666
# Note: pyNeuroML installed with the above library
@@ -84,7 +74,7 @@ RUN owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/
8474

8575
RUN git clone https://github.com/openworm/sibernetic.git && \
8676
cd sibernetic && \
87-
git checkout ow-0.9.3 # fixed to a specific branch
77+
git checkout ow-0.9.4 # fixed to a specific branch
8878

8979

9080
################################################################################
@@ -96,31 +86,27 @@ ENV PYTHONPATH=$PYTHONPATH:$HOME/c302:$SIBERNETIC_HOME
9686

9787

9888
################################################################################
99-
######## Install Intel OpenCL libraries needed for Sibernetic
100-
101-
RUN mkdir intel-opencl-tmp && \
102-
cd intel-opencl-tmp && \
103-
mkdir intel-opencl && \
104-
wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip && \
105-
unzip SRB5.0_linux64.zip && \
106-
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz && \
107-
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz && \
108-
tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz && \
109-
sudo cp -R intel-opencl/* / && \
110-
sudo ldconfig && \
111-
cd .. && \
112-
sudo rm -r intel-opencl-tmp
113-
114-
RUN sudo cp -R /opt/intel/opencl/include/CL /usr/include/ && \
115-
sudo apt install -y ocl-icd-opencl-dev vim
116-
#sudo ln -s /opt/intel/opencl/libOpenCL.so.1 /usr/lib/libOpenCL.so
89+
######## Install AMD's OpenCL Drivers (AMD-APP-SDK 3.0)
90+
91+
RUN wget https://master.dl.sourceforge.net/project/nicehashsgminerv5viptools/APP%20SDK%20A%20Complete%20Development%20Platform/AMD%20APP%20SDK%203.0%20for%2064-bit%20Linux/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
92+
RUN tar -xf AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2
93+
RUN printf 'Y\n\n' | sudo ./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh
94+
95+
RUN sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libOpenCL.so.1 /usr/lib/libOpenCL.so.1
96+
RUN sudo ln -s /opt/AMDAPPSDK-3.0/lib/x86_64/sdk/libamdocl64.so /usr/lib/libamdocl64.so
97+
98+
RUN sudo apt install -y ocl-icd-opencl-dev vim
99+
100+
RUN echo "OpenCL Driver Installation Complete"
101+
102+
RUN echo "CLINFO:"
103+
RUN clinfo
117104

118105

119106
################################################################################
120107
######## Build Sibernetic
121108

122109
RUN cd sibernetic && \
123-
sed -i -e "s/n2.7/n3.10/g" makefile && \
124110
make clean && make all && ldd ./Release/Sibernetic # Use python 3 libs
125111

126112

Dockerfile_intel

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
FROM ubuntu:22.04
2+
3+
LABEL maintainer="David Lung ([email protected]); Padraig Gleeson ([email protected])"
4+
5+
ARG USR=ow
6+
ENV USER=$USR
7+
8+
RUN apt-get update && \
9+
apt-get upgrade -y && \
10+
apt-get dist-upgrade -y
11+
12+
RUN mkdir -p /etc/sudoers.d && \
13+
export uid=1000 gid=1000 && \
14+
mkdir -p /home/$USER && \
15+
echo "$USER:x:${uid}:${gid}:$USER,,,:/home/$USER:/bin/bash" >> /etc/passwd && \
16+
echo "$USER:x:${uid}:" >> /etc/group && \
17+
echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER && \
18+
chmod 0440 /etc/sudoers.d/$USER && \
19+
chown ${uid}:${gid} -R /home/$USER
20+
21+
ENV DEBIAN_FRONTEND noninteractive # TODO: change
22+
23+
24+
################################################################################
25+
######## Update/install essential libraries
26+
27+
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
28+
wget nano htop build-essential make git automake autoconf \
29+
g++ rpm libtool libncurses5-dev zlib1g-dev bison flex lsb-core \
30+
sudo xorg openbox x11-xserver-utils \
31+
libxext-dev libncurses-dev python3-dev mercurial \
32+
freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip python3-lxml python3-scipy python3-tk \
33+
kmod dkms linux-source linux-headers-generic \
34+
maven openjdk-8-jdk \
35+
python3-setuptools python3-yaml libnuma1 \
36+
openmpi-bin libopenmpi-dev \
37+
libgl1-mesa-glx libgl1-mesa-dri libfreetype6-dev \
38+
libxft-dev python3-matplotlib unzip ffmpeg xvfb tmux
39+
40+
#RUN sudo pip install --upgrade pip
41+
42+
RUN sudo usermod -a -G video $USER
43+
44+
#USER $USER
45+
ENV HOME /home/$USER
46+
WORKDIR $HOME
47+
48+
#### TODO: check that this is the best way to switch to py3...
49+
RUN sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10
50+
RUN sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10
51+
52+
53+
################################################################################
54+
######## Install NEURON simulator
55+
56+
RUN pip3 install neuron==8.0.1
57+
58+
59+
################################################################################
60+
######## Install c302 for building neuronal network models
61+
62+
RUN git clone https://github.com/openworm/c302.git && \
63+
cd c302 && \
64+
git checkout ow-0.9.4 && \
65+
sudo pip install .
66+
67+
# Note: pyNeuroML installed with the above library
68+
69+
RUN pip3 install owmeta-core==0.13.5
70+
RUN owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'
71+
72+
73+
################################################################################
74+
######## Install Sibernetic for the worm body model
75+
76+
RUN git clone https://github.com/openworm/sibernetic.git && \
77+
cd sibernetic && \
78+
git checkout ow-0.9.4 # fixed to a specific branch
79+
80+
81+
################################################################################
82+
######## Set some paths//environment variables
83+
84+
ENV C302_HOME=$HOME/c302/c302
85+
ENV SIBERNETIC_HOME=$HOME/sibernetic
86+
ENV PYTHONPATH=$PYTHONPATH:$HOME/c302:$SIBERNETIC_HOME
87+
88+
89+
################################################################################
90+
######## Install Intel OpenCL libraries needed for Sibernetic
91+
92+
# Legacy install of Intel's OpenCL Drivers:
93+
94+
RUN mkdir intel-opencl-tmp && \
95+
cd intel-opencl-tmp && \
96+
mkdir intel-opencl && \
97+
wget https://github.com/openworm/OpenWorm/raw/dev_inte/SRB5.0_linux64.zip && \
98+
unzip SRB5.0_linux64.zip && \
99+
tar -C intel-opencl -Jxf intel-opencl-r5.0-63503.x86_64.tar.xz && \
100+
tar -C intel-opencl -Jxf intel-opencl-devel-r5.0-63503.x86_64.tar.xz && \
101+
tar -C intel-opencl -Jxf intel-opencl-cpu-r5.0-63503.x86_64.tar.xz && \
102+
sudo cp -R intel-opencl/* / && \
103+
sudo ldconfig && \
104+
cd .. && \
105+
sudo rm -r intel-opencl-tmp
106+
107+
RUN sudo cp -R /opt/intel/opencl/include/CL /usr/include/ && \
108+
sudo apt install -y ocl-icd-opencl-dev vim
109+
110+
RUN echo "OpenCL Driver Installation Complete"
111+
112+
113+
################################################################################
114+
######## Build Sibernetic
115+
116+
RUN cd sibernetic && \
117+
make clean && make all && ldd ./Release/Sibernetic # Use python 3 libs
118+
119+
120+
################################################################################
121+
######## Copy master python script
122+
123+
# Not working with --chown=$USER:$USER
124+
COPY ./master_openworm.py $HOME/master_openworm.py
125+
RUN sudo chown $USER:$USER $HOME/master_openworm.py
126+
127+
RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc
128+
129+
RUN pip list
130+
131+
RUN echo "Built the OpenWorm Docker image!"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.3
1+
0.9.4

build_intel.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
3+
# A version of the docker container using the Intel libraries for OpenCL
4+
5+
version=$(<VERSION) # Read version of Dockerfile from file VERSION
6+
docker build --platform linux/amd64 "$@" -t "openworm/openworm:$version" -f Dockerfile_intel .

0 commit comments

Comments
 (0)