Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an action to quickly update stable image tag #2901

Merged
merged 12 commits into from
Nov 21, 2023
34 changes: 17 additions & 17 deletions .github/workflows/docker-update-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ name: Docker update stable tag
# Links/updates stable docker tags to specified version.
# This should be used after building a specific tagged image e.g. `:v0.7.2`.
#
# dolfinx/dolfinx:stable
# dolfinx/lab:stable
# dolfinx/dev-env:stable
# dolfinx/dolfinx:stable
# dolfinx/lab:stable
# dolfinx/dev-env:stable
# dolfinx/dolfinx-onbuild:stable

on:
workflow_dispatch:
inputs:
tag:
description: "link stable to tag"
description: "link :stable to :tag"
type: string
required: true

Expand All @@ -30,29 +30,29 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install regclient
- name: Install regctl
run: |
wget -O regctl https://github.com/regclient/regclient/releases/download/v0.5.4/regctl-linux-amd64
chmod +x regctl
wget -O ./regctl https://github.com/regclient/regclient/releases/download/v0.5.4/regctl-linux-amd64
chmod +x ./regctl

- name: Link supplied tag to stable on docker.io
run: |
regctl image copy dolfinx/dolfinx:${{ github.event.input.tag }} dolfinx/dolfinx:stable
regctl image copy dolfinx/lab:${{ github.event.input.tag }} dolfinx/lab:stable
regctl image copy dolfinx/dev-env:${{ github.event.input.tag }} dolfinx/dev-env:stable
regctl image copy dolfinx/dolfinx-onbuild:${{ github.event.input.tag }} dolfinx/dolfinx-onbuild:stable
./regctl image copy dolfinx/dolfinx:${{ inputs.tag }} dolfinx/dolfinx:stable
./regctl image copy dolfinx/dev-env:${{ inputs.tag }} dolfinx/dev-env:stable
./regctl image copy dolfinx/lab:${{ inputs.tag }} dolfinx/lab:stable
./regctl image copy dolfinx/dolfinx-onbuild:${{ inputs.tag }} dolfinx/dolfinx-onbuild:stable

- name: Link supplied tag to stable on ghcr.io
run: |
regctl image copy ghcr.io/fenics/dolfinx/dolfinx:${{ github.event.input.tag }} ghcr.io/fenics/dolfinx/dolfinx:stable
regctl image copy ghcr.io/fenics/dolfinx/lab:${{ github.event.input.tag }} ghcr.io/fenics/dolfinx/lab:stable
regctl image copy ghcr.io/fenics/dolfinx/dev-env:${{ github.event.input.tag }} ghcr.io/fenics/dolfinx/dev-env:stable
regctl image copy ghcr.io/dolfinx/dolfinx-onbuild:${{ github.event.input.tag }} ghcr.io/fenics/dolfinx/dolfinx-onbuild:stable
./regctl image copy ghcr.io/fenics/dolfinx/dolfinx:${{ inputs.tag }} ghcr.io/fenics/dolfinx/dolfinx:stable
./regctl image copy ghcr.io/fenics/dolfinx/dev-env:${{ inputs.tag }} ghcr.io/fenics/dolfinx/dev-env:stable
./regctl image copy ghcr.io/fenics/dolfinx/lab:${{ inputs.tag }} ghcr.io/fenics/dolfinx/lab:stable
./regctl image copy ghcr.io/fenics/dolfinx/dolfinx-onbuild:${{ inputs.tag }} ghcr.io/fenics/dolfinx/dolfinx-onbuild:stable
32 changes: 15 additions & 17 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ UFL still runs on the year-based release scheme.

1. Merge `main` into `release` resolving all conflicts in favour of `main`.

git pull
git checkout release
git merge --no-commit main
git checkout --theirs main .
Expand All @@ -47,12 +48,13 @@ UFL still runs on the year-based release scheme.

4. Commit and push.

5. Check `git diff main` for obvious errors.
5. Check `git diff origin/main` for obvious errors.

### UFL version bump

1. Merge `main` into `release` resolving all conflicts in favour of `main`.

git pull
git checkout release
git merge --no-commit main
git checkout --theirs main .
Expand All @@ -62,12 +64,13 @@ UFL still runs on the year-based release scheme.

3. Commit and push.

4. Check `git diff main` for obvious errors.
4. Check `git diff origin/main` for obvious errors.

### FFCx version bump

1. Merge `main` into `release` resolving all conflicts in favour of `main`.

git pull
git checkout release
git merge --no-commit main
git checkout --theirs main .
Expand All @@ -85,16 +88,17 @@ UFL still runs on the year-based release scheme.

6. Commit and push.

7. Check `git diff main` for obvious errors.
7. Check `git diff origin/main` for obvious errors.

### DOLFINx

1. Merge `main` into `release` resolving all conflicts in favour of `main`.

git pull
git checkout release
git merge --no-commit main
git checkout --theirs main .
git diff main
git diff origin/main

2. In `cpp/CMakeLists.txt` change the version number near the top of the file,
e.g. `0.5.0`.
Expand All @@ -109,7 +113,7 @@ UFL still runs on the year-based release scheme.

5. Commit and push.

6. Check `git diff main` for obvious errors.
6. Check `git diff origin/main` for obvious errors.

## Integration testing

Expand All @@ -133,7 +137,7 @@ Full stack: https://github.com/FEniCS/dolfinx/actions/workflows/ccpp.yml

## Tagging

Make appropriate version tags in each repository. UFL does not use the v prefix.
Make appropriate version tags in each repository. UFL does not use the `v` prefix.

git tag v0.5.0
git push --tags origin
Expand All @@ -156,15 +160,8 @@ Tagged Docker images will be pushed to Dockerhub.

docker run -ti dolfinx/dolfinx:v0.5.0

Do *not* update the `stable` tag using `docker pull` and `docker push`. Instead,
install the `regclient` utility https://github.com/regclient/regclient using the
provided binaries. `regclient` can properly handle copying multi-architecture images.

regctl registry login docker.io
regctl image copy dolfinx/dolfinx:<tag> dolfinx/dolfinx:stable
regctl image copy dolfinx/lab:<tag> dolfinx/lab:stable
regctl image copy dolfinx/dev-env:<tag> dolfinx/dev-env:stable
regctl image copy dolfinx/dolfinx-onbuild:<tag> dolfinx/dolfinx-onbuild:stable
Use the *Docker update stable* tag workflow to update/link `:stable` to e.g.
`v0.5.0`.

### pypa

Expand All @@ -191,8 +188,9 @@ Aside from version numbering changes, it is easier to merge changes onto `main`
and then cherry-pick or merge back onto `release`.

If a mistake is noticed soon after making a tag then you can delete the tag and
recreate it. After GitHub releases or pypa packages are pushed you must create .post0 tags
or make minor version bumps.
recreate it. It is also possible to recreate GitHub releases. After pypa
packages are pushed you must create .post0 tags or make minor version bumps, as
pypa is immutable.

### GitHub releases

Expand Down
Loading