Skip to content

Commit 34a662b

Browse files
authored
Merge pull request #327 from openworm/dev_0.9.3
Release 0.9.3
2 parents 2c249ed + 2f998d8 commit 34a662b

File tree

8 files changed

+36
-65
lines changed

8 files changed

+36
-65
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ jobs:
1010

1111
build:
1212

13-
runs-on: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
13+
runs-on: ubuntu-latest
14+
1415
steps:
1516
- uses: actions/checkout@v2
1617
- name: Build the Docker image

.github/workflows/docker-image.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
./build.sh
2222
- name: Info on Docker images
2323
run: |
24+
docker -v
2425
docker images
2526
- name: Run the Docker image
2627
run: |
@@ -30,4 +31,4 @@ jobs:
3031
ls -alt
3132
ls -alt output
3233
ls -alt output/C2*
33-
cat output/C2_*/report.json
34+
cat output/C2*/report.json

Dockerfile

Lines changed: 19 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:22.04
22

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

@@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
3636
wget nano htop build-essential make git automake autoconf \
3737
g++ rpm libtool libncurses5-dev zlib1g-dev bison flex lsb-core \
3838
sudo xorg openbox x11-xserver-utils \
39-
libxext-dev libncurses-dev python-dev mercurial \
39+
libxext-dev libncurses-dev python3-dev mercurial \
4040
freeglut3-dev libglu1-mesa-dev libglew-dev python3-dev python3-pip python3-lxml python3-scipy python3-tk \
4141
kmod dkms linux-source linux-headers-generic \
4242
maven openjdk-8-jdk \
@@ -50,7 +50,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends apt-utils \
5050

5151
RUN sudo usermod -a -G video $USER
5252

53-
USER $USER
53+
#USER $USER
5454
ENV HOME /home/$USER
5555
WORKDIR $HOME
5656

@@ -62,50 +62,29 @@ RUN sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10
6262
################################################################################
6363
######## Install NEURON simulator
6464

65-
RUN sudo pip install neuron==7.8.1
66-
67-
68-
################################################################################
69-
######## Install pyNeuroML for handling NeuroML network model
70-
71-
# Pin version of pymongo required for py3.6... TODO remove...
72-
RUN sudo pip install pymongo==4.1.1
73-
74-
RUN git clone https://github.com/NeuroML/pyNeuroML.git && \
75-
cd pyNeuroML && \
76-
git checkout master && \
77-
sudo python3 setup.py install
78-
79-
# TODO remove this line after we have better dependency management. The
80-
# current version of gitpython requires python >= 3.7, which is newer than the
81-
# python included in the base image. Therefore, we manually install an older
82-
# gitpython to be used with OpenWormData.
83-
# See https://github.com/openworm/OpenWorm/pull/316
84-
RUN sudo pip install 'gitpython==2.1.15' markupsafe
85-
86-
RUN git clone https://github.com/openworm/PyOpenWorm.git && \
87-
cd PyOpenWorm && \
88-
git checkout ow-0.9 && \
89-
sudo apt-get install -y python3-cffi && \
90-
sudo python3 setup.py install && \
91-
pow clone https://github.com/openworm/OpenWormData.git
65+
RUN pip3 install neuron==8.0.1
9266

9367

9468
################################################################################
9569
######## Install c302 for building neuronal network models
9670

9771
RUN git clone https://github.com/openworm/c302.git && \
9872
cd c302 && \
99-
git checkout ow-0.9.1 && \
100-
sudo python3 setup.py install
73+
git checkout ow-0.9.3 && \
74+
sudo pip install .
75+
76+
# Note: pyNeuroML installed with the above library
77+
78+
RUN pip3 install owmeta-core==0.13.5
79+
RUN owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'
10180

10281

10382
################################################################################
10483
######## Install Sibernetic for the worm body model
10584

10685
RUN git clone https://github.com/openworm/sibernetic.git && \
10786
cd sibernetic && \
108-
git checkout ow-0.9.1 # fixed to a specific branch
87+
git checkout ow-0.9.3 # fixed to a specific branch
10988

11089
RUN cp c302/pyopenworm.conf sibernetic/ # Temp step until PyOpenWorm can be run from any dir...
11190

@@ -120,10 +99,6 @@ ENV C302_HOME=$HOME/c302/c302
12099
ENV SIBERNETIC_HOME=$HOME/sibernetic
121100
ENV PYTHONPATH=$PYTHONPATH:$HOME/c302:$SIBERNETIC_HOME
122101

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-
127102

128103
################################################################################
129104
######## Install Intel OpenCL libraries needed for Sibernetic
@@ -150,25 +125,16 @@ sudo apt install -y ocl-icd-opencl-dev vim
150125
######## Build Sibernetic
151126

152127
RUN cd sibernetic && \
153-
sed -i -e "s/lpython2.7/lpython3.6m/g" makefile && \
154-
sed -i -e "s/n2.7/n3.6/g" makefile && \
128+
sed -i -e "s/n2.7/n3.10/g" makefile && \
155129
make clean && make all # Use python 3 libs
156130

