Skip to content

Commit 1d99b68

Browse files
authored
Fix #56: Use arm runner
* Rename CI files * Try using Arm runners * Temp rm attest and provenance I think these are RedHat specific only? @podhrmic says: `attests` is related to building an [SBOM](https://docs.docker.com/build/metadata/attestations/sbom/). We don't need it quite yet, so it is OK to remove (worth speeding up the build). The changes look good, I am in favor of merging. There is a condition that if the `build-and-release` job passes, but `combine-multiplatform` fails, then the *existing* image manifest will be corrupted, as the hashes will be incorrect. I recommend merging as is (well, once the failed tests are fixed), and if we see these failures happening we can address it.
1 parent 9027174 commit 1d99b68

File tree

6 files changed

+44
-46
lines changed

6 files changed

+44
-46
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CN Benchmarks
1+
name: Benchmarks
22

33
on:
44
push:

.github/workflows/docker.yml

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: docker
1+
name: Docker
22

33
on:
44
# Run this action every day
@@ -21,15 +21,22 @@ concurrency:
2121
group: docker-${{ github.workflow }}-${{ github.ref }}
2222
cancel-in-progress: false
2323

24-
# Instructions from https://depot.dev/blog/multi-platform-docker-images-in-github-actions
2524
jobs:
26-
docker-release-ubuntu:
27-
runs-on: ubuntu-latest
25+
build-and-release:
26+
27+
strategy:
28+
matrix:
29+
os: [ubuntu, redhat]
30+
runner: [latest, 24.04-arm]
31+
32+
runs-on: ubuntu-${{ matrix.runner }}
33+
2834
permissions:
2935
packages: write
3036
contents: read
3137
attestations: write
3238
id-token: write
39+
3340
steps:
3441
- uses: actions/checkout@v4
3542

@@ -40,28 +47,25 @@ jobs:
4047
username: ${{ github.actor }}
4148
password: ${{ secrets.GITHUB_TOKEN }}
4249

43-
- name: Set up QEMU
44-
uses: docker/setup-qemu-action@v3.4.0
45-
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@v3
47-
48-
- name: Build multi-platform image
50+
- name: Build ${{ matrix.os }}-${{ matrix.runner }} image
4951
uses: docker/build-push-action@v5
5052
with:
5153
context: .
52-
platforms: linux/amd64,linux/arm64
5354
push: ${{ github.event_name != 'pull_request' }}
54-
tags: ${{env.CN_IMAGE_ID}}:release
55-
file: Dockerfile.ubuntu
55+
tags: ${{ env.CN_IMAGE_ID }}:release-${{ matrix.os }}-${{ matrix.runner }}
56+
file: Dockerfile.${{ matrix.os }}
5657
github-token: ${{ secrets.GITHUB_TOKEN }}
5758

58-
docker-release-redhat:
59+
combine-multiplatform:
60+
61+
if: ${{ github.event_name != 'pull_request' }}
62+
63+
strategy:
64+
matrix:
65+
os: [ubuntu, redhat]
5966
runs-on: ubuntu-latest
60-
permissions:
61-
packages: write
62-
contents: read
63-
attestations: write
64-
id-token: write
67+
needs: [build-and-release]
68+
6569
steps:
6670
- uses: actions/checkout@v4
6771

@@ -72,35 +76,29 @@ jobs:
7276
username: ${{ github.actor }}
7377
password: ${{ secrets.GITHUB_TOKEN }}
7478

75-
- name: Set up QEMU
76-
uses: docker/setup-qemu-action@v3.4.0
77-
- name: Set up Docker Buildx
78-
uses: docker/setup-buildx-action@v3
79-
80-
- name: Build multi-platform image
81-
uses: docker/build-push-action@v5
82-
with:
83-
context: .
84-
platforms: linux/amd64,linux/arm64
85-
push: ${{ github.event_name != 'pull_request' }}
86-
tags: ${{env.CN_IMAGE_ID}}:release-redhat
87-
file: Dockerfile.redhat
88-
attests: type=sbom
89-
provenance: mode=max
90-
github-token: ${{ secrets.GITHUB_TOKEN }}
79+
- name: Create ${{ matrix.os }} manifest and push
80+
run: |
81+
docker manifest create \
82+
${{ env.CN_IMAGE_ID }}:release-${{ matrix.os }} \
83+
--amend ${{ env.CN_IMAGE_ID }}:release-${{ matrix.os }}-latest \
84+
--amend ${{ env.CN_IMAGE_ID }}:release-${{ matrix.os }}-24.04-arm
85+
docker manifest push ${{ env.CN_IMAGE_ID }}:release-${{ matrix.os }}
9186
9287
# Other CI is testing anyway - if need be, can run tests in Dockerfile itself
9388
test-docker-images:
94-
runs-on: ubuntu-latest
89+
9590
if: ${{ github.event_name != 'pull_request' }}
96-
needs: [docker-release-redhat, docker-release-ubuntu]
91+
9792
strategy:
9893
matrix:
99-
tag: [release, release-redhat]
94+
os: [ubuntu, redhat]
95+
runs-on: ubuntu-latest
96+
needs: [combine-multiplatform]
97+
10098
steps:
10199
- uses: actions/checkout@v4
102100

103-
- name: Run CN CI tests
101+
- name: Run CI tests
104102
run: |
105-
docker pull ${{env.CN_IMAGE_ID}}:${{ matrix.tag }}
106-
docker run -v $PWD:/work -w /work ${{env.CN_IMAGE_ID}}:${{ matrix.tag }} bash tests/run-cn.sh
103+
docker pull ${{env.CN_IMAGE_ID}}:release-${{ matrix.os }}
104+
docker run -v $PWD:/work -w /work ${{env.CN_IMAGE_ID}}:release-${{ matrix.os }} bash tests/run-cn.sh
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Installs CN (without Coq) and runs tests
2-
name: CN Proof
2+
name: Proof
33

44
on:
55
pull_request:
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Builds CN with Coq and runs Coq tests
2-
name: CN-Coq
1+
# Builds CN with Rocq and runs its tests
2+
name: Rocq
33

44
on:
55
pull_request:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CN Spec Testing
1+
name: Spec Testing
22

33
on:
44
pull_request:

0 commit comments

Comments
 (0)