Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
48e76e9
Record a Dockerfile for creating an image with spack dependencies for…
mrhardman Mar 4, 2026
c95d2f9
Follow suggested best practices for apt-get commands in RUN https://d…
mrhardman Mar 6, 2026
2318c70
Initial attempt at a workflow for building a docker image with VANTAG…
mrhardman Mar 6, 2026
b332ebe
Attempt to trigger workflow on push.
mrhardman Mar 6, 2026
98aa4c4
Attempt to fix enable.
mrhardman Mar 6, 2026
2712bbc
Attempt to fix enable:2.
mrhardman Mar 6, 2026
62e7c7f
Make dockerfile trivial to debug actions.
mrhardman Mar 9, 2026
b727cd6
Attempt to write packages.
mrhardman Mar 9, 2026
c57fa07
Do not rebuild docker image.
mrhardman Mar 9, 2026
853d781
Correct typo
mrhardman Mar 9, 2026
c9cad56
Add runs-on.
mrhardman Mar 9, 2026
03f0765
Correct typo.
mrhardman Mar 9, 2026
7ac34a8
Use edge for now.
mrhardman Mar 9, 2026
5c3f5cd
Correct typo.
mrhardman Mar 9, 2026
20c4486
Repo/package name must be lower case.
mrhardman Mar 9, 2026
ab37452
Revert "Make dockerfile trivial to debug actions."
mrhardman Mar 9, 2026
b7da879
Revert "Do not rebuild docker image."
mrhardman Mar 9, 2026
ca3561c
Do not build image on push.
mrhardman Mar 9, 2026
3d4ed6e
Initial version of VANTAGE tests.
mrhardman Mar 9, 2026
e75625a
Use spack commands instead of spacktivate alias.
mrhardman Mar 9, 2026
6bbf899
Remember to checkout submodules.
mrhardman Mar 9, 2026
8480f6e
Have actions checkout submodules.
mrhardman Mar 9, 2026
1fb4e13
Merge branch 'VANTAGE-Reactions-Coupling/dev' into VANTAGE-Reactions-…
mrhardman Mar 11, 2026
7dfdc7b
Expand VANTAGE-docker/README.md with instructions for local usage.
mrhardman Mar 11, 2026
df9e261
Trigger on push to VANTAGE-Reactions-Coupling/dev only, or when manua…
mrhardman Mar 11, 2026
480bbc5
Remove push trigger for test.
mrhardman Mar 11, 2026
1b1e834
Make sure uninstallation of packages happens within the layer that th…
mrhardman Mar 11, 2026
3345f65
Add a timeout-minutes to avoid wasting Actions time.
mrhardman Mar 11, 2026
0785b68
Use `COPY` instead of `RUN git clone https://github.com/UKAEA-Edge-Co…
mrhardman Mar 11, 2026
64c1539
Remove concretize from dockerfile.
mrhardman Mar 12, 2026
8c67997
Use a sha256 hash to specify the ubuntu version in the dockerfile.
mrhardman Mar 12, 2026
96e5e9b
Correct `spack compiler find` command.
mrhardman Mar 13, 2026
fbe601c
Try including OMP flags to speedup tests.
mrhardman Mar 13, 2026
1ff0de8
Reduce number of tests to run in parallel.
mrhardman Mar 13, 2026
6580e7e
Move env inside container settings.
mrhardman Mar 13, 2026
e71aa37
Print information from 2D-production test.
mrhardman Mar 13, 2026
1e920e1
Extend timeout, more verbose printing in tests.
mrhardman Mar 13, 2026
fca3038
A test python program just downloading the data for the 2D production…
mrhardman Mar 16, 2026
66e8e42
Modify actions to only check the download of files, no spack installa…
mrhardman Mar 16, 2026
a5ca378
Remove push trigger for cmake actions tests.
mrhardman Mar 16, 2026
0b6fb82
Report on installed packages.
mrhardman Mar 16, 2026
1d7ad7a
Make sure to regenerate the view to access python packages.
mrhardman Mar 16, 2026
cf57fa3
Concretize as well as regenerate the view.
mrhardman Mar 16, 2026
c0e47bf
Execute download with the same syntax as ./runtest.
mrhardman Mar 16, 2026
881c105
Attempt to download test data before ctest execution.
mrhardman Mar 17, 2026
a5e428d
Add missing &&.
mrhardman Mar 17, 2026
5bcf72f
Write some print statements to screen.
mrhardman Mar 17, 2026
0d837ff
Timing statements in similar tests.
mrhardman Mar 18, 2026
b2f0113
ls to see downloaded files, verbose printing in cmake built integrati…
mrhardman Mar 18, 2026
8949e8d
Merge remote-tracking branch 'upstream/faster-tests' into VANTAGE-Rea…
mrhardman Mar 25, 2026
b016281
Add default target granularity variable for sed to search and replace…
mrhardman Mar 25, 2026
08810e3
Change docker image name, use sed to use generic target granularity i…
mrhardman Mar 25, 2026
6e37475
Build docker image on push.
mrhardman Mar 25, 2026
9711f55
Attempt to correct syntax.
mrhardman Mar 25, 2026
7d48949
Use sed to set `target=x86_64_v3` in docker image and VANTAGE tests.
mrhardman Mar 26, 2026
00212f7
Tidy up test workflow.
mrhardman Mar 27, 2026
5c8797d
Tidy up 2D-production test.
mrhardman Mar 27, 2026
ac67a27
Build docker image on push to `VANTAGE-Reactions-Coupling/dev`.
mrhardman Mar 27, 2026
4201ac9
Merge pull request #32 from UKAEA-Edge-Code/VANTAGE-Reactions-Couplin…
mrhardman Mar 27, 2026
4c0bfb3
Reduce verbosity in tests.
mrhardman Mar 27, 2026
3905a8d
Merge branch 'VANTAGE-Reactions-Coupling/dev' into VANTAGE-Reactions-…
mrhardman Mar 31, 2026
dc8fa17
Merge branch 'VANTAGE-Reactions-Coupling/dev' into VANTAGE-Reactions-…
mrhardman Mar 31, 2026
e11ead9
Use versions of runtest for `2D-` tests from upstream.
mrhardman Mar 31, 2026
0f87664
Merge branch 'VANTAGE-Reactions-Coupling/dev' into VANTAGE-Reactions-…
mrhardman Apr 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions .github/workflows/build_docker_VANTAGE_dependencies_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build hermes-3+vantagereactions dependencies Docker image

# 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:
- 'VANTAGE-Reactions-Coupling/dev'
workflow_dispatch: # Allows manual triggering

env:
REGISTRY: ghcr.io
IMAGE_NAME: UKAEA-Edge-Code/hermes-3-vantage-deps
DOCKERFILE: VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile

permissions:
packages: write

jobs:

build-final-image:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: recursive
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=ref,event=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

44 changes: 44 additions & 0 deletions .github/workflows/docker_VANTAGE_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: hermes-3 + VANTAGE Tests
on:
pull_request:
branches:
- '**' # This will trigger for PRs against any branch

defaults:
run:
shell: bash

jobs:
docker_spack_install_tests:
runs-on: ubuntu-latest
# timeout to avoid running tests which do unexpected spack installation
timeout-minutes: 35
container:
image: ghcr.io/ukaea-edge-code/hermes-3-vantage-deps:edge
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
env:
OMP_NUM_THREADS: 1
OMPI_MCA_rmaps_base_oversubscribe: yes
permissions:
packages: read
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
submodules: recursive
- 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
- 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 300
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
name: Tests
on:
push:
branches:
- '**'
pull_request:
branches:
- '**' # This will trigger for PRs against any branch
Expand Down
55 changes: 55 additions & 0 deletions VANTAGE-docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +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.
Comment thread
mrhardman marked this conversation as resolved.

# 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
```
53 changes: 53 additions & 0 deletions VANTAGE-docker/hermes-3-VANTAGE-dependencies.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Build stage with Spack pre-installed and ready to be used
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 \
&& 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
RUN spack repo update
# find the gcc compiler
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
# set the workdir
WORKDIR /root/hermes-3

# Install hermes-3 dependencies via spack
# Activate the hermes-3 environment, install dependencies
RUN <<EOF
# use generic microarchitectures to avoid conflicts between runners using zen2, icelake, etc
sed -i 's/^[[:space:]]*granularity:[[:space:]]*microarchitectures/ granularity: generic/' spack.yaml
# demand target=x86_64_v3, assume that spack.yaml has unique block
# all:
# providers:
# mpi: [mpich, openmpi ]
# which we mutate to
# all:
# providers:
# require: "target=x86_64_v3"
# mpi: [mpich, openmpi ]
sed -i '/^[[:space:]]*providers:/i\ require: "target=x86_64_v3"' spack.yaml
spack env activate . -v gcc
# Install the dependencies
spack install -j 4 --only dependencies
# Uninstall the top-level packages that we expect to develop regularly
spack uninstall -y --dependents boutpp@develop || true
spack uninstall -y --dependents vantagereactions@working || true
spack uninstall -y --dependents neso-particles@working || true
Comment thread
mrhardman marked this conversation as resolved.
EOF
# set workdir back to /root
WORKDIR /root
# remove hermes-3 clone, leaving dependencies installed
RUN rm -rf /root/hermes-3

ENTRYPOINT ["/bin/bash"]
2 changes: 2 additions & 0 deletions spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading