diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml index 34847fc..5b35abb 100644 --- a/.github/workflows/docker-image-build.yml +++ b/.github/workflows/docker-image-build.yml @@ -34,26 +34,26 @@ jobs: DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - build-3-9-rc1: + build-3-9: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - - name: Build 3.9-rc1 Docker image + - name: Build 3.9 Docker image run: | - docker build ./src/3.9 --tag nest/nest-simulator:3.9-rc1 + docker build ./src/3.9 --tag nest/nest-simulator:3.9 - - name: Check NEST 3.9-rc1 + - name: Check NEST 3.9 run: | - docker run --rm nest/nest-simulator:3.9-rc1 python3 -c "import nest" | grep "Version:" + docker run --rm nest/nest-simulator:3.9 python3 -c "import nest" | grep "Version:" - - name: Push 3.9-rc1 to Docker Hub + - name: Push 3.9 to Docker Hub uses: docker/build-push-action@v5 with: context: ./src/3.9 push: true - tags: nest/nest-simulator:3.9-rc1 + tags: nest/nest-simulator:3.9 env: DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }} DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} diff --git a/README.md b/README.md index 3e9db26..39b0cb8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,39 @@ # Docker image for the NEST simulator +[![Docker Hub](https://img.shields.io/badge/Docker%20Hub-nest--simulator-blue?logo=docker)](https://hub.docker.com/r/nest/nest-simulator) +[![NEST Simulator](https://img.shields.io/badge/NEST-Simulator-green?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==)](https://www.nest-simulator.org/) +[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html) +[![Latest Version](https://img.shields.io/badge/Latest-v3.9-brightgreen)](https://github.com/nest/nest-docker) + +## Table of Contents + +- [What is it for?](#what-is-it-for) +- [Quick Start](#quick-start) +- [Usage](#usage) + - [NEST 2.20.2](#nest-2202) + - [NEST 3.9](#nest-39) + - [NEST dev](#nest-dev) + - [On Windows](#on-windows) +- [Local Build System (run.sh)](#usage-of-the-local-build-system-runsh) + - [Quick Reference](#quick-reference) + - [Step-by-Step Guide](#1---2---3) +- [Using NEST with MUSIC](#using-nest-with-music) +- [Useful Docker commands](#useful-docker-commands) +- [Publishing to Registry](#add-image-to-ebrans-registry) + ## What is it for? -If you know how to use docker, you know how to use NEST. +**If you know how to use Docker, you know how to use NEST.** + +This repository provides Docker images for the [NEST simulator](https://www.nest-simulator.org/), making it easy to run NEST simulations without complex installation procedures. Whether you're a researcher, student, or developer, these Docker images provide: + +- ✅ **Zero-installation experience** - No dependency management headaches +- ✅ **Consistent environment** - Same setup across different systems +- ✅ **Multiple interfaces** - Jupyter notebooks, JupyterLab, or interactive shell +- ✅ **Latest versions** - From legacy 2.x to cutting-edge development builds +- ✅ **NEST Desktop integration** - Full graphical interface support + +### Available Docker Images Currently the following docker images are provided @@ -17,14 +48,41 @@ Currently the following docker images are provided - nest/nest-simulator:3.6 - nest/nest-simulator:3.7 - nest/nest-simulator:3.8 + - nest/nest-simulator:3.9 + +## Quick Start + +**🚀 Get started in 30 seconds:** + +1. **Pull the latest NEST image:** + ```bash + docker pull nest/nest-simulator:3.9 + ``` + +2. **Start Jupyter Notebook:** + ```bash + docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -v $(pwd):/opt/data \ + -e NEST_CONTAINER_MODE=notebook -p 8080:8080 nest/nest-simulator:3.9 + ``` + +3. **Open your browser** to the displayed URL and start exploring NEST! + +**🛠️ For local development with build tools:** + +```bash +git clone https://github.com/nest/nest-docker.git +cd nest-docker +./run.sh list # See all available options +./run.sh run notebook 3.9 # Start notebook with NEST 3.9 +``` ## Usage -You can use the docker images direct out of docker-registry.ebrains.eu like this: +You can use the docker images directly from docker-registry.ebrains.eu like this: docker pull nest/nest-simulator:TAG -TAG is '2.20.2', '3.2', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8'or 'dev'. +TAG is '2.20.2', '3.2', '3.3', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9' or 'dev'. #### NEST 2.20.2 @@ -33,12 +91,12 @@ Jupyter notebook with NEST 2.20.2: docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -v $(pwd):/opt/data -e NEST_CONTAINER_MODE=notebook \ -p 8080:8080 nest/nest-simulator:2.20.2 -Jupyter lab with NEST 2.20.2 +JupyterLab with NEST 2.20.2: docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -v $(pwd):/opt/data -e NEST_CONTAINER_MODE=jupyterlab \ -p 8080:8080 nest/nest-simulator:2.20.2 -#### NEST 3.8 +#### NEST 3.9 To use 'docker-compose' you need the definition file from the git repository. Download it: @@ -51,7 +109,7 @@ To use 'docker-compose' you need the definition file from the git repository. Do or docker run -it --rm -e NEST_CONTAINER_MODE=nest-server -p 52425:52425 \ - nest/nest-simulator:3.8 + nest/nest-simulator:3.9 Starts the NEST API server container and opens the corresponding port 52425. Test it with `curl localhost:52425/api`. @@ -62,9 +120,9 @@ To use 'docker-compose' you need the definition file from the git repository. Do or docker run -it --rm -e NEST_CONTAINER_MODE=nest-server -p 52425:52425 \ - nest/nest-simulator:3.8 + nest/nest-simulator:3.9 docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -p 54286:54286 \ - -e NEST_CONTAINER_MODE=nest-desktop nest/nest-simulator:3.8 + -e NEST_CONTAINER_MODE=nest-desktop nest/nest-simulator:3.9 Starts the NEST server and the NEST desktop web interface. Port 54286 is also made available. Open in the web browser: `http://localhost:54286` @@ -76,26 +134,26 @@ To use 'docker-compose' you need the definition file from the git repository. Do or docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -v $(pwd):/opt/data -e NEST_CONTAINER_MODE=notebook \ - -p 8080:8080 nest/nest-simulator:3.8 + -p 8080:8080 nest/nest-simulator:3.9 - Starts a notebook server with pre-installed NEST 3.8. The corresponding URL is displayed in the console. + Starts a notebook server with pre-installed NEST 3.9. The corresponding URL is displayed in the console. -- Jupyter lab with NEST +- JupyterLab with NEST docker-compose up nest-jupyterlab or docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` -v $(pwd):/opt/data -e NEST_CONTAINER_MODE=jupyterlab \ - -p 8080:8080 nest/nest-simulator:3.8 + -p 8080:8080 nest/nest-simulator:3.9 - Starts a jupyter lab server with pre-installed NEST 3.8. The corresponding URL is displayed in the console. + Starts a JupyterLab server with pre-installed NEST 3.9. The corresponding URL is displayed in the console. To stop and delete running containers use `docker-compose down`. #### NEST dev -If you want to use the compose configurtion for the dev NEST version, use the file option, e.g.: +If you want to use the compose configuration for the dev NEST version, use the file option, e.g.: wget https://raw.githubusercontent.com/steffengraber/nest-docker/master/docker-compose.yml docker-compose -f docker-compose-dev.yml up nest-notebook @@ -111,8 +169,8 @@ In Powershell, '%cd%' might not work for the current directory. Then you should explicitly specify a folder with existing write permissions. In any case, this will download the docker image with the pre-installed -NEST master from docker-registry.ebrains.eu and start it. After booting an URL is presented. -Click on it or copy it to your browser. Voilá jupyter notebook starts from +NEST master from docker-registry.ebrains.eu and start it. After booting, a URL is presented. +Click on it or copy it to your browser. Voilà! Jupyter notebook starts from the docker image. You can update the image with: @@ -126,22 +184,36 @@ You can clone this repository and use the shell script: sh run.sh [--help] [] [] --help print this usage information. - can be either 'provision', 'run' or 'clean'. - [] can be either 'notebook', 'jupyterlab', or 'interactice'. + can be either 'provision', 'run', 'clean', or 'list'. + [] can be either 'notebook', 'jupyterlab', or 'interactive'. [] kind of docker image (e.g. 'dev', '2.12.0', '2.14.0', '2.16.0', '2.18.0', '3.0', '3.1', '3.2', '3.3', '3.4', '3.5', - '3.6', '3.7', '3.8' or 'all'). + '3.6', '3.7', '3.8', '3.9' or 'all'). - Example: sh run.sh provision dev + Examples: sh run.sh list + sh run.sh provision dev + sh run.sh provision all-parallel + sh run.sh provision 3.9 --no-cache sh run.sh run notebook dev - sh run.sh run jupyterlab dev + sh run.sh run jupyterlab 3.9 + +### Quick Reference + +To see all available versions and commands: + + sh run.sh list + +This will display: +- All available NEST versions (categorized by legacy 2.x, NEST 3.x, and special versions) +- Available run modes (notebook, jupyterlab, interactive) +- Available provision commands -## 1 - 2 (- 3) +## Step-by-Step Guide -In the next steps, VERSION is the kind of docker image you want to use (3.8, dev, ...) +In the next steps, `VERSION` is the kind of docker image you want to use (3.9, dev, ...) -Two little steps to get started +**Two simple steps to get started:** ### 1 - Provisioning @@ -150,7 +222,30 @@ from the docker files. sh run.sh provision VERSION -Be careful with the version 'all'. This really takes a long time. +**Build Options:** + +- Build a single version: + ``` + sh run.sh provision 3.9 + ``` + +- Build all versions sequentially: + ``` + sh run.sh provision all + ``` + +- Build all versions in parallel (faster, but uses more system resources): + ``` + sh run.sh provision all-parallel + ``` + +- Force rebuild without using Docker cache: + ``` + sh run.sh provision 3.9 --no-cache + sh run.sh provision all --no-cache + ``` + +Be careful with the version 'all'. This really takes a long time. Use 'all-parallel' for faster builds if your system has sufficient resources. After every build of a NEST docker image, there are two more images - the one with the name of the NEST version (e.g. 'nest/nest-simulator:latest') and @@ -180,21 +275,21 @@ More information about this so called 'multi-stage build' here: be in the path where you start the script. -### (3) - Delete the NEST Images +### 3 - Clean Up (Optional) sh run.sh clean -Be careful. This stops EVERY container and delete then EVERY NEST Images. +⚠️ **Warning:** This stops EVERY container and deletes EVERY NEST image. -## Using NEST with music +## Using NEST with MUSIC -In the folder with your music scripts run: +In the folder with your MUSIC scripts run: docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` \ -v $(pwd):/opt/data \ - nest/nest-simulator:3.8 /bin/bash + nest/nest-simulator:3.9 /bin/bash -You are now on container's shell. +You are now in the container's shell. cd /opt/nest/share/doc/nest/examples/music/ mpirun --allow-run-as-root -np 2 music ./minimalmusicsetup.music @@ -207,7 +302,7 @@ You are now on container's shell. - Export a docker image - docker save nest/nest-simulator:3.8 | gzip -c > nest-docker.tar.gz + docker save nest/nest-simulator:3.9 | gzip -c > nest-docker.tar.gz - Import a docker image @@ -221,7 +316,7 @@ You are now on container's shell. docker exec -it --workdir /root --user root bash -## Add image to ebrans registry +## Add image to EBRAINS registry docker login docker-registry.ebrains.eu docker build -t nest-simulator: /path/to/recipe --squash diff --git a/docker-compose.yml b/docker-compose.yml index e08fe79..20d87b6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: nest-server: - image: nest/nest-simulator:3.9-rc2 + image: nest/nest-simulator:3.9 environment: LOCAL_USER_ID: "`id -u $USER`" NEST_CONTAINER_MODE: "nest-server" @@ -8,7 +8,7 @@ services: - "52425:52425" nest-server-mpi: - image: nest/nest-simulator:3.9-rc2 + image: nest/nest-simulator:3.9 environment: LOCAL_USER_ID: "`id -u $USER`" NEST_CONTAINER_MODE: "nest-server-mpi" @@ -17,7 +17,7 @@ services: - "52425:52425" nest-desktop: - image: nest/nest-simulator:3.9-rc2 + image: nest/nest-simulator:3.9 environment: LOCAL_USER_ID: "`id -u $USER`" NEST_CONTAINER_MODE: "nest-desktop" @@ -27,7 +27,7 @@ services: - nest-server nest-notebook: - image: nest/nest-simulator:3.9-rc2 + image: nest/nest-simulator:3.9 volumes: - .:/opt/data environment: @@ -37,7 +37,7 @@ services: - "8080:8080" nest-jupyterlab: - image: nest/nest-simulator:3.9-rc2 + image: nest/nest-simulator:3.9 volumes: - .:/opt/data environment: diff --git a/run.sh b/run.sh index a575070..c02bbcd 100755 --- a/run.sh +++ b/run.sh @@ -5,6 +5,51 @@ # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative + +# Define version arrays for easier maintenance +LEGACY_VERSIONS=("2.12.0" "2.14.0" "2.14.2" "2.16.0" "2.18.0" "2.20.0" "2.20.1" "2.20.2") +NEST3_VERSIONS=("3.0" "3.1" "3.2" "3.3" "3.4" "3.5" "3.6" "3.7" "3.8" "3.9") +SPECIAL_VERSIONS=("dev" "latest_daint") +ALL_VERSIONS=("${LEGACY_VERSIONS[@]}" "${NEST3_VERSIONS[@]}" "${SPECIAL_VERSIONS[@]}") + +# Helper function to join array elements +join_array() { + local IFS="$1" + shift + echo "$*" +} + +# Helper function to check if version is valid +is_valid_version() { + local version="$1" + for v in "${ALL_VERSIONS[@]}"; do + [[ "$v" == "$version" ]] && return 0 + done + return 1 +} + +# Helper function to build Docker image +build_image() { + local version="$1" + local parallel="$2" + local no_cache="$3" + local build_opts="" + + # Add no-cache option if requested + if [[ "$no_cache" == "true" ]]; then + build_opts="--no-cache" + elif [[ -n "$DOCKER_BUILDKIT" ]] && [[ "$DOCKER_BUILDKIT" == "1" ]]; then + # Add build cache options for faster builds + build_opts="--cache-from nest/nest-simulator:$version" + fi + + echo "Building NEST image for version $version$([ "$no_cache" == "true" ] && echo " (no cache)")..." + if [[ "$parallel" == "true" ]]; then + docker build $build_opts -t nest/nest-simulator:"$version" ./src/"$version" & + else + docker build $build_opts -t nest/nest-simulator:"$version" ./src/"$version" + fi +} # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,6 +78,9 @@ else clean) command=clean ;; + list) + command=list + ;; --help) command=help ;; @@ -48,139 +96,122 @@ fi case $command in provision) echo - - echo "Provisioning needs an argument: 'dev' 'latest_daint' '2.12.0', '2.14.0', '2.14.2'," - echo "'2.16.0', '2.18.0', '2.20.0', '2.20.1', '2.20.2', '3.0','3.1', '3.2', '3.3', '3.4', '3.5', '3.6', '3.7', " - echo "'3.8', 'all' or 'base'." + echo "Provisioning options:" + echo " Individual versions: $(join_array ', ' "${ALL_VERSIONS[@]}")" + echo " Special commands: 'all', 'all-parallel', 'base'" + echo " Use --no-cache to force rebuild without cache" echo - while test $# -gt 0; do - case "$1" in - dev | latest_daint | 2.12.0 | 2.14.0 | 2.14.2 | 2.16.0 | 2.18.0 | 2.20.0 | 2.20.1 | 2.20.2 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 3.8 ) - echo "Build the NEST image for NEST $1" - echo - docker build -t nest/nest-simulator:"$1" ./src/"$1" - echo - echo "Finished!" - ;; - base) - echo "Build the NEST base image" - echo + + # Check for --no-cache flag + no_cache="false" + args=() + for arg in "$@"; do + if [[ "$arg" == "--no-cache" ]]; then + no_cache="true" + else + args+=("$arg") + fi + done + + for arg in "${args[@]}"; do + if is_valid_version "$arg"; then + build_image "$arg" "false" "$no_cache" + echo "Finished building $arg!" + elif [[ "$arg" == "base" ]]; then + echo "Building NEST base images..." docker build -t nest/nest-simulator:nest-simulator-build-base --file ./src/base/Dockerfile-build-base ./src/base/ docker build -t nest/nest-simulator:nest-simulator-deploy-base --file ./src/base/Dockerfile-deploy-base ./src/base/ - echo - echo "Finished!" - ;; - - all) - echo "Build the NEST image for NEST 2.12.0, 2.14.0, 2.14.2" - echo "2.16.0, 2.18.0, 2.20.0, 2.20.1, 2.20.2, 3.0, 3.1, 3.2," - echo "3.3, 3.4, 3.5, 3.6, 3.7, 3.8, dev and latest_daint" - echo - docker build -t nest/nest-simulator:2.12.0 ./src/2.12.0 - docker build -t nest/nest-simulator:2.14.0 ./src/2.14.0 - docker build -t nest/nest-simulator:2.14.0 ./src/2.14.2 - docker build -t nest/nest-simulator:2.16.0 ./src/2.16.0 - docker build -t nest/nest-simulator:2.18.0 ./src/2.18.0 - docker build -t nest/nest-simulator:2.20.0 ./src/2.20.0 - docker build -t nest/nest-simulator:2.20.1 ./src/2.20.1 - docker build -t nest/nest-simulator:2.20.1 ./src/2.20.2 - docker build -t nest/nest-simulator:3.0 ./src/3.0 - docker build -t nest/nest-simulator:3.1 ./src/3.1 - docker build -t nest/nest-simulator:3.2 ./src/3.2 - docker build -t nest/nest-simulator:3.3 ./src/3.3 - docker build -t nest/nest-simulator:3.4 ./src/3.4 - docker build -t nest/nest-simulator:3.5 ./src/3.5 - docker build -t nest/nest-simulator:3.6 ./src/3.6 - docker build -t nest/nest-simulator:3.7 ./src/3.7 - docker build -t nest/nest-simulator:3.7 ./src/3.8 - docker build -t nest/nest-simulator:dev ./src/dev - docker build -t nest/nest-simulator:latest_daint ./src/latest_daint - echo - echo "Finished!" - ;; - *) - echo "Error: Unrecognized option '$1'" + echo "Finished building base images!" + elif [[ "$arg" == "all" ]]; then + echo "Building all NEST images sequentially$([ "$no_cache" == "true" ] && echo " (no cache)")..." + echo "Versions: $(join_array ', ' "${ALL_VERSIONS[@]}")" + for version in "${ALL_VERSIONS[@]}"; do + build_image "$version" "false" "$no_cache" + done + echo "Finished building all images!" + elif [[ "$arg" == "all-parallel" ]]; then + echo "Building all NEST images in parallel$([ "$no_cache" == "true" ] && echo " (no cache)") (faster but uses more resources)..." + echo "Versions: $(join_array ', ' "${ALL_VERSIONS[@]}")" + for version in "${ALL_VERSIONS[@]}"; do + build_image "$version" "true" "$no_cache" + done + echo "Waiting for all builds to complete..." + wait + echo "Finished building all images in parallel!" + else + echo "Error: Unrecognized option '$arg'" + echo "Use --help to see available options" command=help - ;; - esac - shift + break + fi done ;; - run) + list) echo - echo "Run needs three arguments:" + echo "Available NEST versions:" + echo " Legacy versions (2.x): $(join_array ', ' "${LEGACY_VERSIONS[@]}")" + echo " NEST 3.x versions: $(join_array ', ' "${NEST3_VERSIONS[@]}")" + echo " Special versions: $(join_array ', ' "${SPECIAL_VERSIONS[@]}")" echo - echo " - 'notebook VERSION'" - echo " - 'jupyterlab VERSION'" - echo " - 'interactive VERSION'" + echo "Available run modes: notebook, jupyterlab, interactive" echo - echo "VERSION is the version of NEST" - echo "(e.g. dev, 2.12.0, 2.14.0, 2.14.2, 2.16.0, 2.18.0, 2.20.0," - echo "2.20.1, 2.20.2, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8)" + echo "Available provision commands: all, all-parallel, base, " echo - LOCALDIR="$(pwd)" - while test $# -gt 1; do - case "$1" in + ;; + run) + if [[ $# -lt 2 ]]; then + echo + echo "Run command syntax:" + echo " ./run.sh run " + echo + echo "Available modes: notebook, jupyterlab, interactive" + echo "Available versions: $(join_array ', ' "${ALL_VERSIONS[@]}")" + echo + echo "Examples:" + echo " ./run.sh run notebook 3.9" + echo " ./run.sh run jupyterlab dev" + echo " ./run.sh run interactive 3.8" + exit 1 + fi + + mode="$1" + version="$2" + + if ! is_valid_version "$version"; then + echo "Error: Invalid version '$version'" + echo "Available versions: $(join_array ', ' "${ALL_VERSIONS[@]}")" + exit 1 + fi + + docker_opts="-it --rm -e LOCAL_USER_ID=$(id -u $USER) --name nest_${mode}_${version} -v $(pwd):/opt/data -p 8080:8080" + + case "$mode" in notebook) - case "$2" in - dev | 2.12.0 | 2.14.0 | 2.14.2 | 2.16.0 | 2.18.0 | 2.20.0 | 2.20.1 | 2.20.2 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 3.8 ) - echo "Run NEST-$2 with Jupyter Notebook". - echo - docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` --name my_app \ - -v $(pwd):/opt/data -e NEST_CONTAINER_MODE=notebook \ - -p 8080:8080 nest/nest-simulator:"$2" - echo - ;; - *) - echo "Error: Unrecognized option '$2'" - command=help - ;; - esac - ;; + echo "Starting NEST-$version with Jupyter Notebook..." + docker run $docker_opts -e NEST_CONTAINER_MODE=notebook nest/nest-simulator:"$version" + ;; jupyterlab) - case "$2" in - dev | 2.12.0 | 2.14.0 | 2.14.2 | 2.16.0 | 2.18.0 | 2.20.0 | 2.20.1 | 2.20.2 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 3.8 ) - echo - docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` --name my_app \ - -v $(pwd):/opt/data -e NEST_CONTAINER_MODE=jupyterlab \ - -p 8080:8080 nest/nest-simulator:"$2" - echo - ;; - *) - echo "Error: Unrecognized option '$2'" - command=help - ;; - esac - ;; + echo "Starting NEST-$version with JupyterLab..." + docker run $docker_opts -e NEST_CONTAINER_MODE=jupyterlab nest/nest-simulator:"$version" + ;; interactive) - case "$2" in - dev | 2.12.0 | 2.14.0 | 2.14.2 | 2.16.0 | 2.18.0 | 2.20.0 | 2.20.1 | 2.20.2 | 3.0 | 3.1 | 3.2 | 3.3 | 3.4 | 3.5 | 3.6 | 3.7 | 3.8 ) - echo "Run NEST-$2 in interactive mode." - echo - docker run -it --rm -e LOCAL_USER_ID=`id -u $USER` --name my_app -e NEST_CONTAINER_MODE=interactive \ - -p 8080:8080 nest/nest-simulator:"$2" - echo - ;; - *) - echo "Error: Unrecognized option '$2'" - command=help - ;; - esac - ;; + echo "Starting NEST-$version in interactive mode..." + docker run $docker_opts -e NEST_CONTAINER_MODE=interactive nest/nest-simulator:"$version" + ;; *) - echo "Error: Unrecognized option '$2'" - command=help - ;; + echo "Error: Invalid mode '$mode'" + echo "Available modes: notebook, jupyterlab, interactive" + exit 1 + ;; esac - shift - done + shift 2 ;; clean) echo - echo "Stops every container and delete the NEST Images." + echo "Stops every container and deletes the NEST Images." echo - docker stop $(docker ps -a -q) - docker images -a | grep "nest" | awk '{print $3}' | xargs docker rmi + docker stop $(docker ps -a -q) 2>/dev/null || true + docker images -a | grep "nest" | awk '{print $3}' | xargs docker rmi 2>/dev/null || true echo echo "Done!" echo diff --git a/src/3.9/Dockerfile b/src/3.9/Dockerfile index 9860589..c8560de 100644 --- a/src/3.9/Dockerfile +++ b/src/3.9/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:24.04 LABEL maintainer="s.graber@fz-juelich.de" -ARG NEST_VERSION=3.9_rc1 +ARG NEST_VERSION=3.9 ARG SRC_PATH=/tmp ENV TERM=xterm \ @@ -19,7 +19,7 @@ RUN apt-get update && \ git cmake ccache make gcc g++ \ libgsl-dev libboost-dev libltdl-dev libreadline-dev \ libopenmpi-dev pkg-config wget nano \ - libhdf5-dev \ + libhdf5-dev swig \ pandoc \ && rm -rf /var/lib/apt/lists/* @@ -33,9 +33,11 @@ RUN python3 -m venv /root/.env && \ . /root/.env/bin/activate && \ echo "source /root/.env/bin/activate" >> /root/.bashrc && \ cd nest-simulator && \ - pip install --no-cache-dir -r requirements.txt && \ - pip install --no-cache-dir Cython numpy boost setuptools gsl wheel - + pip install --upgrade pip wheel && \ + pip install --no-cache-dir Cython numpy boost setuptools gsl meson-python ninja && \ + pip install -v --no-cache-dir --no-build-isolation --force-reinstall --check-build-dependencies --no-binary pygsl pygsl && \ + pip install --no-cache-dir -r requirements.txt + # Build and install NEST RUN . /root/.env/bin/activate && \ mkdir ${SRC_PATH}/nest-build && cd ${SRC_PATH}/nest-build && \ diff --git a/src/3.9/Untitled.ipynb b/src/3.9/Untitled.ipynb deleted file mode 100644 index 7acf870..0000000 --- a/src/3.9/Untitled.ipynb +++ /dev/null @@ -1,23 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "10f44ab5-2463-4e47-9dfe-47ca539a22cd", - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "", - "name": "" - }, - "language_info": { - "name": "" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} diff --git a/src/dev/Dockerfile b/src/dev/Dockerfile index e1b7bd3..85d47f0 100644 --- a/src/dev/Dockerfile +++ b/src/dev/Dockerfile @@ -38,8 +38,11 @@ RUN python3 -m venv /root/.env && \ . /root/.env/bin/activate && \ echo "source /root/.env/bin/activate" >> /root/.bashrc && \ cd nest-simulator && \ - pip install --no-cache-dir -r requirements.txt && \ - pip install --no-cache-dir Cython numpy boost setuptools gsl wheel + pip install --upgrade pip wheel && \ + pip install --no-cache-dir Cython numpy boost setuptools gsl meson-python ninja && \ + pip install -v --no-cache-dir --no-build-isolation --force-reinstall --check-build-dependencies --no-binary pygsl pygsl && \ + pip install --no-cache-dir -r requirements.txt + # Build and install NEST RUN . /root/.env/bin/activate && \