Skip to content

Commit 30eb681

Browse files
authored
Fix nest server-mpi service in Docker compose (#257)
* Add docopt-ng and clean lines * Add more env variables for NEST Server MPI * Add service for nest-server-mpi in docker-compose * Update entrypoint to reduce logging
1 parent cf13be2 commit 30eb681

File tree

3 files changed

+38
-18
lines changed

3 files changed

+38
-18
lines changed

docker-compose.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3"
2-
31
services:
42
nest-server:
53
image: nest/nest-simulator:3.8
@@ -9,6 +7,18 @@ services:
97
ports:
108
- "52425:52425"
119

10+
# nest-server-mpi:
11+
# image: nest-simulator:master-mpi
12+
# environment:
13+
# LOCAL_USER_ID: "`id -u $USER`"
14+
# NEST_CONTAINER_MODE: "nest-server-mpi"
15+
# NEST_SERVER_MPI_NUM: 3
16+
# NEST_SERVER_MPI_LOGGER_LEVEL: "INFO"
17+
# OMPI_ALLOW_RUN_AS_ROOT: 1
18+
# OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
19+
# ports:
20+
# - "52425:52425"
21+
1222
nest-desktop:
1323
image: nest/nest-simulator:3.8
1424
environment:

src/dev/Dockerfile

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ENV TERM=xterm \
1414
OMPI_ALLOW_RUN_AS_ROOT=1 \
1515
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
1616

17-
RUN apt-get update && apt-get install -y --no-install-recommends \
17+
RUN apt-get update && apt-get install -y --no-install-recommends \
1818
automake \
1919
autotools-dev \
2020
build-essential \
@@ -96,16 +96,18 @@ RUN cd ${SRC_PATH} && \
9696
tar -xzf ${NEST_VERSION}.tar.gz
9797

9898
# Installing the requirements_docs.txt stops at some time with an error
99-
# Installing every package fix it.
99+
# Installing every package fix it.
100100
RUN python3 -m pip install sphinx>=6.2.1 sphinx_rtd_theme sphinx_autobuild sphinx-tabs && \
101101
python3 -m pip install sphinx_design sphinx-material sphinx-copybutton sphinx-carousel && \
102102
python3 -m pip install sphinx-notfound-page sphinxcontrib-mermaid sphinxcontrib-plantuml nbsphinx && \
103103
python3 -m pip install numpydoc example Image breathe csvkit docutils PyYAML>=4.2b1 tqdm yamllint && \
104-
# RUN python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/requirements_docs.txt
105-
python3 -m pip install sphinx_gallery==0.13.0 'numpy<=1.26' && \
106-
chmod +x ${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_music.sh && \
107-
${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_music.sh && \
108-
mkdir ${SRC_PATH}/nest-build && cd $_ && \
104+
# RUN python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/requirements_docs.txt
105+
python3 -m pip install sphinx_gallery==0.13.0 'numpy<=1.26'
106+
107+
RUN chmod +x ${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_music.sh && \
108+
${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_music.sh
109+
110+
RUN mkdir ${SRC_PATH}/nest-build && cd $_ && \
109111
cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/nest \
110112
-Dwith-optimize="-O2" \
111113
-Dwith-warning=ON \
@@ -126,15 +128,16 @@ RUN python3 -m pip install sphinx>=6.2.1 sphinx_rtd_theme sphinx_autobuild sphin
126128
make install
127129

128130
RUN python3 -m pip install --upgrade pip setuptools wheel && \
129-
python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/requirements.txt && \
130-
python3 -m pip install --upgrade nest-desktop && \
131-
python3 -m pip install --upgrade scipy && \
132-
python3 -m pip install --upgrade gsl wheel setuptools swig
131+
python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/requirements.txt && \
132+
python3 -m pip install --upgrade nest-desktop && \
133+
python3 -m pip install --upgrade scipy && \
134+
python3 -m pip install --upgrade gsl wheel setuptools swig && \
135+
# Latest update to nestml v8.0.0-rc3
136+
python3 -m pip install nestml==8.0.0rc3 && \
137+
python3 -m pip install docopt-ng
133138

134-
#Latest update to nestml v8.0.0
135-
RUN python3 -m pip install nestml==8.0.0 && \
136-
python3 -m pip install nestml-server@git+https://github.com/babsey/nestml-server@v1.0-b8 && \
137-
python3 -m pip install --upgrade pygsl@git+https://github.com/pygsl/pygsl@v2.4.0
139+
RUN python3 -m pip install nestml-server@git+https://github.com/babsey/nestml-server@v1.0-b8
140+
# python3 -m pip install --upgrade pygsl@git+https://github.com/pygsl/pygsl@v2.4.0 && \
138141

139142
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
140143
RUN chmod +x /usr/local/bin/entrypoint.sh

src/dev/entrypoint.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ elif [[ "${MODE}" = 'nest-server' ]]; then
5353
elif [[ "${MODE}" = 'nest-server-mpi' ]]; then
5454
export NEST_SERVER_HOST="${NEST_SERVER_HOST:-0.0.0.0}"
5555
export NEST_SERVER_PORT="${NEST_SERVER_PORT:-52425}"
56-
exec mpirun -np "${NEST_SERVER_MPI_NUM:-1}" nest-server-mpi
56+
57+
export NEST_SERVER_ACCESS_TOKEN="${NEST_SERVER_ACCESS_TOKEN}"
58+
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-*}"
59+
export NEST_SERVER_DISABLE_AUTH="${NEST_SERVER_DISABLE_AUTH:-1}"
60+
export NEST_SERVER_DISABLE_RESTRICTION="${NEST_SERVER_DISABLE_RESTRICTION:-1}"
61+
export NEST_SERVER_ENABLE_EXEC_CALL="${NEST_SERVER_ENABLE_EXEC_CALL:-1}"
62+
export NEST_SERVER_MODULES="${NEST_SERVER_MODULES:-import nest; import numpy; import numpy as np}"
63+
exec mpirun -np "${NEST_SERVER_MPI_NUM:-1}" nest-server-mpi --host "${NEST_SERVER_HOST}" --port "${NEST_SERVER_PORT}"
5764

5865
elif [[ "${MODE}" = 'nestml-server' ]]; then
5966
export NESTML_SERVER_HOST="${NESTML_SERVER_HOST:-0.0.0.0}"

0 commit comments

Comments
 (0)