Skip to content

Commit 6109179

Browse files
authored
Merge pull request #558 from sebproell/docker-update-deps-dealii
Build an image with deal.II
2 parents 7f38446 + 81e91a6 commit 6109179

File tree

15 files changed

+200
-56
lines changed

15 files changed

+200
-56
lines changed

.github/actions/build_dependencies/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ inputs:
1919
dependencies-hash:
2020
description: Hash of the dependencies
2121
required: true
22-
ubuntu-version:
23-
description: Version of Ubuntu to use
22+
base-image:
23+
description: Which image is the build based on
2424
required: true
2525
runs:
2626
using: composite
@@ -50,7 +50,7 @@ runs:
5050
file: ${{ inputs.docker-file }}
5151
build-args: |
5252
DEPENDENCIES_HASH=${{ inputs.dependencies-hash }}
53-
UBUNTU_VERSION=${{ inputs.ubuntu-version }}
53+
BASE_IMAGE=${{ inputs.base-image }}
5454
push: true
5555
tags: ${{ inputs.image-name }}:${{ inputs.dependencies-hash }}
5656
# tags: ${{ steps.meta.outputs.tags }}

.github/actions/check_docker_build_required/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
image-name:
1414
description: Name of the image
1515
required: true
16+
compute-dependencies-hash-script:
17+
description: Path to the script that computes the dependencies hash
18+
required: false
19+
default: './docker/dependencies/compute_dependencies_hash.sh'
1620
outputs:
1721
build_docker_image:
1822
description: Whether the docker image needs to be built
@@ -27,6 +31,7 @@ runs:
2731
uses: ./.github/actions/compute-and-check-dependencies-hash
2832
with:
2933
skip-check: 'true'
34+
compute-dependencies-hash-script: ${{ inputs.compute-dependencies-hash-script }}
3035
- name: Log in to the Container registry
3136
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
3237
with:

.github/actions/compute-and-check-dependencies-hash/action.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@ inputs:
55
description: 'If true, the check is skipped'
66
required: false
77
default: 'false'
8+
compute-dependencies-hash-script:
9+
description: 'Path to the script that computes the dependencies hash'
10+
required: false
11+
default: './docker/dependencies/compute_dependencies_hash.sh'
812
outputs:
913
computed_dependencies_hash:
1014
description: 'The computed hash from the dependencies'
11-
value: ${{ steps.compute-depencencies-hash.outputs.dependencies_hash }}
15+
value: ${{ steps.compute-dependencies-hash.outputs.dependencies_hash }}
1216
runs:
1317
using: composite
1418
steps:
15-
- id: compute-depencencies-hash
19+
- id: compute-dependencies-hash
1620
name: Compute the dependencies hash
1721
run: |
1822
cd $GITHUB_WORKSPACE
19-
COMPUTED_DOCKER_DEPENDENCIES_HASH=`./docker/dependencies/compute_dependencies_hash.sh`
23+
COMPUTED_DOCKER_DEPENDENCIES_HASH=`bash ${{ inputs.compute-dependencies-hash-script }}`
2024
echo "dependencies_hash=$COMPUTED_DOCKER_DEPENDENCIES_HASH" >> $GITHUB_OUTPUT
2125
shell: bash
2226
- id: check-if-dependencies-hash-matches
@@ -25,9 +29,9 @@ runs:
2529
shell: bash
2630
# Note: The dependencies hash is stored in the environment variable DEPENDENCIES_HASH in the docker image
2731
run: |
28-
if [[ "${{ steps.compute-depencencies-hash.outputs.dependencies_hash }}" == "$DEPENDENCIES_HASH" ]]; then
32+
if [[ "${{ steps.compute-dependencies-hash.outputs.dependencies_hash }}" == "$DEPENDENCIES_HASH" ]]; then
2933
echo "The hash is correct."
3034
else
31-
echo "The hashes differ. The computed hash is ${{ steps.compute-depencencies-hash.outputs.dependencies_hash }} while the container dependencies hash is $DEPENDENCIES_HASH. You probably need to adapt the dependencies hash in the workflow."
35+
echo "The hashes differ. The computed hash is ${{ steps.compute-dependencies-hash.outputs.dependencies_hash }} while the container dependencies hash is $DEPENDENCIES_HASH. You probably need to adapt the dependencies hash in the workflow."
3236
exit 1
3337
fi

