-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test building intel driver version...
- Loading branch information
Showing
3 changed files
with
180 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Docker Image Test Build - Intel drivers | ||
|
||
on: | ||
push: | ||
branches: [ master, dev* ] | ||
pull_request: | ||
branches: [ master, dev* ] | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build the Docker image | ||
run: | | ||
chmod a+w output/ | ||
ls -alt | ||
./build_intel.sh | ||
- name: Info on Docker images | ||
run: | | ||
docker -v | ||
docker images | ||
- name: Run the Docker image | ||
run: | | ||
./run.sh | ||
- name: Info on generated files | ||
run: | | ||
ls -alt | ||
ls -alt output | ||
ls -alt output/* | ||
more output/*/report.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
FROM ubuntu:22.04 | ||
|
||
LABEL maintainer="David Lung (lungdm@gmail.com); Padraig Gleeson (p.gleeson@gmail.com)" | ||
|
||
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: | ||
# ARG INTEL_SDK_VERSION=2017_7.0.0.2511_x64 | ||
|
||
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 | ||
#sudo ln -s /opt/intel/opencl/libOpenCL.so.1 /usr/lib/libOpenCL.so | ||
|
||
|
||
RUN echo "OpenCL Driver Installation Complete" | ||
|
||
|
||
################################################################################ | ||
######## Build Sibernetic | ||
|
||
RUN cd sibernetic && \ | ||
sed -i -e "s/n2.7/n3.10/g" makefile && \ | ||
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!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# A version of the docker container using the Intel libraries for OpenCL | ||
|
||
version=$(<VERSION) # Read version of Dockerfile from file VERSION | ||
docker build --platform linux/amd64 "$@" -t "openworm/openworm:$version" -f Dockerfile_intel . |