-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #200 from steffengraber/add-v36
Add NEST v3.6 and start rework of CI
- Loading branch information
Showing
6 changed files
with
161 additions
and
29 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
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,30 @@ | ||
############################################### | ||
### v3.6 ### | ||
############################################### | ||
|
||
Build_36: | ||
stage: build | ||
needs: ["Build_Base"] | ||
script: | ||
- docker pull nest/nest-simulator:3.6 || true | ||
- docker build | ||
--cache-from nest/nest-simulator:3.6 | ||
--tag $DOCKER_REGISTRY_IMAGE:3.6.$CI_PIPELINE_ID | ||
./src/3.6 | ||
# Simple test | ||
- docker run -i --rm nest/nest-simulator:3.6 bash /opt/test-nest.sh | ||
tags: | ||
- shell-runner | ||
|
||
Deploy_36: | ||
stage: deploy | ||
needs: ["Build_36"] | ||
when: never | ||
script: | ||
- echo -n $DOCKERHUB_REGISTRY_TOKEN | docker login -u $DOCKERHUB_REGISTRY_USER --password-stdin | ||
- docker push nest/nest-simulator:3.6 | ||
- docker logout $DOCKERHUB_REGISTRY | ||
only: | ||
- master | ||
tags: | ||
- shell-runner |
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
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,56 @@ | ||
FROM docker-registry.ebrains.eu/nest/nest-simulator:nest-simulator-build-base as builder | ||
LABEL maintainer="[email protected]" | ||
|
||
ARG NEST_VERSION=3.6 | ||
ARG SRC_PATH=/tmp | ||
|
||
|
||
# Install NEST and NESTML | ||
RUN wget "https://github.com/nest/nest-simulator/archive/refs/tags/v${NEST_VERSION}.tar.gz" -P ${SRC_PATH} && \ | ||
cd ${SRC_PATH} && tar -xzf ${NEST_VERSION}.tar.gz && ls -l && \ | ||
python3 -m pip install -r ${SRC_PATH}/nest-simulator-${NEST_VERSION}/doc/requirements.txt && \ | ||
python3 -m pip install sphinx_gallery==0.10.1 | ||
|
||
RUN mkdir nest-build && cd nest-build && \ | ||
cmake -DCMAKE_INSTALL_PREFIX:PATH=/opt/nest \ | ||
-Dwith-warning=ON \ | ||
-Dwith-userdoc=ON \ | ||
-Dwith-boost=ON \ | ||
-Dwith-ltdl=ON \ | ||
-Dwith-gsl=ON \ | ||
-Dwith-readline=ON \ | ||
-Dwith-python=ON \ | ||
-Dwith-mpi=ON \ | ||
-Dwith-openmp=ON \ | ||
-Dwith-libneurosim=OFF \ | ||
-Dwith-music=/opt/music-install \ | ||
-Dwith-hdf5=ON \ | ||
${SRC_PATH}/nest-simulator-${NEST_VERSION} && \ | ||
make -j $(nproc) && \ | ||
make docs && \ | ||
make install | ||
|
||
|
||
|
||
############################################################################### | ||
# DEPLOY | ||
|
||
FROM docker-registry.ebrains.eu/nest/nest-simulator:nest-simulator-deploy-base | ||
LABEL maintainer="[email protected]" | ||
|
||
COPY --from=builder /opt/nest /opt/nest | ||
COPY --from=builder /opt/music-install /opt/music-install | ||
|
||
RUN python3 -m pip install --upgrade pip && \ | ||
python3 -m pip install nest-desktop --pre && \ | ||
python3 -m pip uninstall nestml -y && \ | ||
python3 -m pip install https://github.com/nest/nestml/archive/refs/heads/master.zip --upgrade | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
||
COPY test-nest.sh /opt/test-nest.sh | ||
RUN chmod +x /opt/test-nest.sh | ||
|
||
EXPOSE 8080 52425 54286 | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
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,55 @@ | ||
#!/bin/bash | ||
set -e | ||
IP_ADDRESS=$(hostname --ip-address) | ||
|
||
# NEST environment | ||
source /opt/nest/bin/nest_vars.sh | ||
|
||
# Running NEST to test and to copy the .nestrc into /home/nest | ||
nest --help | ||
|
||
export MUSIC_ROOT_DIR=/opt/music-install | ||
export MUSIC_ROOT=${MUSIC_ROOT_DIR} | ||
MUSIC_PATH=${MUSIC_ROOT_DIR} | ||
export LD_LIBRARY_PATH=${MUSIC_PATH}/lib:$LD_LIBRARY_PATH | ||
export PATH=${MUSIC_PATH}/bin:$PATH | ||
export CPATH=${MUSIC_PATH}/include:$CPATH | ||
export PYTHONPATH=${MUSIC_PATH}/lib/python3.8/site-packages:$PYTHONPATH | ||
|
||
MODE="${NEST_CONTAINER_MODE:-$1}" | ||
if [[ "${MODE}" = 'interactive' ]]; then | ||
read -p "Your python script: " name | ||
echo Starting: $name | ||
# Start | ||
mkdir -p /opt/data; cd /opt/data | ||
exec python3 /opt/data/$name | ||
|
||
elif [[ "${MODE}" = 'jupyterlab' ]]; then | ||
mkdir -p /opt/data; cd /opt/data | ||
exec /usr/local/bin/jupyter-lab --ip="${IP_ADDRESS}" --port=8080 --no-browser --allow-root | ||
|
||
elif [[ "${MODE}" = 'nest-desktop' ]]; then | ||
export NEST_DESKTOP_HOST="${NEST_DESKTOP_HOST:-0.0.0.0}" | ||
export NEST_DESKTOP_PORT="${NEST_DESKTOP_PORT:-54286}" | ||
exec nest-desktop start | ||
|
||
elif [[ "${MODE}" = 'nest-server' ]]; then | ||
export NEST_SERVER_HOST="${NEST_SERVER_HOST:-0.0.0.0}" | ||
export NEST_SERVER_MODULES="${NEST_SERVER_MODULES:-nest,numpy}" | ||
export NEST_SERVER_PORT="${NEST_SERVER_PORT:-52425}" | ||
export NEST_SERVER_RESTRICTION_OFF="${NEST_SERVER_RESTRICTION_OFF:-1}" | ||
export NEST_SERVER_STDOUT="${NEST_SERVER_STDOUT:-1}" | ||
exec nest-server start | ||
|
||
elif [[ "${MODE}" = 'nest-server-mpi' ]]; then | ||
export NEST_SERVER_HOST="${NEST_SERVER_HOST:-0.0.0.0}" | ||
export NEST_SERVER_PORT="${NEST_SERVER_PORT:-52425}" | ||
exec mpirun -np "${NEST_SERVER_MPI_NUM:-1}" nest-server-mpi | ||
|
||
elif [[ "${MODE}" = 'notebook' ]]; then | ||
mkdir -p /opt/data; cd /opt/data | ||
exec jupyter-notebook --ip="${IP_ADDRESS}" --port=8080 --no-browser --allow-root | ||
|
||
else | ||
exec "$@" | ||
fi |
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,13 @@ | ||
#!/bin/bash | ||
|
||
# run mpiexec as root | ||
export OMPI_ALLOW_RUN_AS_ROOT=1 | ||
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 | ||
|
||
# install what is needed | ||
pip3 install pytest-xdist pytest-timeout junitparser | ||
|
||
HDF5_DISABLE_VERSION_CHECK=1 | ||
|
||
cd /opt/nest/share/nest/testsuite/ | ||
bash do_tests.sh --prefix=/opt/nest --with-python=/usr/bin/python |