.github/workflows/buildtest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
gcc13_assertions_build:
1717
runs-on: ubuntu-latest
1818
container:
19-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
19+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
2020
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
2121
defaults:
2222
run:
@@ -50,7 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
if: github.ref != 'refs/heads/main'
5252
container:
53-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
53+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
5454
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
5555
strategy:
5656
fail-fast: false
@@ -102,7 +102,7 @@ jobs:
102102
clang18_build:
103103
runs-on: ubuntu-latest
104104
container:
105-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
105+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
106106
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
107107
defaults:
108108
run:
@@ -139,7 +139,7 @@ jobs:
139139
needs: clang18_build
140140
runs-on: ubuntu-latest
141141
container:
142-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
142+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
143143
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
144144
defaults:
145145
run:
@@ -165,7 +165,7 @@ jobs:
165165
needs: clang18_build
166166
runs-on: ubuntu-latest
167167
container:
168-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
168+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
169169
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
170170
defaults:
171171
run:

.github/workflows/checkcode.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
clang-tidy:
3030
runs-on: ubuntu-latest
3131
container:
32-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
32+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
3333
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
3434
defaults:
3535
run:
@@ -53,7 +53,7 @@ jobs:
5353
verify-headers:
5454
runs-on: ubuntu-latest
5555
container:
56-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
56+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
5757
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
5858
defaults:
5959
run:

.github/workflows/coverage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
gcc13_coverage_build:
99
runs-on: ubuntu-latest
1010
container:
11-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
11+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
1212
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
1313
defaults:
1414
run:
@@ -41,7 +41,7 @@ jobs:
4141
needs: gcc13_coverage_build
4242
runs-on: ubuntu-latest
4343
container:
44-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
44+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
4545
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
4646
strategy:
4747
matrix:
@@ -107,7 +107,7 @@ jobs:
107107
needs: [gcc13_coverage_test, gcc13_coverage_build]
108108
runs-on: ubuntu-latest
109109
container:
110-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
110+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
111111
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
112112
steps:
113113
- uses: actions/checkout@v4

.github/workflows/docker.yml

Lines changed: 59 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
jobs:
24-
check-if-ubuntu24_04-build-is-required:
24+
check-if-build-dependencies-is-required:
2525
runs-on: ubuntu-latest
2626
if: github.event_name == 'workflow_dispatch'
2727
outputs:
2828
dependencies_hash: ${{ steps.check-docker-build-required.outputs.dependencies_hash }}
29-
build_docker_image: ${{ steps.check-docker-build-required.outputs.build }}
29+
build_docker_image: ${{ steps.check-docker-build-required.outputs.build_docker_image }}
3030
steps:
3131
- uses: actions/checkout@v4
3232
- id: check-docker-build-required
@@ -37,16 +37,16 @@ jobs:
3737
password: ${{ secrets.GITHUB_TOKEN }}
3838
image-name: ${{ env.REGISTRY }}/${{ env.PROJECT_NAMESPACE }}/4c-dependencies-ubuntu24.04
3939

40-
build-and-push-ubuntu24_04:
40+
build-dependencies:
4141
runs-on: ubuntu-latest
4242
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
4343
permissions:
4444
contents: read
4545
packages: write
4646
id-token: write
4747
#
48-
needs: check-if-ubuntu24_04-build-is-required
49-
if: github.event_name == 'workflow_dispatch' && ${{ needs.check-if-ubuntu24_04-build-is-required.outputs.build_docker_image
48+
needs: check-if-build-dependencies-is-required
49+
if: ${{ github.event_name == 'workflow_dispatch' && needs.check-if-build-dependencies-is-required.outputs.build_docker_image
5050
== 'true' }}
5151
steps:
5252
- name: Checkout repository
@@ -59,9 +59,61 @@ jobs:
5959
username: ${{ github.actor }}
6060
password: ${{ secrets.GITHUB_TOKEN }}
6161
image-name: ${{ env.REGISTRY }}/${{ env.PROJECT_NAMESPACE }}/4c-dependencies-ubuntu24.04
62-
dependencies-hash: ${{ needs.check-if-ubuntu24_04-build-is-required.outputs.dependencies_hash
62+
dependencies-hash: ${{ needs.check-if-build-dependencies-is-required.outputs.dependencies_hash
6363
}}
64-
ubuntu-version: "24.04"
64+
base-image: "ubuntu:24.04"
65+
66+
check-if-build-dependencies-dealii-is-required:
67+
runs-on: ubuntu-latest
68+
if: github.event_name == 'workflow_dispatch'
69+
outputs:
70+
dependencies_hash: ${{ steps.check-docker-build-required.outputs.dependencies_hash }}
71+
build_docker_image: ${{ steps.check-docker-build-required.outputs.build_docker_image }}
72+
steps:
73+
- uses: actions/checkout@v4
74+
- id: check-docker-build-required
75+
uses: ./.github/actions/check_docker_build_required
76+
with:
77+
registry: ${{ env.REGISTRY }}
78+
username: ${{ github.actor }}
79+
password: ${{ secrets.GITHUB_TOKEN }}
80+
image-name: ${{ env.REGISTRY }}/${{ env.PROJECT_NAMESPACE }}/4c-dependencies-dealii-ubuntu24.04
81+
compute-dependencies-hash-script: './docker/dependencies_dealii/compute_dependencies_hash.sh'
82+
83+
build-dependencies-dealii:
84+
runs-on: ubuntu-latest
85+
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
86+
permissions:
87+
contents: read
88+
packages: write
89+
id-token: write
90+
needs:
91+
- check-if-build-dependencies-dealii-is-required
92+
- build-dependencies
93+
if: ${{ github.event_name == 'workflow_dispatch' && needs.check-if-build-dependencies-dealii-is-required.outputs.build_docker_image
94+
== 'true' }}
95+
steps:
96+
- name: Checkout repository
97+
uses: actions/checkout@v4
98+
# We need to compute the dependencies hash for the base image (which must have been built before)
99+
- name: Compute dependencies hash base dependencies
100+
id: compute-dependencies-hash-base
101+
uses: ./.github/actions/compute-and-check-dependencies-hash
102+
with:
103+
compute-dependencies-hash-script: './docker/dependencies/compute_dependencies_hash.sh'
104+
skip-check: 'true'
105+
- name: Build and push image
106+
uses: ./.github/actions/build_dependencies
107+
with:
108+
docker-file: docker/dependencies_dealii/Dockerfile
109+
registry: ${{ env.REGISTRY }}
110+
username: ${{ github.actor }}
111+
password: ${{ secrets.GITHUB_TOKEN }}
112+
image-name: ${{ env.REGISTRY }}/${{ env.PROJECT_NAMESPACE }}/4c-dependencies-dealii-ubuntu24.04
113+
dependencies-hash: ${{ needs.check-if-build-dependencies-dealii-is-required.outputs.dependencies_hash
114+
}}
115+
base-image: "ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:${{ steps.check-if-build-dependencies-required.outputs.dependencies_hash
116+
}}"
65117

66118
tag-images-as-main:
67119
runs-on: ubuntu-latest

.github/workflows/docker_dealii.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
doxygen:
1919
runs-on: ubuntu-latest
2020
container:
21-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
21+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
2222
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
2323
defaults:
2424
run:
@@ -44,7 +44,7 @@ jobs:
4444
documentation:
4545
runs-on: ubuntu-latest
4646
container:
47-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
47+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
4848
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
4949
defaults:
5050
run:

.github/workflows/nightly_tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
gcc13_assertions_build:
99
runs-on: ubuntu-latest
1010
container:
11-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
11+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
1212
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
1313
defaults:
1414
run:
@@ -41,7 +41,7 @@ jobs:
4141
needs: gcc13_assertions_build
4242
runs-on: ubuntu-latest
4343
container:
44-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
44+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
4545
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
4646
strategy:
4747
fail-fast: false
@@ -93,7 +93,7 @@ jobs:
9393
clang18_build:
9494
runs-on: ubuntu-latest
9595
container:
96-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
96+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
9797
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
9898
defaults:
9999
run:
@@ -177,7 +177,7 @@ jobs:
177177
needs: clang18_build
178178
runs-on: ubuntu-latest
179179
container:
180-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
180+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
181181
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
182182
strategy:
183183
fail-fast: false
@@ -229,7 +229,7 @@ jobs:
229229
gcc13_asan_build:
230230
runs-on: ubuntu-latest
231231
container:
232-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
232+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
233233
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
234234
defaults:
235235
run:
@@ -262,7 +262,7 @@ jobs:
262262
needs: gcc13_asan_build
263263
runs-on: ubuntu-latest
264264
container:
265-
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:28cfb9d0
265+
image: ghcr.io/4c-multiphysics/4c-dependencies-ubuntu24.04:9d85686c
266266
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
267267
strategy:
268268
fail-fast: false

0 commit comments

Comments
 (0)