Skip to content

Commit a6d5487

Browse files
authored
Merge pull request #2628 from input-output-hk/dlachaume/2178/build-linux-arm-in-ci
ci: add Linux arm64 support
2 parents 5f041dd + 8ec1c79 commit a6d5487

File tree

16 files changed

+225
-64
lines changed

16 files changed

+225
-64
lines changed

.github/workflows/actions/prepare-distribution/action.yml

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ runs:
2929
--version "${{ inputs.version-name }}" \
3030
--target "linux-x64"
3131
32+
- name: Package distribution (Linux-ARM64)
33+
shell: bash
34+
run: |
35+
python3 ./.github/workflows/scripts/package-distribution.py \
36+
--input package-Linux-ARM64/ \
37+
--dest package/ \
38+
--version "${{ inputs.version-name }}" \
39+
--target "linux-arm64"
40+
3241
- name: Package distribution (macOS-ARM64)
3342
shell: bash
3443
run: |
@@ -84,12 +93,24 @@ runs:
8493
| jq -r 'keys_unsorted[] as $network | "| \($network) | \(.[$network]) |"' \
8594
>> ./release-notes-addon.txt
8695
87-
- name: Add minimum supported libc version
96+
- name: Add platform support table
8897
shell: bash
8998
run: |
9099
cat >> ./release-notes-addon.txt << EOF
91100
92-
## Linux Requirements
101+
## Platform Support
102+
103+
Summary of the platforms for which pre-built binaries are provided.
104+
105+
| Binary | Linux x64 | Linux arm64 | macOS arm64 | Windows x64 |
106+
| ------------------ | :-------: | :---------: | :---------: | :---------: |
107+
| mithril-aggregator | ✔ | ✔ ⁽\*⁾ | ⛔ | ⛔ |
108+
| mithril-signer | ✔ | ✔ ⁽\*⁾ | ⛔ | ⛔ |
109+
| mithril-client | ✔ | ✔ ⁽\*⁾ | ✔ | ✔ |
110+
111+
⁽\*⁾⚠️ Linux arm64 builds are not guaranteed, use at your own risk.
112+
113+
### Linux Requirements
93114
The Linux binaries target \`glibc\`: to run them or install the \`.deb\` packages you must have \`glibc\` version \`2.35+\` installed.
94115
Compatible systems include, but are not limited to, \`Ubuntu 22.04+\` or \`Debian 12+\` (Bookworm)).
95116
EOF

.github/workflows/ci.yml

Lines changed: 49 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ concurrency:
1515
cancel-in-progress: true
1616

1717
jobs:
18-
build-ubuntu-X64:
19-
runs-on: ubuntu-22.04
18+
build-ubuntu:
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-22.04, ubuntu-22.04-arm]
23+
runs-on: ${{ matrix.os }}
2024
outputs:
2125
eras: ${{ steps.eras-test-lab.outputs.eras }}
2226
steps:
@@ -32,6 +36,7 @@ jobs:
3236

3337
# We separate the build in 2 steps as we want to avoid side effects with Rust feature unification.
3438
- name: Cargo build - Tooling
39+
if: matrix.os == 'ubuntu-22.04'
3540
shell: bash
3641
run: cargo build --release --bin mithril-end-to-end --bin load-aggregator --features bundle_tls
3742

@@ -57,6 +62,7 @@ jobs:
5762
if-no-files-found: error
5863

5964
- name: Publish End-to-end runner (${{ runner.os }}-${{ runner.arch }})
65+
if: matrix.os == 'ubuntu-22.04'
6066
uses: actions/upload-artifact@v4
6167
with:
6268
name: mithril-tooling-${{ runner.os }}-${{ runner.arch }}
@@ -66,6 +72,7 @@ jobs:
6672
if-no-files-found: error
6773

6874
- name: Prepare test lab eras
75+
if: matrix.os == 'ubuntu-22.04'
6976
id: eras-test-lab
7077
run: |
7178
ERAS=$(./target/release/mithril-aggregator era list --json)
@@ -173,11 +180,13 @@ jobs:
173180
strategy:
174181
fail-fast: false
175182
matrix:
176-
os: [ubuntu-24.04, macos-14, windows-latest]
183+
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-latest]
177184

178185
include:
179186
- os: ubuntu-24.04
180187
test-args: --features full,unstable,future_dmq --workspace
188+
- os: ubuntu-24.04-arm
189+
test-args: --features full,unstable,future_dmq --workspace
181190
# Exclude nodes not officially supported on Windows and macOS (only mithril-client is supported)
182191
- os: macos-14
183192
test-args: >
@@ -326,12 +335,12 @@ jobs:
326335

327336
e2e:
328337
runs-on: ubuntu-24.04
329-
needs: [build-ubuntu-X64]
338+
needs: [build-ubuntu]
330339
strategy:
331340
fail-fast: false
332341
matrix:
333342
mode: ["std"]
334-
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }}
343+
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras) }}
335344
next_era: [""]
336345
cardano_node_version: ["10.3.1", "10.4.1"]
337346
hard_fork_latest_era_at_epoch: [0]
@@ -341,32 +350,32 @@ jobs:
341350
include:
342351
# Include a test for partial decentralization with leader/follower signer registration and P2P signature registration
343352
- mode: "leader-follower"
344-
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }}
353+
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
345354
next_era: [""]
346355
cardano_node_version: "10.3.1"
347356
hard_fork_latest_era_at_epoch: 0
348357
run_id: "#1"
349358
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=passthrough --relay-signature-registration-mode=p2p"
350359
# Include a test for full dedentralization P2P signer registration and P2P signature registration
351360
- mode: "decentralized"
352-
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }}
361+
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
353362
next_era: ""
354363
cardano_node_version: "10.3.1"
355364
hard_fork_latest_era_at_epoch: 0
356365
run_id: "#1"
357366
extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=p2p --relay-signature-registration-mode=p2p"
358367
# Include a test for the era switch without regenesis
359368
- mode: "std"
360-
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }}
361-
next_era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[1] }}
369+
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
370+
next_era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[1] }}
362371
cardano_node_version: "10.3.1"
363372
hard_fork_latest_era_at_epoch: 0
364373
run_id: "#1"
365374
extra_args: ""
366375
# Include a test for the era switch with regenesis
367376
- mode: "std"
368-
era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }}
369-
next_era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[1] }}
377+
era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }}
378+
next_era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[1] }}
370379
cardano_node_version: "10.3.1"
371380
hard_fork_latest_era_at_epoch: 0
372381
run_id: "#1"
@@ -494,6 +503,12 @@ jobs:
494503
- name: Checkout
495504
uses: actions/checkout@v4
496505

506+
- name: Set up QEMU
507+
uses: docker/setup-qemu-action@v3
508+
509+
- name: Set up Docker Buildx
510+
uses: docker/setup-buildx-action@v3
511+
497512
- name: Log in to the Container registry
498513
uses: docker/login-action@v3
499514
with:
@@ -510,11 +525,17 @@ jobs:
510525
unstable
511526
type=raw,value=${{ github.base_ref || github.ref_name }}-{{sha}}
512527
513-
- name: Download built artifacts
528+
- name: Download built artifacts (Linux-X64)
514529
uses: actions/download-artifact@v4
515530
with:
516-
name: mithril-distribution-${{ runner.os }}-${{ runner.arch }}
517-
path: ${{ matrix.project }}
531+
name: mithril-distribution-Linux-X64
532+
path: ${{ matrix.project }}/bin-linux-amd64
533+
534+
- name: Download built artifacts (Linux-ARM64)
535+
uses: actions/download-artifact@v4
536+
with:
537+
name: mithril-distribution-Linux-ARM64
538+
path: ${{ matrix.project }}/bin-linux-arm64
518539

519540
- name: Build and push Docker image
520541
uses: docker/build-push-action@v6
@@ -523,6 +544,8 @@ jobs:
523544
file: ${{ env.DOCKER_FILE }}
524545
push: ${{ env.PUSH_PACKAGES }}
525546
tags: ${{ steps.meta.outputs.tags }}
547+
platforms: linux/amd64,linux/arm64
548+
provenance: false
526549

527550
publish-crate-test:
528551
strategy:
@@ -628,6 +651,18 @@ jobs:
628651
name: mithril-deb-packages-Linux-X64
629652
path: ./package
630653

654+
- name: Download built artifacts (Linux-ARM64)
655+
uses: actions/download-artifact@v4
656+
with:
657+
name: mithril-distribution-Linux-ARM64
658+
path: ./package-Linux-ARM64
659+
660+
- name: Download Debian packages (Linux-ARM64)
661+
uses: actions/download-artifact@v4
662+
with:
663+
name: mithril-deb-packages-Linux-ARM64
664+
path: ./package
665+
631666
- name: Download built artifacts (macOS-ARM64)
632667
uses: actions/download-artifact@v4
633668
with:

.github/workflows/pre-release.yml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ jobs:
3636
workflow: ci.yml
3737
workflow_conclusion: success
3838

39+
- name: Download built artifacts (Linux-ARM64)
40+
uses: dawidd6/action-download-artifact@v6
41+
with:
42+
name: mithril-distribution-Linux-ARM64
43+
path: ./package-Linux-ARM64
44+
commit: ${{ github.sha }}
45+
workflow: ci.yml
46+
workflow_conclusion: success
47+
48+
- name: Download Debian packages (Linux-ARM64)
49+
uses: dawidd6/action-download-artifact@v6
50+
with:
51+
name: mithril-deb-packages-Linux-ARM64
52+
path: ./package
53+
commit: ${{ github.sha }}
54+
workflow: ci.yml
55+
workflow_conclusion: success
56+
3957
- name: Download built artifacts (macOS-ARM64)
4058
uses: dawidd6/action-download-artifact@v6
4159
with:
@@ -112,6 +130,12 @@ jobs:
112130
- name: Checkout
113131
uses: actions/checkout@v4
114132

133+
- name: Set up QEMU
134+
uses: docker/setup-qemu-action@v3
135+
136+
- name: Set up Docker Buildx
137+
uses: docker/setup-buildx-action@v3
138+
115139
- name: Log in to the Container registry
116140
uses: docker/login-action@v3
117141
with:
@@ -132,7 +156,16 @@ jobs:
132156
uses: dawidd6/action-download-artifact@v6
133157
with:
134158
name: mithril-distribution-Linux-X64
135-
path: ${{ matrix.project }}
159+
path: ${{ matrix.project }}/bin-linux-amd64
160+
commit: ${{ github.sha }}
161+
workflow: ci.yml
162+
workflow_conclusion: success
163+
164+
- name: Download built artifacts (Linux-arm64)
165+
uses: dawidd6/action-download-artifact@v6
166+
with:
167+
name: mithril-distribution-Linux-ARM64
168+
path: ${{ matrix.project }}/bin-linux-arm64
136169
commit: ${{ github.sha }}
137170
workflow: ci.yml
138171
workflow_conclusion: success
@@ -144,6 +177,8 @@ jobs:
144177
file: ${{ env.DOCKER_FILE }}
145178
push: true
146179
tags: ${{ steps.meta.outputs.tags }}
180+
platforms: linux/amd64,linux/arm64
181+
provenance: false
147182

148183
deploy-pre-release:
149184
strategy:

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ jobs:
3131
- name: Checkout
3232
uses: actions/checkout@v4
3333

34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v3
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v3
39+
3440
- name: Log in to the Container registry
3541
uses: docker/login-action@v3
3642
with:
@@ -51,7 +57,16 @@ jobs:
5157
uses: dawidd6/action-download-artifact@v6
5258
with:
5359
name: mithril-distribution-Linux-X64
54-
path: ${{ matrix.project }}
60+
path: ${{ matrix.project }}/bin-linux-amd64
61+
commit: ${{ github.sha }}
62+
workflow: ci.yml
63+
workflow_conclusion: success
64+
65+
- name: Download built artifacts (Linux-arm64)
66+
uses: dawidd6/action-download-artifact@v6
67+
with:
68+
name: mithril-distribution-Linux-ARM64
69+
path: ${{ matrix.project }}/bin-linux-arm64
5570
commit: ${{ github.sha }}
5671
workflow: ci.yml
5772
workflow_conclusion: success
@@ -63,6 +78,8 @@ jobs:
6378
file: ${{ env.DOCKER_FILE }}
6479
push: true
6580
tags: ${{ steps.meta.outputs.tags }}
81+
platforms: linux/amd64,linux/arm64
82+
provenance: false
6683

6784
deploy-release:
6885
strategy:

.github/workflows/test-client.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
strategy:
7777
fail-fast: false
7878
matrix:
79-
os: [ubuntu-24.04, macos-14, windows-latest]
79+
os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-latest]
8080
extra_args: ["", "--include-ancillary"]
8181

8282
runs-on: ${{ matrix.os }}
@@ -163,12 +163,13 @@ jobs:
163163
run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} --origin-tag CI cardano-db download $CDB_SNAPSHOT_DIGEST --backend v1 --download-dir v1 ${{ matrix.extra_args }} 2>&1 | tee cdb-download-output.txt
164164

165165
- name: Cardano Database Snapshot / verify Cardano node starts successfully
166-
if: runner.os == 'Linux'
166+
if: matrix.os == 'ubuntu-24.04'
167167
shell: bash
168168
run: .github/workflows/scripts/verify-cardano-db-restoration.sh ./bin/cdb-download-output.txt "${{ matrix.extra_args }}"
169169

170+
# The 'snapshot-converter' binary is not currently supported on Linux ARM64 platforms.
170171
- name: Ledger state snapshot conversion from InMemory to LMDB
171-
if: matrix.extra_args == '--include-ancillary'
172+
if: matrix.os != 'ubuntu-24.04-arm' && matrix.extra_args == '--include-ancillary'
172173
env:
173174
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
174175
shell: bash
@@ -268,7 +269,7 @@ jobs:
268269
run: ./mithril-client ${{ steps.prepare.outputs.debug_level }} --origin-tag CI cardano-db verify --backend v2 --db-dir v2/db $CARDANO_DATABASE_V2_SNAPSHOT_HASH | tee cdb-v2-verify-output.txt
269270

270271
- name: Cardano Database V2 Snapshot / verify Cardano node starts successfully
271-
if: runner.os == 'Linux' && steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true'
272+
if: matrix.os == 'ubuntu-24.04' && steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true'
272273
shell: bash
273274
run: .github/workflows/scripts/verify-cardano-db-restoration.sh ./bin/cdb-v2-download-output.txt "${{ matrix.extra_args }}"
274275

.github/workflows/test-docker-distribution.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,26 @@ jobs:
7373
run: |
7474
git checkout ${{ inputs.commit_sha }}
7575
76+
- name: Set up QEMU
77+
uses: docker/setup-qemu-action@v3
78+
79+
- name: Set up Docker Buildx
80+
uses: docker/setup-buildx-action@v3
81+
7682
- name: Download built artifacts (Linux-x64)
7783
uses: dawidd6/action-download-artifact@v6
7884
with:
7985
name: mithril-distribution-Linux-X64
80-
path: ${{ matrix.project }}
86+
path: ${{ matrix.project }}/bin-linux-amd64
87+
commit: ${{ inputs.commit_sha }}
88+
workflow: ci.yml
89+
workflow_conclusion: completed
90+
91+
- name: Download built artifacts (Linux-arm64)
92+
uses: dawidd6/action-download-artifact@v6
93+
with:
94+
name: mithril-distribution-Linux-ARM64
95+
path: ${{ matrix.project }}/bin-linux-arm64
8196
commit: ${{ inputs.commit_sha }}
8297
workflow: ci.yml
8398
workflow_conclusion: completed
@@ -108,3 +123,5 @@ jobs:
108123
CARDANO_BIN_URL=${{ inputs.cardano_bin_url }}
109124
push: ${{ inputs.dry_run == false }}
110125
tags: ${{ steps.meta.outputs.tags }}
126+
platforms: linux/amd64,linux/arm64
127+
provenance: false

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ As a minor extension, we have adopted a slightly different versioning convention
2525

2626
- Upgrade the Rust edition of the repository from 2021 to 2024
2727

28+
- Add pre-built Linux ARM binaries in the distribution for the signer, client CLI, and aggregator.
29+
2830
- **UNSTABLE** :
2931
- Support for DMQ signature publisher in the signer and signature consumer in the aggregator.
3032

0 commit comments

Comments
 (0)