Skip to content

Commit 9d654ec

Browse files
authored
Merge pull request #4591 from firedrakeproject/connorjward/merge-release
Merge release
2 parents db4a9d3 + 40da280 commit 9d654ec

File tree

11 files changed

+198
-199
lines changed

11 files changed

+198
-199
lines changed

.github/workflows/core.yml

Lines changed: 94 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ on:
2727
description: Whether to upload an sdist to PyPI
2828
type: boolean
2929
default: false
30-
upload_testpypi:
31-
description: Whether to upload an sdist to TestPyPI
32-
type: boolean
33-
default: false
3430

3531
workflow_dispatch:
3632
inputs:
@@ -58,10 +54,6 @@ on:
5854
description: Whether to upload an sdist to PyPI
5955
type: boolean
6056
default: false
61-
upload_testpypi:
62-
description: Whether to upload an sdist to TestPyPI
63-
type: boolean
64-
default: false
6557

6658
concurrency:
6759
# Cancel running jobs if new commits are pushed
@@ -84,7 +76,6 @@ jobs:
8476
image: ubuntu:latest
8577
outputs:
8678
sdist_conclusion: ${{ steps.report_sdist.outputs.conclusion }}
87-
docs_conclusion: ${{ steps.report_docs.outputs.conclusion }}
8879
env:
8980
OMPI_ALLOW_RUN_AS_ROOT: 1
9081
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
@@ -108,18 +99,6 @@ jobs:
10899
# Make sure the current directory is empty
109100
run: find . -delete
110101

111-
# Check that the Dockerfile is using the latest Ubuntu version.
112-
# The version is hardcoded into the Dockerfile so that the OS
113-
# for each release is fixed.
114-
- name: Check Dockerfile Ubuntu version
115-
run: |
116-
latest_version=$(grep "VERSION_ID=" /etc/os-release | cut -d '"' -f 2)
117-
docker_version=$(grep FROM docker/Dockerfile.vanilla | cut -d ':' -f 2)
118-
if [[ "$docker_version" != "$latest_version" ]]; then
119-
echo "Ubuntu version ${docker_version} in Dockerfile is out of date with latest version ${latest_version}"
120-
exit 1
121-
fi
122-
123102
# Use a different mirror to fetch apt packages from to get around
124103
# temporary outage.
125104
# (https://askubuntu.com/questions/1549622/problem-with-archive-ubuntu-com-most-of-the-servers-are-not-responding)
@@ -141,6 +120,20 @@ jobs:
141120
- name: Validate single source of truth
142121
run: ./firedrake-repo/scripts/check-config
143122

123+
# Check that the Dockerfile is using the latest Ubuntu version.
124+
# The version is hardcoded into the Dockerfile so that the OS
125+
# for each release is fixed.
126+
- name: Check Dockerfile Ubuntu version
127+
run: |
128+
latest_version=$(grep "VERSION_ID=" /etc/os-release | cut -d '"' -f 2)
129+
docker_version=$(grep FROM firedrake-repo/docker/Dockerfile.vanilla | cut -d ':' -f 2)
130+
echo "Latest version: $latest_version"
131+
echo "Docker version: $docker_version"
132+
if [[ "$docker_version" != "$latest_version" ]]; then
133+
echo "Ubuntu version ${docker_version} in Dockerfile is out of date with latest version ${latest_version}"
134+
exit 1
135+
fi
136+
144137
# Raise an error if any 'TODO RELEASE' comments remain
145138
- name: Check no 'TODO RELEASE' comments (release only)
146139
if: inputs.target_branch == 'release'
@@ -219,7 +212,7 @@ jobs:
219212
pip install --verbose $EXTRA_PIP_FLAGS \
220213
--no-binary h5py \
221214
--extra-index-url https://download.pytorch.org/whl/cpu \
222-
"$(echo ./firedrake-repo/dist/firedrake-*.tar.gz)[ci,docs]"
215+
"$(echo ./firedrake-repo/dist/firedrake-*.tar.gz)[ci]"
223216
224217
firedrake-clean
225218
pip list
@@ -381,67 +374,6 @@ jobs:
381374
name: firedrake-logs-${{ matrix.arch }}
382375
path: pytest_*.log
383376

384-
- name: Install system dependencies (3)
385-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
386-
run: apt-get -y install inkscape texlive-full
387-
388-
- name: Check bibtex
389-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
390-
run: |
391-
. venv/bin/activate
392-
make -C firedrake-repo/docs validate-bibtex
393-
394-
- name: Check documentation links
395-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
396-
run: |
397-
. venv/bin/activate
398-
make -C firedrake-repo/docs linkcheck
399-
400-
- name: Build documentation
401-
if: (success() || steps.install.conclusion == 'success') && matrix.arch == 'default'
402-
id: build_docs
403-
run: |
404-
. venv/bin/activate
405-
cd firedrake-repo/docs
406-
make SPHINXOPTS="-t ${{ inputs.target_branch }}" html
407-
make latex
408-
make latexpdf
409-
# : Copy manual to HTML tree
410-
cp build/latex/Firedrake.pdf build/html/_static/manual.pdf
411-
412-
- name: Upload documentation
413-
uses: actions/upload-pages-artifact@v3
414-
id: upload_docs
415-
if: (success() || steps.build_docs.conclusion == 'success') && matrix.arch == 'default'
416-
with:
417-
name: github-pages
418-
path: firedrake-repo/docs/build/html
419-
retention-days: 1
420-
421-
- name: Report docs build status
422-
id: report_docs
423-
if: success() || steps.upload_docs.conclusion == 'success'
424-
run: echo "conclusion=success" >> "$GITHUB_OUTPUT"
425-
426-
# Some files are automatically generated when we install or build the
427-
# docs (e.g. AUTHORS.rst). These files are committed to the repository
428-
# so uncommitted changes at this point reflect changes in the automatically
429-
# generated files that ought to be committed.
430-
- name: Check no untracked files
431-
if: always()
432-
working-directory: firedrake-repo
433-
run: |
434-
if [ -z "$( git status --porcelain )" ]; then
435-
exit 0
436-
else
437-
echo Error: there are untracked files in the repository
438-
echo The output from 'git status' is:
439-
git status
440-
echo The output from 'git diff' is:
441-
git diff
442-
exit 1
443-
fi
444-
445377
- name: Post-run cleanup
446378
if: always()
447379
run: find . -delete
@@ -555,16 +487,93 @@ jobs:
555487
- name: Lint codebase
556488
run: make lint GITHUB_ACTIONS_FORMATTING=1
557489

490+
build_docs:
491+
name: Build documentation
492+
runs-on: [self-hosted, Linux]
493+
container:
494+
image: firedrakeproject/firedrake-vanilla-default:dev-${{ inputs.target_branch }}
495+
outputs:
496+
conclusion: ${{ steps.report_docs.outputs.conclusion }}
497+
steps:
498+
- name: Install system dependencies
499+
run: |
500+
apt-get update
501+
apt-get -y install inkscape texlive-full
502+
503+
- uses: actions/checkout@v5
504+
with:
505+
path: firedrake-repo
506+
ref: ${{ inputs.source_ref }}
507+
508+
- name: Install Firedrake
509+
id: install
510+
run: |
511+
CC=mpicc CXX=mpicxx \
512+
pip install --verbose --no-build-isolation './firedrake-repo[docs]'
513+
firedrake-clean
514+
pip list
515+
516+
- name: Check bibtex
517+
run: make -C firedrake-repo/docs validate-bibtex
518+
519+
- name: Check documentation links
520+
if: success() || steps.install.conclusion == 'success'
521+
run: make -C firedrake-repo/docs linkcheck
522+
523+
- name: Build documentation
524+
if: success() || steps.install.conclusion == 'success'
525+
id: build_docs
526+
working-directory: firedrake-repo/docs
527+
run: |
528+
make SPHINXOPTS="-t ${{ inputs.target_branch }}" html
529+
make latex
530+
make latexpdf
531+
# : Copy manual to HTML tree
532+
cp build/latex/Firedrake.pdf build/html/_static/manual.pdf
533+
534+
- name: Upload documentation
535+
uses: actions/upload-pages-artifact@v3
536+
id: upload_docs
537+
if: success() || steps.build_docs.conclusion == 'success'
538+
with:
539+
name: github-pages
540+
path: firedrake-repo/docs/build/html
541+
retention-days: 1
542+
543+
# Some files are automatically generated when we install or build the
544+
# docs (e.g. AUTHORS.rst). These files are committed to the repository
545+
# so uncommitted changes at this point reflect changes in the automatically
546+
# generated files that ought to be committed.
547+
- name: Check no untracked files
548+
if: always()
549+
working-directory: firedrake-repo
550+
run: |
551+
if [ -z "$( git status --porcelain )" ]; then
552+
exit 0
553+
else
554+
echo Error: there are untracked files in the repository
555+
echo The output from 'git status' is:
556+
git status
557+
echo The output from 'git diff' is:
558+
git diff
559+
exit 1
560+
fi
561+
562+
- name: Report docs build status
563+
id: report_docs
564+
if: success() || steps.upload_docs.conclusion == 'success'
565+
run: echo "conclusion=success" >> "$GITHUB_OUTPUT"
566+
558567
deploy_website:
559568
name: Deploy GitHub pages (optional)
560-
needs: test_linux
569+
needs: build_docs
561570
# Only deploy the website for main here, the release branch is managed
562571
# by https://github.com/firedrakeproject/firedrakeproject.github.io
563572
if: |
564573
always() &&
565574
inputs.deploy_website &&
566575
inputs.target_branch == 'main' &&
567-
needs.test_linux.outputs.docs_conclusion == 'success'
576+
needs.build_docs.outputs.conclusion == 'success'
568577
permissions:
569578
pages: write
570579
id-token: write
@@ -596,26 +605,3 @@ jobs:
596605
uses: pypa/gh-action-pypi-publish@release/v1
597606
with:
598607
password: ${{ secrets.PYPI_API_TOKEN }}
599-
600-
upload_testpypi:
601-
name: Upload to TestPyPI (optional)
602-
needs: test_linux
603-
if: |
604-
always() &&
605-
inputs.upload_testpypi &&
606-
inputs.target_branch == 'release' &&
607-
needs.test_linux.outputs.sdist_conclusion == 'success'
608-
runs-on: ubuntu-latest
609-
environment:
610-
name: testpypi
611-
permissions:
612-
id-token: write
613-
steps:
614-
- uses: actions/download-artifact@v4
615-
with:
616-
name: dist
617-
path: dist
618-
- name: Push to TestPyPI
619-
uses: pypa/gh-action-pypi-publish@release/v1
620-
with:
621-
repository-url: https://test.pypi.org/legacy/

.github/workflows/docker.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ jobs:
8383
needs: docker_merge_vanilla
8484
uses: ./.github/workflows/docker_build.yml
8585
# Only build the 'firedrake' container for 'linux/amd64' because
86-
# VTK (https://gitlab.kitware.com/vtk/vtk/-/issues/18772) and
87-
# netgen-mesher do not have ARM wheels so many Firedrake apps cannot
86+
# netgen-mesher does not have ARM wheels so many Firedrake apps cannot
8887
# be installed.
8988
with:
9089
os: Linux
@@ -102,4 +101,4 @@ jobs:
102101
target: firedrake
103102
tag: ${{ inputs.tag }}
104103
tag_latest: ${{ ! inputs.build_dev }}
105-
secrets: inherit
104+
secrets: inherit

.github/workflows/docker_build.yml

Lines changed: 66 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,73 @@ on:
4646
required: true
4747

4848
jobs:
49-
docker_build:
50-
name: "Build the ${{ inputs.target }} container"
51-
strategy:
52-
fail-fast: false
53-
runs-on: [self-hosted, "${{ inputs.os }}"]
49+
docker_build_linux:
50+
name: Build the ${{ inputs.target }} container (Linux)
51+
if: inputs.os == 'Linux'
52+
runs-on: [self-hosted, Linux]
53+
container: ubuntu:latest
5454
steps:
5555
- name: Pre-cleanup
5656
if: always()
57+
run: find . -delete
58+
59+
- name: Set up Docker
5760
run: |
58-
rm -rf ${{ runner.temp }}/digests
61+
apt-get update
62+
apt-get -y install docker.io
63+
64+
- name: Check out the repo
65+
uses: actions/checkout@v5
66+
67+
- name: Log in to Docker Hub
68+
uses: docker/login-action@v3
69+
with:
70+
username: ${{ secrets.DOCKERHUB_USER }}
71+
password: ${{ secrets.DOCKERHUB_TOKEN }}
72+
73+
- name: Set up Docker Buildx
74+
uses: docker/setup-buildx-action@v3
75+
76+
- name: Build and push ${{ inputs.target }}
77+
id: build
78+
uses: docker/build-push-action@v6
79+
with:
80+
platforms: ${{ inputs.platform }}
81+
file: ${{ inputs.dockerfile }}
82+
build-args: |
83+
ARCH=${{ inputs.arch }}
84+
BRANCH=${{ inputs.branch }}
85+
outputs: type=image,name=firedrakeproject/${{ inputs.target }},push-by-digest=true,name-canonical=true,push=true
86+
87+
- name: Export digest
88+
run: |
89+
: # Create a file in './digests' with name matching the pushed image hash
90+
mkdir digests
91+
digest="${{ steps.build.outputs.imageid }}"
92+
touch "digests/${digest#sha256:}"
93+
94+
- name: Upload digest
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: digests_${{ inputs.target }}_${{ inputs.os }}
98+
path: digests/*
99+
if-no-files-found: error
100+
retention-days: 1
101+
102+
- name: Post-cleanup
103+
if: always()
104+
run: find . -delete
105+
106+
docker_build_macos:
107+
name: Build the ${{ inputs.target }} container (macOS)
108+
if: inputs.os == 'macOS'
109+
runs-on: [self-hosted, macOS]
110+
steps:
111+
- name: Pre-cleanup
112+
if: always()
113+
run: find . -delete
59114

60115
- name: Add homebrew to PATH
61-
if: inputs.os == 'macOS'
62116
run: |
63117
: # https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#adding-a-system-path
64118
echo "/opt/homebrew/bin" >> "$GITHUB_PATH"
@@ -88,21 +142,19 @@ jobs:
88142

89143
- name: Export digest
90144
run: |
91-
: # Create a file in <tempdir>/digests with name matching the pushed image hash
92-
rm -rf ${{ runner.temp }}/digests
93-
mkdir -p ${{ runner.temp }}/digests
145+
: # Create a file in digests with name matching the pushed image hash
146+
mkdir digests
94147
digest="${{ steps.build.outputs.imageid }}"
95-
touch "${{ runner.temp }}/digests/${digest#sha256:}"
148+
touch "digests/${digest#sha256:}"
96149
97150
- name: Upload digest
98151
uses: actions/upload-artifact@v4
99152
with:
100153
name: digests_${{ inputs.target }}_${{ inputs.os }}
101-
path: ${{ runner.temp }}/digests/*
154+
path: digests/*
102155
if-no-files-found: error
103156
retention-days: 1
104157

105158
- name: Post-cleanup
106159
if: always()
107-
run: |
108-
rm -rf ${{ runner.temp }}/digests
160+
run: find . -delete

0 commit comments

Comments
 (0)