Skip to content

Commit b44b582

Browse files
committed
Test building intel driver version...
1 parent 81b6afa commit b44b582

File tree

3 files changed

+180
-0
lines changed

3 files changed

+180
-0
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 -alt
36+
ls -alt output
37+
ls -alt output/*
38+
more output/*/report.json

Dockerfile_intel

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

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)