Skip to content

Commit

Permalink
Add nestml-server and fix CORS_ORIGINS
Browse files Browse the repository at this point in the history
  • Loading branch information
babsey committed Jul 16, 2024
1 parent 55a972c commit 2146aed
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/3.6/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ elif [[ "${MODE}" = 'nest-server' ]]; then
export NEST_SERVER_STDOUT="${NEST_SERVER_STDOUT:-1}"

export NEST_SERVER_ACCESS_TOKEN="${NEST_SERVER_ACCESS_TOKEN}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-http://localhost:*}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-*}"
export NEST_SERVER_DISABLE_AUTH="${NEST_SERVER_DISABLE_AUTH:-1}"
export NEST_SERVER_DISABLE_RESTRICTION="${NEST_SERVER_DISABLE_RESTRICTION:-1}"
export NEST_SERVER_ENABLE_EXEC_CALL="${NEST_SERVER_ENABLE_EXEC_CALL:-1}"
Expand Down
2 changes: 1 addition & 1 deletion src/3.7/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ elif [[ "${MODE}" = 'nest-server' ]]; then
export NEST_SERVER_STDOUT="${NEST_SERVER_STDOUT:-1}"

export NEST_SERVER_ACCESS_TOKEN="${NEST_SERVER_ACCESS_TOKEN}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-http://localhost:*}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-*}"
export NEST_SERVER_DISABLE_AUTH="${NEST_SERVER_DISABLE_AUTH:-1}"
export NEST_SERVER_DISABLE_RESTRICTION="${NEST_SERVER_DISABLE_RESTRICTION:-1}"
export NEST_SERVER_ENABLE_EXEC_CALL="${NEST_SERVER_ENABLE_EXEC_CALL:-1}"
Expand Down
17 changes: 9 additions & 8 deletions src/3.8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV TERM=xterm \
RUN apt-get update && apt-get install -y --no-install-recommends \
automake \
autotools-dev \
build-essential \
build-essential \
ccache \
cmake \
curl \
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libpcre3-dev \
libpython3.10 \
libreadline-dev \
libreadline8 \
libreadline8 \
libtool \
libzmq3-dev \
llvm-dev \
Expand All @@ -63,12 +63,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3-jupyter-core \
python3-mpi4py \
python3-nose \
python3-pandas \
python3-pandas \
python3-path \
python3-pip \
python3-pytest \
python3-pytest-timeout \
python3-pytest-xdist \
python3-pytest-xdist \
python3-restrictedpython \
python3-scipy \
python3-setuptools \
Expand Down Expand Up @@ -108,7 +108,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
-Dwith-openmp=ON \
-Dwith-libneurosim=OFF \
-Dwith-sionlib=OFF \
-Dwith-music='$HOME/.cache/libneurosim.install' \
-Dwith-music='$HOME/.cache/libneurosim.install' \
-Dwith-hdf5=ON \
${SRC_PATH}/nest-simulator-${NEST_VERSION} && \
make && \
Expand All @@ -117,10 +117,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/requirements.txt && \
python3 -m pip install --upgrade nest-desktop && \
python3 -m pip install --upgrade scipy && \
python3 -m pip install --upgrade gsl wheel setuptools swig && \
python3 -m pip install NESTML==8.0.0rc1 && \
python3 -m pip install --upgrade gsl wheel setuptools swig && \
python3 -m pip install nestml==8.0.0rc1 && \
python3 -m pip install nestml-server@git+https://github.com/babsey/[email protected] && \
python3 -m pip install --upgrade pygsl@git+https://github.com/pygsl/[email protected]

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

Expand Down
8 changes: 7 additions & 1 deletion src/3.8/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ elif [[ "${MODE}" = 'nest-server' ]]; then
export NEST_SERVER_STDOUT="${NEST_SERVER_STDOUT:-1}"

export NEST_SERVER_ACCESS_TOKEN="${NEST_SERVER_ACCESS_TOKEN}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-http://localhost:*}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-*}"
export NEST_SERVER_DISABLE_AUTH="${NEST_SERVER_DISABLE_AUTH:-1}"
export NEST_SERVER_DISABLE_RESTRICTION="${NEST_SERVER_DISABLE_RESTRICTION:-1}"
export NEST_SERVER_ENABLE_EXEC_CALL="${NEST_SERVER_ENABLE_EXEC_CALL:-1}"
Expand All @@ -51,6 +51,12 @@ elif [[ "${MODE}" = 'nest-server-mpi' ]]; then
export NEST_SERVER_PORT="${NEST_SERVER_PORT:-52425}"
exec mpirun -np "${NEST_SERVER_MPI_NUM:-1}" nest-server-mpi

elif [[ "${MODE}" = 'nestml-server' ]]; then
export NESTML_SERVER_HOST="${NESTML_SERVER_HOST:-0.0.0.0}"
export NESTML_SERVER_PORT="${NESTML_SERVER_PORT:-52426}"
export NESTML_SERVER_STDOUT="${NESTML_SERVER_STDOUT:-1}"
exec nestml-server start

