From 48e76e957e054a66b4d18cfabcddb948e59ff745 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:18:43 +0000 Subject: [PATCH 01/58] Record a Dockerfile for creating an image with spack dependencies for spack installing hermes-3+vantagereactions. --- VANTAGE-docker/README.md | 3 ++ .../hermes-3-VANTAGE-dependencies.dockerfile | 39 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 VANTAGE-docker/README.md create mode 100644 VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile diff --git a/VANTAGE-docker/README.md b/VANTAGE-docker/README.md new file mode 100644 index 000000000..fbe158467 --- /dev/null +++ b/VANTAGE-docker/README.md @@ -0,0 +1,3 @@ +# Docker image for hermes-3+vantagereactions + +The file `hermes-3-VANTAGE-dependencies.dockerfile` contains the commands to create a docker image which contains the spack dependencies needed to quickly compile hermes-3, BOUT++, NESO-Particles, and VANTAGE-Reactions. diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile new file mode 100644 index 000000000..14127e393 --- /dev/null +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -0,0 +1,39 @@ +# Build stage with Spack pre-installed and ready to be used +FROM spack/ubuntu-noble:1.1.0 + +RUN apt update && apt upgrade -y +RUN apt install -y git + +# use develop version of spack repos +RUN sed -i '/^[[:space:]]*branch:/ s|releases/v2025\.11|develop|g' /opt/spack/etc/spack/defaults/base/repos.yaml +# update spack repos +RUN spack repo update +# find the gcc compiler +RUN spack compiler find gcc +# clone the hermes-3 repo +RUN git clone https://github.com/UKAEA-Edge-Code/hermes-3.git hermes-3 +# update the submodules +WORKDIR /root/hermes-3 +RUN git submodule update --init --recursive + +# Install hermes-3 dependencies via spack +# Activate the hermes-3 environment, install dependencies +RUN < Date: Fri, 6 Mar 2026 16:22:27 +0000 Subject: [PATCH 02/58] Follow suggested best practices for apt-get commands in RUN https://docs.docker.com/build/building/best-practices/#run. --- VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 14127e393..9d37b2928 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -1,9 +1,9 @@ # Build stage with Spack pre-installed and ready to be used FROM spack/ubuntu-noble:1.1.0 -RUN apt update && apt upgrade -y -RUN apt install -y git - +RUN apt update && \ + apt install -y git --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* # use develop version of spack repos RUN sed -i '/^[[:space:]]*branch:/ s|releases/v2025\.11|develop|g' /opt/spack/etc/spack/defaults/base/repos.yaml # update spack repos From 2318c70e2c0c3e5a7c8c327606e895ade0d28872 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:26:19 +0000 Subject: [PATCH 03/58] Initial attempt at a workflow for building a docker image with VANTAGE spack dependencies. --- ...uild_docker_VANTAGE_dependencies_image.yml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/build_docker_VANTAGE_dependencies_image.yml diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml new file mode 100644 index 000000000..144406fe3 --- /dev/null +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -0,0 +1,74 @@ +name: Build hermes-3+vantagereactions dependencies Docker image + +# Configures this workflow to run every time a change is pushed to the master branch, +# or when manually triggered. +on: + workflow_dispatch: # Allows manual triggering + +env: + REGISTRY: ghcr.io + IMAGE_NAME: UKAEA-Edge-Code/hermes-3 + DOCKERFILE: VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile + +jobs: + + build-final-image: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64 + + - name: Log in to registry ${{ env.REGISTRY }} + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + # set "latest" tag + type=raw,value=latest,enable={{is_default_branch}} + # whichever workflow runs last will be tagged as edge + type=raw,value=edge + # short sha tag + type=sha,enable={{is_default_branch}} + # tag with semantic version + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + # tag with branch name + type=raw,value={{branch}},enable={{!is_default_branch}} + + # Build and push Docker image with Buildx + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v6 + with: + context: . + file: ${{ env.DOCKERFILE }} + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64 + cache-from: type=gha + cache-to: type=gha,mode=max + \ No newline at end of file From b332ebe36bb0d9e200b8f8518605992cda284f8e Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:35:10 +0000 Subject: [PATCH 04/58] Attempt to trigger workflow on push. --- .github/workflows/build_docker_VANTAGE_dependencies_image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 144406fe3..d4433b07f 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -3,6 +3,9 @@ name: Build hermes-3+vantagereactions dependencies Docker image # Configures this workflow to run every time a change is pushed to the master branch, # or when manually triggered. on: + push: + branches: + - '**' workflow_dispatch: # Allows manual triggering env: From 98aa4c48738e3c30cb0b41cfcda086c4cfbee913 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:37:38 +0000 Subject: [PATCH 05/58] Attempt to fix enable. --- .github/workflows/build_docker_VANTAGE_dependencies_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index d4433b07f..97ded7275 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -58,7 +58,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} # tag with branch name - type=raw,value={{branch}},enable={{!is_default_branch}} + type=raw,value={{branch}},enable={{is_default_branch == false}} # Build and push Docker image with Buildx # https://github.com/docker/build-push-action From 2712bbca4440244d1c5d43f4eff809af4460590c Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:41:49 +0000 Subject: [PATCH 06/58] Attempt to fix enable:2. --- .github/workflows/build_docker_VANTAGE_dependencies_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 97ded7275..1604bffee 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -58,7 +58,7 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} # tag with branch name - type=raw,value={{branch}},enable={{is_default_branch == false}} + type=ref,event=branch # Build and push Docker image with Buildx # https://github.com/docker/build-push-action From 62e7c7fa7c671abaee304e12ec12160bb77fc474 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 09:25:59 +0000 Subject: [PATCH 07/58] Make dockerfile trivial to debug actions. --- .../hermes-3-VANTAGE-dependencies.dockerfile | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 9d37b2928..79b6f54d0 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -16,24 +16,24 @@ RUN git clone https://github.com/UKAEA-Edge-Code/hermes-3.git hermes-3 WORKDIR /root/hermes-3 RUN git submodule update --init --recursive -# Install hermes-3 dependencies via spack -# Activate the hermes-3 environment, install dependencies -RUN < Date: Mon, 9 Mar 2026 09:28:30 +0000 Subject: [PATCH 08/58] Attempt to write packages. --- .github/workflows/build_docker_VANTAGE_dependencies_image.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 1604bffee..bbcfa4108 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -13,6 +13,9 @@ env: IMAGE_NAME: UKAEA-Edge-Code/hermes-3 DOCKERFILE: VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +permissions: + packages: write + jobs: build-final-image: From c57fa07f6b3d2fca6f54ce69b07d2a24ac19f0ff Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:00:13 +0000 Subject: [PATCH 09/58] Do not rebuild docker image. --- ...uild_docker_VANTAGE_dependencies_image.yml | 6 ++-- .github/workflows/docker_VANTAGE_tests.yml | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/docker_VANTAGE_tests.yml diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index bbcfa4108..ce2b2f3f9 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -3,9 +3,9 @@ name: Build hermes-3+vantagereactions dependencies Docker image # Configures this workflow to run every time a change is pushed to the master branch, # or when manually triggered. on: - push: - branches: - - '**' + # push: + # branches: + # - '**' workflow_dispatch: # Allows manual triggering env: diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml new file mode 100644 index 000000000..12bf50d37 --- /dev/null +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -0,0 +1,33 @@ +--- +name: hermes-3 + VANTAGE Tests +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' # This will trigger for PRs against any branch + +defaults: + run: + shell: bash + +jobs: + docker_spack_install_tests: + + container: + image: ghcr.io/UKAEA-Edge-Code/hermes-3:${{branch}} + + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + + + steps: + - name: Check out repository + uses: actions/checkout@v + + - name: Inspect repo + run: ls + - name : hello world + run: echo "Hello world" \ No newline at end of file From 853d7818827ce46ee9e87748da1cf9e992529363 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:01:17 +0000 Subject: [PATCH 10/58] Correct typo --- .github/workflows/docker_VANTAGE_tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 12bf50d37..17431a1d6 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -1,4 +1,3 @@ ---- name: hermes-3 + VANTAGE Tests on: push: From c9cad56c0cede130523a5b32602f4f10da855e3c Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:03:57 +0000 Subject: [PATCH 11/58] Add runs-on. --- .github/workflows/docker_VANTAGE_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 17431a1d6..5be14336f 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -13,6 +13,7 @@ defaults: jobs: docker_spack_install_tests: + runs-on: ubuntu-latest container: image: ghcr.io/UKAEA-Edge-Code/hermes-3:${{branch}} From 03f07655057d4f114a6b8760c48663868d7113aa Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:05:21 +0000 Subject: [PATCH 12/58] Correct typo. --- .github/workflows/docker_VANTAGE_tests.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 5be14336f..65fdb2e4f 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -14,19 +14,16 @@ defaults: jobs: docker_spack_install_tests: runs-on: ubuntu-latest - container: - image: ghcr.io/UKAEA-Edge-Code/hermes-3:${{branch}} - - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - - + image: ghcr.io/UKAEA-Edge-Code/hermes-3:${{branch}} + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + permissions: + packages: read steps: - name: Check out repository uses: actions/checkout@v - - name: Inspect repo run: ls - name : hello world From 7ac34a8977fd5b5516cf00b350d057c36c844a45 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:08:40 +0000 Subject: [PATCH 13/58] Use edge for now. --- .github/workflows/docker_VANTAGE_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 65fdb2e4f..5e601f529 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -15,7 +15,7 @@ jobs: docker_spack_install_tests: runs-on: ubuntu-latest container: - image: ghcr.io/UKAEA-Edge-Code/hermes-3:${{branch}} + image: ghcr.io/UKAEA-Edge-Code/hermes-3:edge credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} From 5c3f5cdfc1797fb70502d0ad029f4a01e393da21 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:09:12 +0000 Subject: [PATCH 14/58] Correct typo. --- .github/workflows/docker_VANTAGE_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 5e601f529..f15e5258e 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -23,7 +23,7 @@ jobs: packages: read steps: - name: Check out repository - uses: actions/checkout@v + uses: actions/checkout@v4 - name: Inspect repo run: ls - name : hello world From 20c4486409d834daa0e53613fea1d993697ac66a Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:10:22 +0000 Subject: [PATCH 15/58] Repo/package name must be lower case. --- .github/workflows/docker_VANTAGE_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index f15e5258e..736416426 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -15,7 +15,7 @@ jobs: docker_spack_install_tests: runs-on: ubuntu-latest container: - image: ghcr.io/UKAEA-Edge-Code/hermes-3:edge + image: ghcr.io/ukaea-edge-code/hermes-3:edge credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} From ab37452597e5f58a0c3e839936d5703123173975 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 10:12:17 +0000 Subject: [PATCH 16/58] Revert "Make dockerfile trivial to debug actions." This reverts commit 62e7c7fa7c671abaee304e12ec12160bb77fc474. --- .../hermes-3-VANTAGE-dependencies.dockerfile | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 79b6f54d0..9d37b2928 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -16,24 +16,24 @@ RUN git clone https://github.com/UKAEA-Edge-Code/hermes-3.git hermes-3 WORKDIR /root/hermes-3 RUN git submodule update --init --recursive -# # Install hermes-3 dependencies via spack -# # Activate the hermes-3 environment, install dependencies -# RUN < Date: Mon, 9 Mar 2026 10:16:00 +0000 Subject: [PATCH 17/58] Revert "Do not rebuild docker image." This reverts commit c57fa07f6b3d2fca6f54ce69b07d2a24ac19f0ff. --- .../workflows/build_docker_VANTAGE_dependencies_image.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index ce2b2f3f9..bbcfa4108 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -3,9 +3,9 @@ name: Build hermes-3+vantagereactions dependencies Docker image # Configures this workflow to run every time a change is pushed to the master branch, # or when manually triggered. on: - # push: - # branches: - # - '**' + push: + branches: + - '**' workflow_dispatch: # Allows manual triggering env: From ca3561ce1c16a406294d7e7682e7f3be386f24e1 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 13:48:15 +0000 Subject: [PATCH 18/58] Do not build image on push. --- .../workflows/build_docker_VANTAGE_dependencies_image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index bbcfa4108..29a50238c 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -3,9 +3,9 @@ name: Build hermes-3+vantagereactions dependencies Docker image # Configures this workflow to run every time a change is pushed to the master branch, # or when manually triggered. on: - push: - branches: - - '**' + # push: + # branches: + # - '**' workflow_dispatch: # Allows manual triggering env: @@ -77,4 +77,4 @@ jobs: platforms: linux/amd64 cache-from: type=gha cache-to: type=gha,mode=max - \ No newline at end of file + From 3d4ed6e3329e5b0e2c8a39bc26df54a552f8306e Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:01:00 +0000 Subject: [PATCH 19/58] Initial version of VANTAGE tests. --- .github/workflows/docker_VANTAGE_tests.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 736416426..6b46be04b 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -24,7 +24,13 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v4 - - name: Inspect repo - run: ls - - name : hello world - run: echo "Hello world" \ No newline at end of file + - name: Install + run: source /opt/spack/share/spack/setup-env.sh && + . activate_h3env && + spack concretize -f && + spack install -j 4 + - name : Run tests + run: source /opt/spack/share/spack/setup-env.sh && + . activate_h3env && + spack cd -b hermes-3 && + ctest -j 4 --output-on-failure --timeout 300 \ No newline at end of file From e75625aed6d4ad762d4b5d26a6a38611cdacdd97 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:12:14 +0000 Subject: [PATCH 20/58] Use spack commands instead of spacktivate alias. --- .github/workflows/docker_VANTAGE_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 6b46be04b..30fbda2ea 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -26,11 +26,11 @@ jobs: uses: actions/checkout@v4 - name: Install run: source /opt/spack/share/spack/setup-env.sh && - . activate_h3env && + spack env activate . -v gcc && spack concretize -f && spack install -j 4 - name : Run tests run: source /opt/spack/share/spack/setup-env.sh && - . activate_h3env && + spack env activate . -v gcc && spack cd -b hermes-3 && ctest -j 4 --output-on-failure --timeout 300 \ No newline at end of file From 6bbf89940dc5406b5a82cffb18a98d7dcffd2d3d Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:17:58 +0000 Subject: [PATCH 21/58] Remember to checkout submodules. --- .github/workflows/docker_VANTAGE_tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 30fbda2ea..fab410a2d 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -25,7 +25,8 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - name: Install - run: source /opt/spack/share/spack/setup-env.sh && + run: git submodule update --init --recursive && + source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && spack concretize -f && spack install -j 4 From 8480f6ed88c4fb5b24d3c454f6fe97d8f0637fd6 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 9 Mar 2026 14:28:00 +0000 Subject: [PATCH 22/58] Have actions checkout submodules. --- .github/workflows/docker_VANTAGE_tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index fab410a2d..506976af0 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -23,10 +23,11 @@ jobs: packages: read steps: - name: Check out repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 + with: + submodules: recursive - name: Install - run: git submodule update --init --recursive && - source /opt/spack/share/spack/setup-env.sh && + run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && spack concretize -f && spack install -j 4 From 7dfdc7b06e4d500db38e79285b1938495d9e2d5d Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:34:54 +0000 Subject: [PATCH 23/58] Expand VANTAGE-docker/README.md with instructions for local usage. --- VANTAGE-docker/README.md | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/VANTAGE-docker/README.md b/VANTAGE-docker/README.md index fbe158467..a2459bf78 100644 --- a/VANTAGE-docker/README.md +++ b/VANTAGE-docker/README.md @@ -1,3 +1,55 @@ # Docker image for hermes-3+vantagereactions The file `hermes-3-VANTAGE-dependencies.dockerfile` contains the commands to create a docker image which contains the spack dependencies needed to quickly compile hermes-3, BOUT++, NESO-Particles, and VANTAGE-Reactions. + +# Make a local docker image + +Check for existing docker images. +``` +$ docker image ls +``` + +Make a new docker image from Dockerfile. +``` +$ docker build -t hermes_3_vantage_deps_img -f ./path/to/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile . +``` + +# Make a local container and test hermes-3 within the container + +Check for existing containers +``` +$ docker ps -as +``` + +Make a new container +``` +$ cd /path/to/your/hermes-3/ +$ docker run --name hermes_3_vantage -v "$(pwd):/root/Hermes-3" -it hermes_3_vantage_deps_img +``` + +The `-v` option mounts the `hermes-3/` repo to the container on the path `/root/Hermes-3`. + +Activate spack. +``` +$ . /opt/spack/share/spack/setup-env.sh +``` +Activate the environment. +``` +$ cd ~/Hermes-3 +$ . activate_h3env +``` +Install the top-level packages (if spack needs to install more than the top-level, `VANTAGE-Reactions`, `NESO-Particles`, `BOUT++`, `hermes-3` etc, then there is likely a problem with the image, which should capture all build and link dependencies). +``` +$ spack concretize -f +$ spack install -j 1 +``` +Change to the Hermes build directory and test. +``` +$ spack cd -b hermes-3 +$ ./hermes_unit_tests +$ ctest -j 1 +``` +To later restart the container. +``` +$ docker start -i hermes_3_vantage +``` \ No newline at end of file From df9e261e96ef7068d0433c96676b00eabe223207 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:39:35 +0000 Subject: [PATCH 24/58] Trigger on push to VANTAGE-Reactions-Coupling/dev only, or when manually triggered. --- .../workflows/build_docker_VANTAGE_dependencies_image.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 29a50238c..9616a3d09 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -1,11 +1,11 @@ name: Build hermes-3+vantagereactions dependencies Docker image -# Configures this workflow to run every time a change is pushed to the master branch, +# Configures this workflow to run every time a change is pushed to the default branch in this repo, # or when manually triggered. on: - # push: - # branches: - # - '**' + push: + branches: + - 'VANTAGE-Reactions-Coupling/dev' workflow_dispatch: # Allows manual triggering env: From 480bbc52d1aeb853b6c7c8f2244a4dc2412692b1 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:39:54 +0000 Subject: [PATCH 25/58] Remove push trigger for test. --- .github/workflows/docker_VANTAGE_tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 506976af0..57372042a 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -1,8 +1,5 @@ name: hermes-3 + VANTAGE Tests on: - push: - branches: - - '**' pull_request: branches: - '**' # This will trigger for PRs against any branch From 1b1e83494d23889015fe60ed896bb0f0b5d9b9f7 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:41:25 +0000 Subject: [PATCH 26/58] Make sure uninstallation of packages happens within the layer that they were installed. --- VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 9d37b2928..ded366de6 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -22,11 +22,7 @@ RUN < Date: Wed, 11 Mar 2026 16:13:10 +0000 Subject: [PATCH 27/58] Add a timeout-minutes to avoid wasting Actions time. --- .github/workflows/docker_VANTAGE_tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 57372042a..dfac927b9 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -11,6 +11,8 @@ defaults: jobs: docker_spack_install_tests: runs-on: ubuntu-latest + # timeout to avoid running tests which do unexpected spack installation + timeout-minutes: 30 container: image: ghcr.io/ukaea-edge-code/hermes-3:edge credentials: From 0785b6808a1562a150fb2f735c97e686c17a8b59 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 11 Mar 2026 17:17:36 +0000 Subject: [PATCH 28/58] Use `COPY` instead of `RUN git clone https://github.com/UKAEA-Edge-Code/hermes-3.git` to get the necessary files to install hermes-3 dependencies. --- .../build_docker_VANTAGE_dependencies_image.yml | 3 ++- .../hermes-3-VANTAGE-dependencies.dockerfile | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 9616a3d09..57bb82464 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -24,8 +24,9 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: + submodules: recursive fetch-depth: 1 # Set up BuildKit Docker container builder to be able to build diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index ded366de6..3ea401136 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -10,16 +10,19 @@ RUN sed -i '/^[[:space:]]*branch:/ s|releases/v2025\.11|develop|g' /opt/spack/et RUN spack repo update # find the gcc compiler RUN spack compiler find gcc -# clone the hermes-3 repo -RUN git clone https://github.com/UKAEA-Edge-Code/hermes-3.git hermes-3 -# update the submodules +# copy the files in the hermes-3 repo needed to install dependencies +COPY ./external /root/hermes-3/external +COPY ./spack.yaml /root/hermes-3/spack.yaml +# set the workdir WORKDIR /root/hermes-3 -RUN git submodule update --init --recursive # Install hermes-3 dependencies via spack # Activate the hermes-3 environment, install dependencies RUN < Date: Thu, 12 Mar 2026 12:23:56 +0000 Subject: [PATCH 29/58] Remove concretize from dockerfile. --- VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 3ea401136..caba99ac7 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -20,9 +20,6 @@ WORKDIR /root/hermes-3 # Activate the hermes-3 environment, install dependencies RUN < Date: Thu, 12 Mar 2026 17:04:58 +0000 Subject: [PATCH 30/58] Use a sha256 hash to specify the ubuntu version in the dockerfile. --- VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index caba99ac7..132c4a37b 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -1,5 +1,11 @@ # Build stage with Spack pre-installed and ready to be used -FROM spack/ubuntu-noble:1.1.0 +FROM spack/ubuntu-noble@sha256:a1c7d1dcfea874f74ec827851f04fc116ca54869c30a766c92c5299967a4f33c +# above FROM equivalent to +# FROM spack/ubuntu-noble:1.1.0 +# the image sha256 hash is obtained from the following url +# https://hub.docker.com/layers/spack/ubuntu-noble/1.1.0/images/sha256-a1c7d1dcfea874f74ec827851f04fc116ca54869c30a766c92c5299967a4f33c +# we use the sha256 hash to pin to a specific version +# in case the image associated with tag :1.1.0 is updated RUN apt update && \ apt install -y git --no-install-recommends \ From 96e5e9b4db3d49a5e7cda22433266930456ce9a4 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 13 Mar 2026 09:22:06 +0000 Subject: [PATCH 31/58] Correct `spack compiler find` command. --- VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 132c4a37b..55023761c 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -15,7 +15,7 @@ RUN sed -i '/^[[:space:]]*branch:/ s|releases/v2025\.11|develop|g' /opt/spack/et # update spack repos RUN spack repo update # find the gcc compiler -RUN spack compiler find gcc +RUN spack compiler find # copy the files in the hermes-3 repo needed to install dependencies COPY ./external /root/hermes-3/external COPY ./spack.yaml /root/hermes-3/spack.yaml From fbe601cf8a6ccb0c8649f86e6f851fd25b27cd06 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:26:57 +0000 Subject: [PATCH 32/58] Try including OMP flags to speedup tests. --- .github/workflows/docker_VANTAGE_tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index dfac927b9..893a573e3 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -12,6 +12,9 @@ jobs: docker_spack_install_tests: runs-on: ubuntu-latest # timeout to avoid running tests which do unexpected spack installation + env: + OMP_NUM_THREADS: 1 + OMPI_MCA_rmaps_base_oversubscribe: yes timeout-minutes: 30 container: image: ghcr.io/ukaea-edge-code/hermes-3:edge From 1ff0de82d026ad5aba2afe17bd05aebadc00c6f2 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:27:47 +0000 Subject: [PATCH 33/58] Reduce number of tests to run in parallel. --- .github/workflows/docker_VANTAGE_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 893a573e3..9a3ad895a 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -37,4 +37,4 @@ jobs: run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && spack cd -b hermes-3 && - ctest -j 4 --output-on-failure --timeout 300 \ No newline at end of file + ctest -j 1 --output-on-failure --timeout 300 \ No newline at end of file From 6580e7ea4b849e14f5affd278cd660c5e019fcbe Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 13 Mar 2026 11:33:18 +0000 Subject: [PATCH 34/58] Move env inside container settings. --- .github/workflows/docker_VANTAGE_tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 9a3ad895a..e64091a5a 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -12,15 +12,15 @@ jobs: docker_spack_install_tests: runs-on: ubuntu-latest # timeout to avoid running tests which do unexpected spack installation - env: - OMP_NUM_THREADS: 1 - OMPI_MCA_rmaps_base_oversubscribe: yes timeout-minutes: 30 container: image: ghcr.io/ukaea-edge-code/hermes-3:edge credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} + env: + OMP_NUM_THREADS: 1 + OMPI_MCA_rmaps_base_oversubscribe: yes permissions: packages: read steps: From e71aa3725a6c590e0c1d767dac4ab5d0a7f3de84 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 13 Mar 2026 13:42:40 +0000 Subject: [PATCH 35/58] Print information from 2D-production test. --- tests/integrated/2D-production/runtest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrated/2D-production/runtest b/tests/integrated/2D-production/runtest index 945a455d5..a1995890c 100755 --- a/tests/integrated/2D-production/runtest +++ b/tests/integrated/2D-production/runtest @@ -10,7 +10,7 @@ import urllib.request import xhermes gen_data = False -verbose = False +verbose = True rtol = 1e-6 atol = 1e-8 From 1e920e122af5c245a0a98de3217e1a66276698d6 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 13 Mar 2026 13:43:44 +0000 Subject: [PATCH 36/58] Extend timeout, more verbose printing in tests. --- .github/workflows/docker_VANTAGE_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index e64091a5a..9bca39ece 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -12,7 +12,7 @@ jobs: docker_spack_install_tests: runs-on: ubuntu-latest # timeout to avoid running tests which do unexpected spack installation - timeout-minutes: 30 + timeout-minutes: 45 container: image: ghcr.io/ukaea-edge-code/hermes-3:edge credentials: @@ -37,4 +37,4 @@ jobs: run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && spack cd -b hermes-3 && - ctest -j 1 --output-on-failure --timeout 300 \ No newline at end of file + ctest -j 1 --output-on-failure --timeout 600 -VV From fca303826a9c4ec155a468a0b246da63d36c9f7c Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:26:06 +0000 Subject: [PATCH 37/58] A test python program just downloading the data for the 2D production test. --- 2D-production-download.py | 80 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 2D-production-download.py diff --git a/2D-production-download.py b/2D-production-download.py new file mode 100644 index 000000000..4725da8ae --- /dev/null +++ b/2D-production-download.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python3 +import numpy as np +import shutil +import zipfile +import hashlib +import os +from pathlib import Path +import urllib.request + +verbose = True +rtol = 1e-6 +atol = 1e-8 + +## Setup +this_dir = Path(__file__).parent + +zipfile_path = this_dir / "test-2D-production.zip" +url = "https://zenodo.org/records/18696440/files/test-2D-production-2026-02-19.zip" +expected_hash = "4472d27031a6fcedd30e11360814a66c075f8c14442df745e4e9d80a0dbd87f3" +expected_filenames = [ + "BOUT.restart.0.nc", + "BOUT.restart.1.nc", + "BOUT.restart.2.nc", + "BOUT.restart.3.nc", + "BOUT.restart.4.nc", + "BOUT.restart.5.nc", + "BOUT.restart.6.nc", + "BOUT.restart.7.nc", + "BOUT.restart.8.nc", + "BOUT.restart.9.nc", + "grid_test2_allpump.nc", +] + +if verbose: + print("2D-Production test: begin file download") + +## Download files +tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") + +with urllib.request.urlopen(url, timeout=60) as response: + if response.status != 200: + raise RuntimeError( + f"2D-Production test: download failed - HTTP {response.status}" + ) + + # Copy bits of the file from response to a temp file + # This ensures no partial files are left if the download fails + with open(tmp_path, "wb") as out_file: + shutil.copyfileobj(response, out_file) + + +if verbose: + print("2D-Production test: downloaded files") + +# Rename temp file with the correct name +tmp_path.replace(zipfile_path) + +with zipfile.ZipFile(zipfile_path, "r") as zf: + zip_contents = set(zf.namelist()) + try: + # Extract only expected grids + for filename in expected_filenames: + if filename in zip_contents: + zf.extract(filename, path=this_dir) + + except Exception as e: + print("2D-Production test: extracting test grids failed:", e) + +# Check hash +with open(zipfile_path, "rb") as f: + file_hash = hashlib.sha256(f.read()).hexdigest() +# print(file_hash) + +if file_hash != expected_hash: + raise RuntimeError( + "2D-Production test: downloaded zip file hash does not match expected value" + ) + +if verbose: + print("2D-Production test: downloaded and extracted files") \ No newline at end of file From 66e8e4225ca2ac07c48fe754bbc234221d3ed84d Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:28:25 +0000 Subject: [PATCH 38/58] Modify actions to only check the download of files, no spack installation. --- .github/workflows/docker_VANTAGE_tests.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 9bca39ece..34a5d2c70 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -28,13 +28,17 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive - - name: Install + - name: Check download run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && - spack concretize -f && - spack install -j 4 - - name : Run tests - run: source /opt/spack/share/spack/setup-env.sh && - spack env activate . -v gcc && - spack cd -b hermes-3 && - ctest -j 1 --output-on-failure --timeout 600 -VV + python3 2D-production-download.py + # - name: Install + # run: source /opt/spack/share/spack/setup-env.sh && + # spack env activate . -v gcc && + # spack concretize -f && + # spack install -j 4 + # - name : Run tests + # run: source /opt/spack/share/spack/setup-env.sh && + # spack env activate . -v gcc && + # spack cd -b hermes-3 && + # ctest -j 1 --output-on-failure --timeout 600 -VV From a5ca378bff81f5b32358e0861aad03042bded7be Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:29:06 +0000 Subject: [PATCH 39/58] Remove push trigger for cmake actions tests. --- .github/workflows/tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbd24ee0f..14a8e0fc7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,9 +1,6 @@ --- name: Tests on: - push: - branches: - - '**' pull_request: branches: - '**' # This will trigger for PRs against any branch From 0b6fb82ef95bfcfa77980cf89107e964e8482f48 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:38:35 +0000 Subject: [PATCH 40/58] Report on installed packages. --- .github/workflows/docker_VANTAGE_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 34a5d2c70..240a0a3d9 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -31,6 +31,7 @@ jobs: - name: Check download run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && + spack find && which python3 && python3 2D-production-download.py # - name: Install # run: source /opt/spack/share/spack/setup-env.sh && From 1d7ad7a7827f4bc0aed1f8c9603f4b370ba7babe Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 10:56:59 +0000 Subject: [PATCH 41/58] Make sure to regenerate the view to access python packages. --- .github/workflows/docker_VANTAGE_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 240a0a3d9..e634f8bd2 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -31,6 +31,7 @@ jobs: - name: Check download run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && + spack env view regenerate && spack find && which python3 && python3 2D-production-download.py # - name: Install From cf57fa31b2a7c342d072c99a660fc24f237f9db9 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 11:06:08 +0000 Subject: [PATCH 42/58] Concretize as well as regenerate the view. --- .github/workflows/docker_VANTAGE_tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index e634f8bd2..b89b05907 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -31,6 +31,7 @@ jobs: - name: Check download run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && + spack concretize -f && spack env view regenerate && spack find && which python3 && python3 2D-production-download.py From c0e47bf05e4a72405fb525fa417df869bc2a0c18 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:47:51 +0000 Subject: [PATCH 43/58] Execute download with the same syntax as ./runtest. --- .github/workflows/docker_VANTAGE_tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index b89b05907..d867c12b5 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -34,7 +34,9 @@ jobs: spack concretize -f && spack env view regenerate && spack find && which python3 && - python3 2D-production-download.py + chmod +x 2D-production-download.py && + ./2D-production-download.py + # python3 2D-production-download.py && # - name: Install # run: source /opt/spack/share/spack/setup-env.sh && # spack env activate . -v gcc && From 881c105abbfc2bfe0f6dadc04a01fd64ce951581 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Tue, 17 Mar 2026 13:56:05 +0000 Subject: [PATCH 44/58] Attempt to download test data before ctest execution. --- .github/workflows/docker_VANTAGE_tests.yml | 23 ++++--- tests/integrated/2D-production/runtest | 76 +++++++++++----------- 2 files changed, 51 insertions(+), 48 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index d867c12b5..8fb429152 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -37,13 +37,16 @@ jobs: chmod +x 2D-production-download.py && ./2D-production-download.py # python3 2D-production-download.py && - # - name: Install - # run: source /opt/spack/share/spack/setup-env.sh && - # spack env activate . -v gcc && - # spack concretize -f && - # spack install -j 4 - # - name : Run tests - # run: source /opt/spack/share/spack/setup-env.sh && - # spack env activate . -v gcc && - # spack cd -b hermes-3 && - # ctest -j 1 --output-on-failure --timeout 600 -VV + - name: Install + run: source /opt/spack/share/spack/setup-env.sh && + spack env activate . -v gcc && + spack concretize -f && + spack install -j 4 + - name : Run tests + run: source /opt/spack/share/spack/setup-env.sh && + spack env activate . -v gcc && + chmod +x 2D-production-download.py && + cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ + spack cd -b hermes-3 && + ./tests/integrated/2D-production/./2D-production-download.py && + ctest -j 1 --output-on-failure --timeout 300 -VV diff --git a/tests/integrated/2D-production/runtest b/tests/integrated/2D-production/runtest index a1995890c..61599afc4 100755 --- a/tests/integrated/2D-production/runtest +++ b/tests/integrated/2D-production/runtest @@ -37,47 +37,47 @@ expected_filenames = [ "grid_test2_allpump.nc", ] - -## Download files -tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") - -with urllib.request.urlopen(url, timeout=60) as response: - if response.status != 200: +if not Path(this_dir / expected_filenames[-1]).is_file(): + ## Download files + tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") + + with urllib.request.urlopen(url, timeout=60) as response: + if response.status != 200: + raise RuntimeError( + f"2D-Production test: download failed - HTTP {response.status}" + ) + + # Copy bits of the file from response to a temp file + # This ensures no partial files are left if the download fails + with open(tmp_path, "wb") as out_file: + shutil.copyfileobj(response, out_file) + + # Rename temp file with the correct name + tmp_path.replace(zipfile_path) + + with zipfile.ZipFile(zipfile_path, "r") as zf: + zip_contents = set(zf.namelist()) + try: + # Extract only expected grids + for filename in expected_filenames: + if filename in zip_contents: + zf.extract(filename, path=this_dir) + + except Exception as e: + print("2D-Production test: extracting test grids failed:", e) + + # Check hash + with open(zipfile_path, "rb") as f: + file_hash = hashlib.sha256(f.read()).hexdigest() + # print(file_hash) + + if file_hash != expected_hash: raise RuntimeError( - f"2D-Production test: download failed - HTTP {response.status}" + "2D-Production test: downloaded zip file hash does not match expected value" ) - # Copy bits of the file from response to a temp file - # This ensures no partial files are left if the download fails - with open(tmp_path, "wb") as out_file: - shutil.copyfileobj(response, out_file) - -# Rename temp file with the correct name -tmp_path.replace(zipfile_path) - -with zipfile.ZipFile(zipfile_path, "r") as zf: - zip_contents = set(zf.namelist()) - try: - # Extract only expected grids - for filename in expected_filenames: - if filename in zip_contents: - zf.extract(filename, path=this_dir) - - except Exception as e: - print("2D-Production test: extracting test grids failed:", e) - -# Check hash -with open(zipfile_path, "rb") as f: - file_hash = hashlib.sha256(f.read()).hexdigest() -# print(file_hash) - -if file_hash != expected_hash: - raise RuntimeError( - "2D-Production test: downloaded zip file hash does not match expected value" - ) - -if verbose: - print("2D-Production test: downloaded and extracted files") + if verbose: + print("2D-Production test: downloaded and extracted files") ## Run test if not Path("hermes-3").is_file(): From a5e428d5c6a618096a4dbce172687b085900bd13 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Tue, 17 Mar 2026 14:26:07 +0000 Subject: [PATCH 45/58] Add missing &&. --- .github/workflows/docker_VANTAGE_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 8fb429152..e1da2ee55 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -46,7 +46,7 @@ jobs: run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && chmod +x 2D-production-download.py && - cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ + cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ && spack cd -b hermes-3 && ./tests/integrated/2D-production/./2D-production-download.py && ctest -j 1 --output-on-failure --timeout 300 -VV From 5bcf72f7e257bcfad7d5fc669539d94d3a802d37 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Tue, 17 Mar 2026 15:50:42 +0000 Subject: [PATCH 46/58] Write some print statements to screen. --- tests/integrated/2D-production/runtest | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/integrated/2D-production/runtest b/tests/integrated/2D-production/runtest index 61599afc4..3e700d4a7 100755 --- a/tests/integrated/2D-production/runtest +++ b/tests/integrated/2D-production/runtest @@ -8,7 +8,7 @@ import os from pathlib import Path import urllib.request import xhermes - +print("step 0") gen_data = False verbose = True rtol = 1e-6 @@ -36,9 +36,10 @@ expected_filenames = [ "BOUT.restart.9.nc", "grid_test2_allpump.nc", ] - +print("step 1") if not Path(this_dir / expected_filenames[-1]).is_file(): ## Download files + print("step 1: attempt to download files") tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") with urllib.request.urlopen(url, timeout=60) as response: @@ -54,7 +55,7 @@ if not Path(this_dir / expected_filenames[-1]).is_file(): # Rename temp file with the correct name tmp_path.replace(zipfile_path) - + print("step 1: attempt to extract files") with zipfile.ZipFile(zipfile_path, "r") as zf: zip_contents = set(zf.namelist()) try: @@ -79,6 +80,7 @@ if not Path(this_dir / expected_filenames[-1]).is_file(): if verbose: print("2D-Production test: downloaded and extracted files") +print("step 2") ## Run test if not Path("hermes-3").is_file(): shell("ln -s ../../../hermes-3 hermes-3") @@ -88,7 +90,7 @@ runcmd = getmpirun().split(" ")[0] + " -np" # Allow oversubscription for OpenMPI via env var (silently ignored by MPICH, # which does not enforce slot limits and does not support --oversubscribe) os.environ["OMPI_MCA_rmaps_base_oversubscribe"] = "yes" - +print("step 3") s, out = launch_safe("./hermes-3 -d data", runcmd=runcmd, nproc=10, pipe=True) if s != 0: @@ -98,7 +100,7 @@ if s != 0: if verbose: print("2D-Production test: completed simulation") - +print("step 4") # Load case ds = xhermes.open_hermesdataset( datapath=output_path, From 0d837ff3870c6a5256038f37e9eabae2fec458dc Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:32:03 +0000 Subject: [PATCH 47/58] Timing statements in similar tests. --- tests/integrated/2D-production/runtest | 32 +++++++++++++++++--------- tests/integrated/2D-recycling/runtest | 21 +++++++++++++---- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/tests/integrated/2D-production/runtest b/tests/integrated/2D-production/runtest index 3e700d4a7..053491159 100755 --- a/tests/integrated/2D-production/runtest +++ b/tests/integrated/2D-production/runtest @@ -1,14 +1,25 @@ #!/usr/bin/env python3 +print("step -1") +from time import time +t0 = time() from boututils.run_wrapper import shell, launch_safe, getmpirun +print(f"step boututils: {time()- t0}") import numpy as np +print(f"step numpy: {time()- t0}") import shutil +print(f"step shutil: {time()- t0}") import zipfile +print(f"step zipfile: {time()- t0}") import hashlib +print(f"step hashlib: {time()- t0}") import os +print(f"step os: {time()- t0}") from pathlib import Path +print(f"step pathlib: {time()- t0}") import urllib.request +print(f"step urllib.request: {time()- t0}") import xhermes -print("step 0") +print(f"step xhermes: {time()- t0}") gen_data = False verbose = True rtol = 1e-6 @@ -36,10 +47,10 @@ expected_filenames = [ "BOUT.restart.9.nc", "grid_test2_allpump.nc", ] -print("step 1") +print(f"step 1: {time() - t0}") if not Path(this_dir / expected_filenames[-1]).is_file(): ## Download files - print("step 1: attempt to download files") + print(f"step 1 attempt to download files: {time() - t0}") tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") with urllib.request.urlopen(url, timeout=60) as response: @@ -55,7 +66,7 @@ if not Path(this_dir / expected_filenames[-1]).is_file(): # Rename temp file with the correct name tmp_path.replace(zipfile_path) - print("step 1: attempt to extract files") + print(f"step 1: attempt to extract files {time() - t0}") with zipfile.ZipFile(zipfile_path, "r") as zf: zip_contents = set(zf.namelist()) try: @@ -78,9 +89,9 @@ if not Path(this_dir / expected_filenames[-1]).is_file(): ) if verbose: - print("2D-Production test: downloaded and extracted files") + print(f"2D-Production test: downloaded and extracted files: {time() - t0}") -print("step 2") +print(f"step 2: {time() - t0}") ## Run test if not Path("hermes-3").is_file(): shell("ln -s ../../../hermes-3 hermes-3") @@ -90,7 +101,7 @@ runcmd = getmpirun().split(" ")[0] + " -np" # Allow oversubscription for OpenMPI via env var (silently ignored by MPICH, # which does not enforce slot limits and does not support --oversubscribe) os.environ["OMPI_MCA_rmaps_base_oversubscribe"] = "yes" -print("step 3") +print(f"step 3: {time() - t0}") s, out = launch_safe("./hermes-3 -d data", runcmd=runcmd, nproc=10, pipe=True) if s != 0: @@ -99,8 +110,7 @@ if s != 0: exit(1) if verbose: - print("2D-Production test: completed simulation") -print("step 4") + print(f"2D-Production test: completed simulation: {time() - t0}") # Load case ds = xhermes.open_hermesdataset( datapath=output_path, @@ -113,7 +123,7 @@ ds = xhermes.open_hermesdataset( ds = ds.hermes.extract_2d_tokamak_geometry() if verbose: - print("2D-Production test: loaded results") + print(f"2D-Production test: loaded results: {time() - t0}") # Testing at specific locations around the domain @@ -217,5 +227,5 @@ else: else: if verbose: - print("2D-production test: Passed") + print(f"2D-production test: Passed: {time() - t0}") exit(0) diff --git a/tests/integrated/2D-recycling/runtest b/tests/integrated/2D-recycling/runtest index ec64d10d2..055eb6f09 100755 --- a/tests/integrated/2D-recycling/runtest +++ b/tests/integrated/2D-recycling/runtest @@ -1,14 +1,27 @@ #!/usr/bin/env python3 +print("step -1") +from time import time +t0 = time() from boututils.run_wrapper import shell, launch_safe, getmpirun +print(f"step boututils: {time()- t0}") import numpy as np +print(f"step numpy: {time()- t0}") import matplotlib.pyplot as plt +print(f"step matplotlib.pyplot: {time()- t0}") import shutil +print(f"step shutil: {time()- t0}") import zipfile +print(f"step zipfile: {time()- t0}") import hashlib +print(f"step hashlib: {time()- t0}") import os +print(f"step os: {time()- t0}") from pathlib import Path +print(f"step pathlib: {time()- t0}") import urllib.request +print(f"step urllib.request: {time()- t0}") import xhermes +print(f"step xhermes: {time()- t0}") """ @@ -19,7 +32,7 @@ It mirrors the code in recycling.cxx. It's written in a way to allow easy debugg of the recycling calculation for development reasons. """ -verbose = False +verbose = True plot = False debug = False # Do not download files or run test rtol = 1e-6 @@ -76,7 +89,7 @@ if not debug: zf.extract(filename, path=this_dir) except Exception as e: - print("2D-recycling test: extracting test grids failed:", e) + print("2D-recycling test: extracting test grids failed:", e, f" {time()-t0}") # Check hash with open(zipfile_path, "rb") as f: @@ -89,7 +102,7 @@ if not debug: ) if verbose: - print("2D-recycling test: downloaded and extracted files") + print("2D-recycling test: downloaded and extracted files:", f" {time()-t0}") ## Run test if not Path("hermes-3").is_file(): @@ -109,7 +122,7 @@ if not debug: exit(1) if verbose: - print("2D-recycling test: completed simulation") + print("2D-recycling test: completed simulation:", f" {time()-t0}") ########################################################################## # Load case and perform test From b2f0113922da0554b95f05d24f59aa35df24632b Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 18 Mar 2026 11:32:45 +0000 Subject: [PATCH 48/58] ls to see downloaded files, verbose printing in cmake built integration tests. --- .github/workflows/docker_VANTAGE_tests.yml | 4 +++- .github/workflows/tests.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index e1da2ee55..52d55332b 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -35,7 +35,8 @@ jobs: spack env view regenerate && spack find && which python3 && chmod +x 2D-production-download.py && - ./2D-production-download.py + mkdir download-dir && cp 2D-production-download.py download-dir/ && + cd download-dir && ./2D-production-download.py && ls # python3 2D-production-download.py && - name: Install run: source /opt/spack/share/spack/setup-env.sh && @@ -49,4 +50,5 @@ jobs: cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ && spack cd -b hermes-3 && ./tests/integrated/2D-production/./2D-production-download.py && + ls ./tests/integrated/2D-production/ && ctest -j 1 --output-on-failure --timeout 300 -VV diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 14a8e0fc7..6bb85c4e8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -79,7 +79,7 @@ jobs: echo ~/.local/bin >> $GITHUB_PATH - name: Run tests run: cd build && - ctest --output-on-failure --timeout 300 -L $TEST_TYPE + ctest --output-on-failure --timeout 300 -L $TEST_TYPE -VV - name: Upload test coverage data uses: codecov/codecov-action@v5 if: ${{ matrix.build_type.coverage == 'ON' }} From b016281355d0c8c5da8acc5620cd5a9a653c8686 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 25 Mar 2026 16:30:04 +0000 Subject: [PATCH 49/58] Add default target granularity variable for sed to search and replace in docker image. --- spack.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spack.yaml b/spack.yaml index 95222362c..06faed1b4 100644 --- a/spack.yaml +++ b/spack.yaml @@ -21,6 +21,8 @@ spack: link_type: symlink concretizer: unify: when_possible + targets: + granularity: microarchitectures repos: - ./external/BOUT-spack/spack_repo/bout - ./external/Reactions/VANTAGE-repo From 08810e3d92731c1497bf7e75fb373b59a21194f0 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 25 Mar 2026 16:39:59 +0000 Subject: [PATCH 50/58] Change docker image name, use sed to use generic target granularity in spack-installed tests. --- .../workflows/build_docker_VANTAGE_dependencies_image.yml | 2 +- .github/workflows/docker_VANTAGE_tests.yml | 6 ++++-- VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 57bb82464..727b2f241 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -10,7 +10,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: UKAEA-Edge-Code/hermes-3 + IMAGE_NAME: UKAEA-Edge-Code/hermes-3-vantage-deps DOCKERFILE: VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile permissions: diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 52d55332b..aed7a0a6e 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -14,7 +14,7 @@ jobs: # timeout to avoid running tests which do unexpected spack installation timeout-minutes: 45 container: - image: ghcr.io/ukaea-edge-code/hermes-3:edge + image: ghcr.io/ukaea-edge-code/hermes-3-vantage-deps:edge credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} @@ -30,6 +30,7 @@ jobs: submodules: recursive - name: Check download run: source /opt/spack/share/spack/setup-env.sh && + sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && spack env activate . -v gcc && spack concretize -f && spack env view regenerate && @@ -40,9 +41,10 @@ jobs: # python3 2D-production-download.py && - name: Install run: source /opt/spack/share/spack/setup-env.sh && + sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && spack env activate . -v gcc && spack concretize -f && - spack install -j 4 + spack install -j 4 --only-concrete - name : Run tests run: source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 55023761c..90d4fcf26 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -24,7 +24,9 @@ WORKDIR /root/hermes-3 # Install hermes-3 dependencies via spack # Activate the hermes-3 environment, install dependencies -RUN < Date: Wed, 25 Mar 2026 16:44:35 +0000 Subject: [PATCH 51/58] Build docker image on push. --- .github/workflows/build_docker_VANTAGE_dependencies_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 727b2f241..072b186da 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -5,7 +5,7 @@ name: Build hermes-3+vantagereactions dependencies Docker image on: push: branches: - - 'VANTAGE-Reactions-Coupling/dev' + - ** workflow_dispatch: # Allows manual triggering env: From 9711f55b7ff11db6b13641934eb023efb4ef12da Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Wed, 25 Mar 2026 16:51:36 +0000 Subject: [PATCH 52/58] Attempt to correct syntax. --- ...uild_docker_VANTAGE_dependencies_image.yml | 2 +- .github/workflows/docker_VANTAGE_tests.yml | 49 ++++++++++--------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index 072b186da..f35ae6dfa 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -5,7 +5,7 @@ name: Build hermes-3+vantagereactions dependencies Docker image on: push: branches: - - ** + - '**' workflow_dispatch: # Allows manual triggering env: diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index aed7a0a6e..0b542baf6 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -29,28 +29,31 @@ jobs: with: submodules: recursive - name: Check download - run: source /opt/spack/share/spack/setup-env.sh && - sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && - spack env activate . -v gcc && - spack concretize -f && - spack env view regenerate && - spack find && which python3 && - chmod +x 2D-production-download.py && - mkdir download-dir && cp 2D-production-download.py download-dir/ && - cd download-dir && ./2D-production-download.py && ls - # python3 2D-production-download.py && + run: | + source /opt/spack/share/spack/setup-env.sh && + sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && + spack env activate . -v gcc && + spack concretize -f && + spack env view regenerate && + spack find && which python3 && + chmod +x 2D-production-download.py && + mkdir download-dir && cp 2D-production-download.py download-dir/ && + cd download-dir && ./2D-production-download.py && ls + # python3 2D-production-download.py && - name: Install - run: source /opt/spack/share/spack/setup-env.sh && - sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && - spack env activate . -v gcc && - spack concretize -f && - spack install -j 4 --only-concrete + run: | + source /opt/spack/share/spack/setup-env.sh && + sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && + spack env activate . -v gcc && + spack concretize -f && + spack install -j 4 --only-concrete - name : Run tests - run: source /opt/spack/share/spack/setup-env.sh && - spack env activate . -v gcc && - chmod +x 2D-production-download.py && - cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ && - spack cd -b hermes-3 && - ./tests/integrated/2D-production/./2D-production-download.py && - ls ./tests/integrated/2D-production/ && - ctest -j 1 --output-on-failure --timeout 300 -VV + run: | + source /opt/spack/share/spack/setup-env.sh && + spack env activate . -v gcc && + chmod +x 2D-production-download.py && + cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ && + spack cd -b hermes-3 && + ./tests/integrated/2D-production/./2D-production-download.py && + ls ./tests/integrated/2D-production/ && + ctest -j 1 --output-on-failure --timeout 300 -VV From 7d48949c5d381b8881256579655237afa1fae316 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Thu, 26 Mar 2026 13:37:52 +0000 Subject: [PATCH 53/58] Use sed to set `target=x86_64_v3` in docker image and VANTAGE tests. --- .github/workflows/docker_VANTAGE_tests.yml | 27 ++++++++++--------- .../hermes-3-VANTAGE-dependencies.dockerfile | 10 +++++++ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index 0b542baf6..f07fee904 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -12,7 +12,7 @@ jobs: docker_spack_install_tests: runs-on: ubuntu-latest # timeout to avoid running tests which do unexpected spack installation - timeout-minutes: 45 + timeout-minutes: 35 container: image: ghcr.io/ukaea-edge-code/hermes-3-vantage-deps:edge credentials: @@ -28,22 +28,23 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive - - name: Check download - run: | - source /opt/spack/share/spack/setup-env.sh && - sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && - spack env activate . -v gcc && - spack concretize -f && - spack env view regenerate && - spack find && which python3 && - chmod +x 2D-production-download.py && - mkdir download-dir && cp 2D-production-download.py download-dir/ && - cd download-dir && ./2D-production-download.py && ls - # python3 2D-production-download.py && + # - name: Check download + # run: | + # source /opt/spack/share/spack/setup-env.sh && + # sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && + # spack env activate . -v gcc && + # spack concretize -f && + # spack env view regenerate && + # spack find && which python3 && + # chmod +x 2D-production-download.py && + # mkdir download-dir && cp 2D-production-download.py download-dir/ && + # cd download-dir && ./2D-production-download.py && ls + # # python3 2D-production-download.py && - name: Install run: | source /opt/spack/share/spack/setup-env.sh && sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && + sed -i '/^[[:space:]]*providers:/i\ require: "target=x86_64_v3"' spack.yaml && spack env activate . -v gcc && spack concretize -f && spack install -j 4 --only-concrete diff --git a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile index 90d4fcf26..8ef889b80 100644 --- a/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile +++ b/VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile @@ -27,6 +27,16 @@ WORKDIR /root/hermes-3 RUN < Date: Fri, 27 Mar 2026 09:43:17 +0000 Subject: [PATCH 54/58] Tidy up test workflow. --- .github/workflows/docker_VANTAGE_tests.yml | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/.github/workflows/docker_VANTAGE_tests.yml b/.github/workflows/docker_VANTAGE_tests.yml index f07fee904..eefea0d49 100644 --- a/.github/workflows/docker_VANTAGE_tests.yml +++ b/.github/workflows/docker_VANTAGE_tests.yml @@ -28,18 +28,6 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive - # - name: Check download - # run: | - # source /opt/spack/share/spack/setup-env.sh && - # sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml && - # spack env activate . -v gcc && - # spack concretize -f && - # spack env view regenerate && - # spack find && which python3 && - # chmod +x 2D-production-download.py && - # mkdir download-dir && cp 2D-production-download.py download-dir/ && - # cd download-dir && ./2D-production-download.py && ls - # # python3 2D-production-download.py && - name: Install run: | source /opt/spack/share/spack/setup-env.sh && @@ -52,9 +40,5 @@ jobs: run: | source /opt/spack/share/spack/setup-env.sh && spack env activate . -v gcc && - chmod +x 2D-production-download.py && - cp 2D-production-download.py $(spack location -b hermes-3)/tests/integrated/2D-production/ && spack cd -b hermes-3 && - ./tests/integrated/2D-production/./2D-production-download.py && - ls ./tests/integrated/2D-production/ && - ctest -j 1 --output-on-failure --timeout 300 -VV + ctest -j 1 --output-on-failure --timeout 300 From 5c8797d33b56e1212eee1a245b84aa4959e61e8d Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 27 Mar 2026 09:43:44 +0000 Subject: [PATCH 55/58] Tidy up 2D-production test. --- 2D-production-download.py | 80 ----------------------- tests/integrated/2D-production/runtest | 89 +++++++++++++------------- 2 files changed, 44 insertions(+), 125 deletions(-) delete mode 100644 2D-production-download.py diff --git a/2D-production-download.py b/2D-production-download.py deleted file mode 100644 index 4725da8ae..000000000 --- a/2D-production-download.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -import numpy as np -import shutil -import zipfile -import hashlib -import os -from pathlib import Path -import urllib.request - -verbose = True -rtol = 1e-6 -atol = 1e-8 - -## Setup -this_dir = Path(__file__).parent - -zipfile_path = this_dir / "test-2D-production.zip" -url = "https://zenodo.org/records/18696440/files/test-2D-production-2026-02-19.zip" -expected_hash = "4472d27031a6fcedd30e11360814a66c075f8c14442df745e4e9d80a0dbd87f3" -expected_filenames = [ - "BOUT.restart.0.nc", - "BOUT.restart.1.nc", - "BOUT.restart.2.nc", - "BOUT.restart.3.nc", - "BOUT.restart.4.nc", - "BOUT.restart.5.nc", - "BOUT.restart.6.nc", - "BOUT.restart.7.nc", - "BOUT.restart.8.nc", - "BOUT.restart.9.nc", - "grid_test2_allpump.nc", -] - -if verbose: - print("2D-Production test: begin file download") - -## Download files -tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") - -with urllib.request.urlopen(url, timeout=60) as response: - if response.status != 200: - raise RuntimeError( - f"2D-Production test: download failed - HTTP {response.status}" - ) - - # Copy bits of the file from response to a temp file - # This ensures no partial files are left if the download fails - with open(tmp_path, "wb") as out_file: - shutil.copyfileobj(response, out_file) - - -if verbose: - print("2D-Production test: downloaded files") - -# Rename temp file with the correct name -tmp_path.replace(zipfile_path) - -with zipfile.ZipFile(zipfile_path, "r") as zf: - zip_contents = set(zf.namelist()) - try: - # Extract only expected grids - for filename in expected_filenames: - if filename in zip_contents: - zf.extract(filename, path=this_dir) - - except Exception as e: - print("2D-Production test: extracting test grids failed:", e) - -# Check hash -with open(zipfile_path, "rb") as f: - file_hash = hashlib.sha256(f.read()).hexdigest() -# print(file_hash) - -if file_hash != expected_hash: - raise RuntimeError( - "2D-Production test: downloaded zip file hash does not match expected value" - ) - -if verbose: - print("2D-Production test: downloaded and extracted files") \ No newline at end of file diff --git a/tests/integrated/2D-production/runtest b/tests/integrated/2D-production/runtest index 9b2848106..85dbd2f40 100755 --- a/tests/integrated/2D-production/runtest +++ b/tests/integrated/2D-production/runtest @@ -48,54 +48,53 @@ expected_filenames = [ "grid_test2_allpump.nc", ] print(f"step 1: {time() - t0}") -if not Path(this_dir / expected_filenames[-1]).is_file(): - ## Download files - print(f"step 1 attempt to download files: {time() - t0}") - tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") - - with urllib.request.urlopen(url, timeout=60) as response: - if response.status != 200: - raise RuntimeError( - f"2D-Production test: download failed - HTTP {response.status}" - ) - - # Copy bits of the file from response to a temp file - # This ensures no partial files are left if the download fails - with open(tmp_path, "wb") as out_file: - shutil.copyfileobj(response, out_file) - - t_download = time() - if verbose: - print(f"2D-Production test: download took {t_download - t0:.2f} seconds") - # Rename temp file with the correct name - tmp_path.replace(zipfile_path) - print(f"step 1: attempt to extract files {time() - t0}") - with zipfile.ZipFile(zipfile_path, "r") as zf: - zip_contents = set(zf.namelist()) - try: - # Extract only expected grids - for filename in expected_filenames: - if filename in zip_contents: - zf.extract(filename, path=this_dir) - - except Exception as e: - print("2D-Production test: extracting test grids failed:", e) - - # Check hash - with open(zipfile_path, "rb") as f: - file_hash = hashlib.sha256(f.read()).hexdigest() - # print(file_hash) - - if file_hash != expected_hash: +## Download files +print(f"step 1 attempt to download files: {time() - t0}") +tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") + +with urllib.request.urlopen(url, timeout=60) as response: + if response.status != 200: raise RuntimeError( - "2D-Production test: downloaded zip file hash does not match expected value" + f"2D-Production test: download failed - HTTP {response.status}" ) - t_extract = time() - if verbose: - print( - f"2D-Production test: zip extraction took {t_extract - t_download:.2f} seconds" - ) + # Copy bits of the file from response to a temp file + # This ensures no partial files are left if the download fails + with open(tmp_path, "wb") as out_file: + shutil.copyfileobj(response, out_file) + +t_download = time() +if verbose: + print(f"2D-Production test: download took {t_download - t0:.2f} seconds") +# Rename temp file with the correct name +tmp_path.replace(zipfile_path) +print(f"step 1: attempt to extract files {time() - t0}") +with zipfile.ZipFile(zipfile_path, "r") as zf: + zip_contents = set(zf.namelist()) + try: + # Extract only expected grids + for filename in expected_filenames: + if filename in zip_contents: + zf.extract(filename, path=this_dir) + + except Exception as e: + print("2D-Production test: extracting test grids failed:", e) + +# Check hash +with open(zipfile_path, "rb") as f: + file_hash = hashlib.sha256(f.read()).hexdigest() +# print(file_hash) + +if file_hash != expected_hash: + raise RuntimeError( + "2D-Production test: downloaded zip file hash does not match expected value" + ) + +t_extract = time() +if verbose: + print( + f"2D-Production test: zip extraction took {t_extract - t_download:.2f} seconds" + ) print(f"step 2: {time() - t0}") ## Run test From ac67a27de32f8d719cc12d1bb8fff03031bd6a1f Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 27 Mar 2026 09:45:29 +0000 Subject: [PATCH 56/58] Build docker image on push to `VANTAGE-Reactions-Coupling/dev`. --- .github/workflows/build_docker_VANTAGE_dependencies_image.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml index f35ae6dfa..727b2f241 100644 --- a/.github/workflows/build_docker_VANTAGE_dependencies_image.yml +++ b/.github/workflows/build_docker_VANTAGE_dependencies_image.yml @@ -5,7 +5,7 @@ name: Build hermes-3+vantagereactions dependencies Docker image on: push: branches: - - '**' + - 'VANTAGE-Reactions-Coupling/dev' workflow_dispatch: # Allows manual triggering env: From 4c0bfb391a07212e2ccd1c32d96e7443c71c4cd1 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Fri, 27 Mar 2026 11:16:55 +0000 Subject: [PATCH 57/58] Reduce verbosity in tests. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6bb85c4e8..14a8e0fc7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -79,7 +79,7 @@ jobs: echo ~/.local/bin >> $GITHUB_PATH - name: Run tests run: cd build && - ctest --output-on-failure --timeout 300 -L $TEST_TYPE -VV + ctest --output-on-failure --timeout 300 -L $TEST_TYPE - name: Upload test coverage data uses: codecov/codecov-action@v5 if: ${{ matrix.build_type.coverage == 'ON' }} From e11ead9e2574f72204685c2ed6f4835bd2a5c2f9 Mon Sep 17 00:00:00 2001 From: Michael Hardman <29800382+mrhardman@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:04:28 +0100 Subject: [PATCH 58/58] Use versions of runtest for `2D-` tests from upstream. --- tests/integrated/2D-production/runtest | 30 ++++++++++---------------- tests/integrated/2D-recycling/runtest | 17 +++------------ 2 files changed, 14 insertions(+), 33 deletions(-) diff --git a/tests/integrated/2D-production/runtest b/tests/integrated/2D-production/runtest index 555623d73..d7ba03a93 100755 --- a/tests/integrated/2D-production/runtest +++ b/tests/integrated/2D-production/runtest @@ -1,25 +1,17 @@ #!/usr/bin/env python3 -print("step -1") -from time import time -t0 = time() from boututils.run_wrapper import shell, launch_safe, getmpirun -print(f"step boututils: {time()- t0}") import numpy as np -print(f"step numpy: {time()- t0}") import shutil -print(f"step shutil: {time()- t0}") import zipfile -print(f"step zipfile: {time()- t0}") import hashlib -print(f"step hashlib: {time()- t0}") import os -print(f"step os: {time()- t0}") from pathlib import Path -print(f"step pathlib: {time()- t0}") import urllib.request -print(f"step urllib.request: {time()- t0}") import xhermes -print(f"step xhermes: {time()- t0}") +from time import time + +t0 = time() + gen_data = False verbose = True rtol = 1e-5 @@ -47,9 +39,9 @@ expected_filenames = [ "BOUT.restart.9.nc", "grid_test2_allpump.nc", ] -print(f"step 1: {time() - t0}") + + ## Download files -print(f"step 1 attempt to download files: {time() - t0}") tmp_path = zipfile_path.with_name(zipfile_path.name + ".tmp") with urllib.request.urlopen(url, timeout=60) as response: @@ -66,9 +58,11 @@ with urllib.request.urlopen(url, timeout=60) as response: t_download = time() if verbose: print(f"2D-Production test: download took {t_download - t0:.2f} seconds") + # Rename temp file with the correct name tmp_path.replace(zipfile_path) -print(f"step 1: attempt to extract files {time() - t0}") + + with zipfile.ZipFile(zipfile_path, "r") as zf: zip_contents = set(zf.namelist()) try: @@ -96,9 +90,7 @@ if verbose: f"2D-Production test: zip extraction took {t_extract - t_download:.2f} seconds" ) -print(f"step 2: {time() - t0}") ## Run test -t_start = time() if not Path("hermes-3").is_file(): shell("ln -s ../../../hermes-3 hermes-3") @@ -107,7 +99,7 @@ runcmd = getmpirun().split(" ")[0] + " -np" # Allow oversubscription for OpenMPI via env var (silently ignored by MPICH, # which does not enforce slot limits and does not support --oversubscribe) os.environ["OMPI_MCA_rmaps_base_oversubscribe"] = "yes" -print(f"step 3: {time() - t0}") + s, out = launch_safe("./hermes-3 -d data", runcmd=runcmd, nproc=10, pipe=True) if s != 0: @@ -117,7 +109,7 @@ if s != 0: t_run = time() if verbose: - print(f"2D-Production test: simulation took {t_run - t_start:.2f} seconds") + print(f"2D-Production test: simulation took {t_run - t_extract:.2f} seconds") # Load case ds = xhermes.open_hermesdataset( diff --git a/tests/integrated/2D-recycling/runtest b/tests/integrated/2D-recycling/runtest index 25cbe44f4..6b6d0a022 100755 --- a/tests/integrated/2D-recycling/runtest +++ b/tests/integrated/2D-recycling/runtest @@ -1,28 +1,17 @@ #!/usr/bin/env python3 -print("step -1") -from time import time -t0 = time() from boututils.run_wrapper import shell, launch_safe, getmpirun -print(f"step boututils: {time()- t0}") import numpy as np -print(f"step numpy: {time()- t0}") import matplotlib.pyplot as plt -print(f"step matplotlib.pyplot: {time()- t0}") import shutil -print(f"step shutil: {time()- t0}") import zipfile -print(f"step zipfile: {time()- t0}") import hashlib -print(f"step hashlib: {time()- t0}") import os -print(f"step os: {time()- t0}") from pathlib import Path -print(f"step pathlib: {time()- t0}") import urllib.request -print(f"step urllib.request: {time()- t0}") import xhermes -print(f"step xhermes: {time()- t0}") +from time import time +t0 = time() """ This test reconstructs neutra target density and energy sources due to recycling @@ -93,7 +82,7 @@ if not debug: zf.extract(filename, path=this_dir) except Exception as e: - print("2D-recycling test: extracting test grids failed:", e, f" {time()-t0}") + print("2D-recycling test: extracting test grids failed:", e) # Check hash with open(zipfile_path, "rb") as f: