Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Build Firedrake Docker container with (Par)Mmg
name: Build Firedrake Docker container with (Par)Mmg (main)

on:
# Check that Docker build succeeds when these files get changed in an open PR
pull_request:
paths:
- '.github/workflows/reusable_docker_build.yml'
- '.github/workflows/docker_firedrake-parmmg.yml'
- '.github/workflows/reusable_test_suite.yml'
- '.github/workflows/docker_firedrake-parmmg_main.yml'
- 'docker/Dockerfile.firedrake-parmmg'
- 'docker/Dockerfile.firedrake-um2n'

Expand All @@ -16,8 +15,7 @@ on:
- main
paths:
- '.github/workflows/reusable_docker_build.yml'
- '.github/workflows/docker_firedrake-parmmg.yml'
- '.github/workflows/reusable_test_suite.yml'
- '.github/workflows/docker_firedrake-parmmg_main.yml'
- 'docker/Dockerfile.firedrake-parmmg'
- 'docker/Dockerfile.firedrake-um2n'

Expand All @@ -41,10 +39,12 @@ jobs:
packages: write
uses: ./.github/workflows/reusable_docker_build.yml
with:
# use Dockerfile.vanilla from firedrake to build firedrake-parmmg-base image
# which contains a build of petsc+firedrake with (Par)Mmg libraries included
# use Dockerfile.vanilla from Firedrake to build firedrake-parmmg-base image
# which contains a build of PETSc+Firedrake with (Par)Mmg libraries included
dockerfile-repo: 'firedrakeproject/firedrake'
dockerfile-path: 'docker/Dockerfile.vanilla'
dockerfile-branch: 'main'
firedrake-branch: 'main'
docker-image-tag: 'ghcr.io/mesh-adaptation/firedrake-parmmg-base:latest'
save-docker-image-artifact: 'firedrake-parmmg-base'

Expand All @@ -57,6 +57,7 @@ jobs:
# starting from firedrake-parmmg-base, build firedrake-parmmg image
# which includes Animate, Movement, Goalie, and Thetis packages
dockerfile-path: 'docker/Dockerfile.firedrake-parmmg'
firedrake-branch: 'main'
docker-image-tag: 'ghcr.io/mesh-adaptation/firedrake-parmmg:latest'
load-docker-image-artifact: 'firedrake-parmmg-base'
save-docker-image-artifact: 'firedrake-parmmg'
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/docker_firedrake-parmmg_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build Firedrake Docker container with (Par)Mmg (release)

on:
# Check that Docker build succeeds when these files get changed in an open PR
pull_request:
paths:
- '.github/workflows/reusable_docker_build.yml'
- '.github/workflows/docker_firedrake-parmmg_release.yml'
- 'docker/Dockerfile.firedrake-parmmg'
- 'docker/Dockerfile.firedrake-um2n'

# Build and push the Docker container when these files get changed on the main branch
push:
branches:
- main
paths:
- '.github/workflows/reusable_docker_build.yml'
- '.github/workflows/docker_firedrake-parmmg_release.yml'
- 'docker/Dockerfile.firedrake-parmmg'
- 'docker/Dockerfile.firedrake-um2n'

# Run test suite at 1AM on the first of the month
schedule:
- cron: '0 1 1 * *'

# Manually trigger the workflow
workflow_dispatch:

permissions: {}

# Stop the workflow if a new run is requested
concurrency:
group: $${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
docker_base:
permissions:
packages: write
uses: ./.github/workflows/reusable_docker_build.yml
with:
# use Dockerfile.vanilla from Firedrake to build firedrake-parmmg-base image
# which contains a build of PETSc+Firedrake with (Par)Mmg libraries included
dockerfile-repo: 'firedrakeproject/firedrake'
dockerfile-path: 'docker/Dockerfile.vanilla'
dockerfile-branch: 'release'
firedrake-branch: 'release'
docker-image-tag: 'ghcr.io/mesh-adaptation/firedrake-parmmg-base:release'
save-docker-image-artifact: 'firedrake-parmmg-base-release'

docker_parmmg:
permissions:
packages: write
uses: ./.github/workflows/reusable_docker_build.yml
needs: docker_base
with:
# starting from firedrake-parmmg-base, build firedrake-parmmg image
# which includes Animate, Movement, Goalie, and Thetis packages
dockerfile-path: 'docker/Dockerfile.firedrake-parmmg'
firedrake-branch: 'release'
docker-image-tag: 'ghcr.io/mesh-adaptation/firedrake-parmmg:release'
load-docker-image-artifact: 'firedrake-parmmg-base-release'
17 changes: 14 additions & 3 deletions .github/workflows/reusable_docker_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ on:
default: ${{ github.repository }}
required: false
type: string
dockerfile-branch:
description: 'Branch of repo containing Dockerfile'
required: false
default: ${{ github.head_ref }}
type: string
firedrake-branch:
description: 'Branch to pass as the BRANCH build argument when building the Docker container'
required: false
default: ${{ github.head_ref }}
type: string
dockerfile-path:
description: 'Path to the Dockerfile to be built'
required: true
Expand Down Expand Up @@ -41,6 +51,7 @@ jobs:
with:
persist-credentials: false
repository: ${{ inputs.dockerfile-repo }}
ref: ${{ inputs.dockerfile-branch }}
sparse-checkout: ${{ inputs.dockerfile-path }}
sparse-checkout-cone-mode: false
path: .
Expand All @@ -55,7 +66,7 @@ jobs:
- name: Load previously built Docker image
if: ${{ inputs.load-docker-image-artifact != null }}
run: |
if [[ ! "${{ inputs.load-docker-image-artifact }}" =~ ^firedrake-[a-z-]{1,11}$ ]]; then
if [[ ! "${{ inputs.load-docker-image-artifact }}" =~ ^firedrake-[a-z-]{1,19}$ ]]; then
echo "Invalid input for load-docker-image-artifact"
exit 1
fi
Expand Down Expand Up @@ -90,13 +101,13 @@ jobs:
tags: ${{ inputs.docker-image-tag }}
build-args: |
ARCH=default
BRANCH=main
BRANCH=${{ inputs.firedrake-branch }}
PETSC_EXTRA_ARGS=--download-eigen --download-metis --download-parmetis --download-mmg --download-parmmg --download-ptscotch

- name: Save Docker image
if: ${{ inputs.save-docker-image-artifact != null }}
run: |
if [[ ! "${{ inputs.save-docker-image-artifact }}" =~ ^firedrake-[a-z-]{1,11}$ ]]; then
if [[ ! "${{ inputs.save-docker-image-artifact }}" =~ ^firedrake-[a-z-]{1,19}$ ]]; then
echo "Invalid input for save-docker-image-artifact"
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/reusable_test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
docker-image:
description: 'Name of the Firedrake Docker image to use'
required: false
default: 'firedrake-parmmg'
default: 'firedrake-parmmg:latest'
type: string

concurrency:
Expand All @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
container:
image: ghcr.io/mesh-adaptation/${{ inputs.docker-image }}:latest
image: ghcr.io/mesh-adaptation/${{ inputs.docker-image }}
options: --user root
env:
# Name of the repository that triggered the workflow
Expand Down
6 changes: 6 additions & 0 deletions docker/Dockerfile.firedrake-parmmg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
# and with the main mesh-adaptation packages installed in /root
FROM ghcr.io/mesh-adaptation/firedrake-parmmg-base:latest

# Which branch is to be used across all repositories?
ARG BRANCH="main"

WORKDIR /root

# Install Thetis
Expand All @@ -12,6 +15,9 @@ RUN git clone https://github.com/mesh-adaptation/adapt_common.git && \
git clone https://github.com/mesh-adaptation/animate.git && \
git clone https://github.com/mesh-adaptation/movement.git && \
git clone https://github.com/mesh-adaptation/goalie.git && \
cd animate && git checkout ${BRANCH} && cd .. && \
cd movement && git checkout ${BRANCH} && cd .. && \
cd goalie && git checkout ${BRANCH} && cd .. && \
cd animate && git submodule init && git submodule update && cd .. && \
cd movement && git submodule init && git submodule update && cd .. && \
pip install -e adapt_common[dev] && \
Expand Down
10 changes: 5 additions & 5 deletions zizmor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ rules:
template-injection:
ignore:
# Ignore template injection in cases where we manually check inputs
- reusable_docker_build.yml:56
- reusable_docker_build.yml:60
- reusable_docker_build.yml:63
- reusable_docker_build.yml:104
- reusable_docker_build.yml:109
- reusable_docker_build.yml:69
- reusable_docker_build.yml:73
- reusable_docker_build.yml:74
- reusable_docker_build.yml:110
- reusable_docker_build.yml:115
unpinned-images:
ignore:
# Ignore unpinned images for trusted Docker images
Expand Down