Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/docker-image-intel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ name: Docker Image Build - Intel drivers

on:
push:
branches: [ master, dev*, test* ]
branches: [ master, dev*, test*, experimental ]
pull_request:
branches: [ master, dev*, test* ]
branches: [ master, dev*, test*, experimental ]

jobs:

build:

runs-on: ubuntu-latest
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
Expand All @@ -28,11 +28,10 @@ jobs:

- name: Run the Docker image
run: |
./run.sh
echo "Skipping actual run of Intel Docker image, due to segfaults observed on GitHub runners"
#sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost
#./run.sh

- name: Info on generated files
run: |
ls -alth
ls -alth output
ls -alth output/*
more output/*/report.json
5 changes: 3 additions & 2 deletions .github/workflows/docker-image-quickrun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker Image Quick Run

on:
push:
branches: [ master, dev*, test* ]
branches: [ master, dev*, test*, experimental ]
pull_request:
branches: [ master, dev*, test* ]
branches: [ master, dev*, test*, experimental ]

jobs:

Expand All @@ -25,6 +25,7 @@ jobs:
docker images
- name: Run the Docker image
run: |
sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost
./run-quick.sh
- name: Info on generated files
run: |
Expand Down
23 changes: 19 additions & 4 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Docker Image Build and Run

on:
push:
branches: [ master, dev*, test* ]
branches: [ master, dev*, experimental, test* ]
pull_request:
branches: [ master, dev*, test* ]
branches: [ master, dev*, experimental, test* ]

jobs:

Expand All @@ -14,18 +14,33 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Build the Docker image
run: |
chmod a+w output/
ls -alth
./build.sh

- name: Info on Docker images
run: |
docker -v
docker images
- name: Run the Docker image

- name: Run the Docker image with the default falling cube demo from sibernetic
run: |
sudo apt-get update && sudo apt-get install -y x11-xserver-utils # for xhost
./run.sh -d 20 -c demo1

- name: Run the Docker image with a worm simulation - no c302
run: |
./stop.sh
./run.sh -d 10 -n

- name: Run the Docker image with a worm simulation
run: |
./run.sh
./stop.sh
./run.sh -d 150 # temp longer simulation for testing

- name: Info on generated files
run: |
ls -alth
Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,10 @@ output/C2*
/output/siminfo.py
/output/wor*
/output/Sibernetic_*
/output/test*
/output/box
/output/swim*
/output/alone*
/output/cube*
/output/master*
/output/deep_swim*
13 changes: 11 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN sudo pip install neuron==8.2.6 --break-system-packages

RUN git clone https://github.com/openworm/c302.git && \
cd c302 && \
git checkout ow-0.9.7 && \
git checkout ow-0.9.8 && \
sudo pip install . --break-system-packages

# Note: pyNeuroML installed with the above library
Expand All @@ -71,7 +71,7 @@ RUN git clone https://github.com/openworm/c302.git && \

RUN git clone https://github.com/openworm/sibernetic.git && \
cd sibernetic && \
git checkout ow-0.9.7 # fixed to a specific branch
git checkout ow-0.9.8a # fixed to a specific branch


################################################################################
Expand Down Expand Up @@ -116,6 +116,12 @@ RUN cd sibernetic && \
make clean && make all && ldd ./Release/Sibernetic # Use python 3 libs


################################################################################
######## Set up JupyterLab

#RUN sudo pip install notebook jupyterlab --break-system-packages


################################################################################
######## Copy master python script

Expand All @@ -125,6 +131,9 @@ RUN sudo chown $USER:$USER $HOME/master_openworm.py

RUN printf '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alth"\n' >> ~/.bashrc



RUN pip list

RUN echo "Built the OpenWorm Docker image!"

51 changes: 30 additions & 21 deletions Dockerfile_intel
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

################################################################################
######## Note: main Dockerfile using AMD libraries should be used unless
######## there is a specific reason to use Intel OpenCL libraries
################################################################################

LABEL maintainer="David Lung (lungdm@gmail.com); Padraig Gleeson (p.gleeson@gmail.com)"

Expand All @@ -18,72 +23,76 @@ RUN mkdir -p /etc/sudoers.d && \
chmod 0440 /etc/sudoers.d/$USER && \
chown ${uid}:${gid} -R /home/$USER

ENV DEBIAN_FRONTEND noninteractive # TODO: change
ENV DEBIAN_FRONTEND=noninteractive


################################################################################
######## Update/install essential libraries

RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
RUN apt-get update
RUN 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 \
g++ rpm libtool libncurses5-dev zlib1g-dev bison flex \
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 \
libxext-dev libncurses-dev mercurial \
freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip \
kmod dkms linux-source linux-headers-generic \
maven openjdk-8-jdk \
python3-setuptools python3-yaml libnuma1 \
libnuma1 \
openmpi-bin libopenmpi-dev \
libgl1-mesa-glx libgl1-mesa-dri libfreetype6-dev \
libxft-dev python3-matplotlib unzip ffmpeg xvfb tmux
libgl1 libglx-mesa0 libgl1-mesa-dri libfreetype6-dev \
libxft-dev unzip ffmpeg xvfb tmux

#RUN sudo pip install --upgrade pip

RUN sudo usermod -a -G video $USER

#USER $USER
ENV HOME /home/$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.2.6
RUN sudo pip install neuron==8.2.6 --break-system-packages


################################################################################
######## Install c302 for building neuronal network models

RUN git clone https://github.com/openworm/c302.git && \
cd c302 && \
git checkout ow-0.9.5 && \
sudo pip install .
git checkout ow-0.9.7 && \
sudo pip install . --break-system-packages

# 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.5 # fixed to a specific branch
git checkout ow-0.9.7 # fixed to a specific branch


################################################################################
######## Install extra Python dependencies

RUN sudo pip install ruff --break-system-packages


################################################################################
######## Set some paths//environment variables

ENV C302_HOME=$HOME/c302/c302
ENV SIBERNETIC_HOME=$HOME/sibernetic
ENV PYTHONPATH=$PYTHONPATH:$HOME/c302:$SIBERNETIC_HOME
ENV PYTHONPATH=$HOME/c302:$SIBERNETIC_HOME

ENV NEURON_MODULE_OPTIONS=-nogui


################################################################################
Expand Down Expand Up @@ -124,7 +133,7 @@ RUN cd sibernetic && \
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 printf '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alth"\n' >> ~/.bashrc

RUN pip list

Expand Down
12 changes: 11 additions & 1 deletion build_intel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,14 @@
# 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 .

# Set the platform flag if we're on ARM
arch=$(uname -m)
if [[ "$arch" == "arm64" || "$arch" == "aarch64" ]]; then
platform_flag="--platform linux/amd64"
else
platform_flag=""
fi

# Build the Docker image
docker build $platform_flag "$@" -t "openworm/openworm:$version" -f Dockerfile_intel .
Loading
Loading