elif [[ "${MODE}" = 'notebook' ]]; then
mkdir -p /opt/data; cd /opt/data
exec /usr/local/bin/jupyter-notebook --ip="${IP_ADDRESS}" --port=8080 --no-browser --allow-root
Expand Down
17 changes: 9 additions & 8 deletions src/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ENV TERM=xterm \
RUN apt-get update && apt-get install -y --no-install-recommends \
automake \
autotools-dev \
build-essential \
build-essential \
ccache \
cmake \
curl \
Expand All @@ -41,7 +41,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libpcre3-dev \
libpython3.10 \
libreadline-dev \
libreadline8 \
libreadline8 \
libtool \
libzmq3-dev \
llvm-dev \
Expand All @@ -63,12 +63,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3-mpi4py \
python3-nose \
python3-numpy \
python3-pandas \
python3-pandas \
python3-path \
python3-pip \
python3-pytest \
python3-pytest-timeout \
python3-pytest-xdist \
python3-pytest-xdist \
python3-restrictedpython \
python3-scipy \
python3-setuptools \
Expand All @@ -86,7 +86,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
apt-get autoremove

RUN python3 -m pip install --upgrade pip setuptools wheel mock
RUN python3 -m pip install --force-reinstall --upgrade --no-binary=h5py h5py
RUN python3 -m pip install --force-reinstall --upgrade --no-binary=h5py h5py
RUN ldconfig


Expand All @@ -101,7 +101,7 @@ RUN python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/doc/req
RUN chmod +x ${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_music.sh && \
${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_music.sh

# # Install libneurosim
# # Install libneurosim
# RUN cd ${SRC_PATH}/nest-simulator-${NEST_VERSION} && \
# PYLIB_DIR="$(python3 -c "import sysconfig; print(sysconfig.get_path('include'))" | sed 's/include/lib/')" && \
# chmod +x ${SRC_PATH}/nest-simulator-${NEST_VERSION}/build_support/install_csa-libneurosim.sh && \
Expand All @@ -127,7 +127,7 @@ RUN mkdir ${SRC_PATH}/nest-build && cd $_ && \
-Dwith-openmp=ON \
-Dwith-libneurosim=OFF \
-Dwith-sionlib=OFF \
-Dwith-music=ON \
-Dwith-music=ON \
-Dwith-hdf5=ON \
${SRC_PATH}/nest-simulator-${NEST_VERSION} && \
make && \
Expand All @@ -138,7 +138,8 @@ RUN python3 -m pip install --upgrade pip && \
python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/requirements.txt && \
python3 -m pip install nest-desktop --pre && \
python3 -m pip uninstall nestml -y && \
python3 -m pip install --upgrade https://github.com/nest/nestml/archive/refs/heads/master.zip
python3 -m pip install nestml-server@git+https://github.com/babsey/[email protected] && \
python3 -m pip install --upgrade https://github.com/nest/nestml/archive/refs/heads/master.zip

RUN python3 -m pip install --force-reinstall --upgrade scipy

Expand Down
8 changes: 7 additions & 1 deletion src/dev/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ elif [[ "${MODE}" = 'nest-server' ]]; then
export NEST_SERVER_STDOUT="${NEST_SERVER_STDOUT:-1}"

export NEST_SERVER_ACCESS_TOKEN="${NEST_SERVER_ACCESS_TOKEN}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-http://localhost:*}"
export NEST_SERVER_CORS_ORIGINS="${NEST_SERVER_CORS_ORIGINS:-*}"
export NEST_SERVER_DISABLE_AUTH="${NEST_SERVER_DISABLE_AUTH:-1}"
export NEST_SERVER_DISABLE_RESTRICTION="${NEST_SERVER_DISABLE_RESTRICTION:-1}"
export NEST_SERVER_ENABLE_EXEC_CALL="${NEST_SERVER_ENABLE_EXEC_CALL:-1}"
Expand All @@ -51,6 +51,12 @@ elif [[ "${MODE}" = 'nest-server-mpi' ]]; then
export NEST_SERVER_PORT="${NEST_SERVER_PORT:-52425}"
exec mpirun -np "${NEST_SERVER_MPI_NUM:-1}" nest-server-mpi

elif [[ "${MODE}" = 'nestml-server' ]]; then
export NESTML_SERVER_HOST="${NESTML_SERVER_HOST:-0.0.0.0}"
export NESTML_SERVER_PORT="${NESTML_SERVER_PORT:-52426}"
export NESTML_SERVER_STDOUT="${NESTML_SERVER_STDOUT:-1}"
exec nestml-server start

elif [[ "${MODE}" = 'notebook' ]]; then
mkdir -p /opt/data; cd /opt/data
exec /usr/local/bin/jupyter-notebook --ip="${IP_ADDRESS}" --port=8080 --no-browser --allow-root
Expand Down

0 comments on commit 2146aed

Please sign in to comment.