157-
# intel i5, hd 5500, linux 4.15.0-39-generic
158-
# ./Release/Sibernetic -f worm -no_g device=CPU 190ms
159-
# ./Release/Sibernetic -f worm -no_g device=GPU 150ms (initialization takes some time)
160-
161-
# Intel(R) Xeon(R) CPU E5-1650 v4 @ 3.60GHz, linux 4.4.0-139-generic
162-
# ./Release/Sibernetic -f worm -no_g device=CPU 60ms
163-
#
164-
# after installing the nvidia driver used in host:
165-
## wget http://us.download.nvidia.com/tesla/390.30/nvidia-diag-driver-local-repo-ubuntu1604-390.30_1.0-1_amd64.deb
166-
## sudo dpkg -i nvidia-diag-driver-local-repo-ubuntu1604-390.30_1.0-1_amd64.deb
167-
## sudo apt-key add /var/nvidia-diag-driver-local-repo-390.30/7fa2af80.pub
168-
## sudo apt-get update
169-
## sudo apt-get install -y cuda-drivers
170-
# ./Release/Sibernetic -f worm -no_g device=GPU 37ms
171131

132+
################################################################################
133+
######## Copy master python script
134+
135+
# Not working with --chown=$USER:$USER
136+
COPY ./master_openworm.py $HOME/master_openworm.py
137+
RUN sudo chown $USER:$USER $HOME/master_openworm.py
172138

173139
RUN echo '\n\nalias cd..="cd .."\nalias h=history\nalias ll="ls -alt"' >> ~/.bashrc
174140

VERSION

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

build.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker build -t "openworm/openworm:0.9.2" .
1+
docker build -t "openworm/openworm:0.9.3" .

master_openworm.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def execute_with_realtime_output(command, directory, env=None):
107107
sys.path.append(os.environ['C302_HOME'])
108108

109109
try:
110-
os.system('xhost +')
110+
os.system('echo Granting permissions for xhost && xhost +')
111111
except:
112112
print("Unexpected error: %s" % sys.exc_info()[0])
113113

@@ -137,18 +137,19 @@ def execute_with_realtime_output(command, directory, env=None):
137137
'reference': 'FW',
138138
'c302params': 'C2',
139139
'verbose': False,
140-
'device': 'GPU',
140+
'device': 'CPU',
141141
'configuration': 'worm_crawl_half_resolution',
142142
'noc302': noc302,
143143
'datareader': 'UpdatedSpreadsheetDataReader2',
144144
'outDir': OW_OUT_DIR}
145145

146146
my_env = os.environ.copy()
147-
my_env["DISPLAY"] = ":44"
147+
DISPLAY = ':44'
148+
my_env["DISPLAY"] = DISPLAY
148149

149150
# Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol.
150151
# In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output.
151-
os.system('Xvfb :44 -listen tcp -ac -screen 0 1920x1080x24+32 &') # TODO: terminate xvfb after recording
152+
os.system('echo Starting xvfb && Xvfb %s -listen tcp -ac -screen 0 1920x1080x24+32 &'%DISPLAY) # TODO: terminate xvfb after recording
152153

153154
try:
154155
command = """python sibernetic_c302.py
@@ -230,9 +231,11 @@ def execute_with_realtime_output(command, directory, env=None):
230231
time.sleep(2)
231232

232233
# Rerun and record simulation
233-
os.system('export DISPLAY=:44')
234+
execute_with_realtime_output('ls -alt /tmp/.X11-unix', os.environ['SIBERNETIC_HOME'], env=my_env)
235+
os.system('export DISPLAY=%s'%DISPLAY)
236+
execute_with_realtime_output('ls -alt /tmp/.X11-unix', os.environ['SIBERNETIC_HOME'], env=my_env)
234237
sibernetic_movie_name = '%s.mp4' % os.path.split(latest_subdir)[-1]
235-
command = 'tmux new-session -d -s SiberneticRecording "DISPLAY=:44 ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1920x1080 -i :44 -filter:v "crop=1200:800:100:100" -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an %s/%s"' % (new_sim_out, sibernetic_movie_name)
238+
command = 'tmux new-session -d -P -s SiberneticRecording "DISPLAY=%s ffmpeg -r 30 -f x11grab -draw_mouse 0 -s 1920x1080 -i %s -filter:v "crop=1200:800:100:100" -cpu-used 0 -b:v 384k -qmin 10 -qmax 42 -maxrate 384k -bufsize 1000k -an %s/%s"' % (DISPLAY, DISPLAY, new_sim_out, sibernetic_movie_name)
236239
execute_with_realtime_output(command, os.environ['SIBERNETIC_HOME'], env=my_env)
237240

238241
time.sleep(3)

run-shell-only.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ docker run -it ^
66
-e OW_OUT_DIR=%OW_OUT_DIR% ^
77
--privileged ^
88
-v %HOST_OUT_DIR%:%OW_OUT_DIR%:rw ^
9-
openworm/openworm:0.9.2 ^
9+
openworm/openworm:0.9.3 ^
1010
/bin/bash

run.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ docker run -d ^
2020
-e DURATION=%DURATION% ^
2121
--privileged ^
2222
-v %HOST_OUT_DIR%:%OW_OUT_DIR%:rw ^
23-
openworm/openworm:0.9.2 ^
23+
openworm/openworm:0.9.3 ^
2424
/bin/bash -c "python master_openworm.py"
2525

2626
docker logs -f openworm

0 commit comments

Comments
 (0)