From 3c1953b81a933596787abdb412e35a36305349d1 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:13:51 +0200 Subject: [PATCH 01/12] ci: set up matrix to build on `Ubuntu 22.04 x64` and `Ubuntu 22.04 ARM` --- .github/workflows/ci.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b2c17e93df..9e695e11fe6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,12 @@ concurrency: cancel-in-progress: true jobs: - build-ubuntu-X64: - runs-on: ubuntu-22.04 + build-ubuntu: + strategy: + fail-fast: false + matrix: + os: [ubuntu-22.04, ubuntu-22.04-arm] + runs-on: ${{ matrix.os }} outputs: eras: ${{ steps.eras-test-lab.outputs.eras }} steps: @@ -32,6 +36,7 @@ jobs: # We separate the build in 2 steps as we want to avoid side effects with Rust feature unification. - name: Cargo build - Tooling + if: matrix.os == 'ubuntu-22.04' shell: bash run: cargo build --release --bin mithril-end-to-end --bin load-aggregator --features bundle_tls @@ -57,6 +62,7 @@ jobs: if-no-files-found: error - name: Publish End-to-end runner (${{ runner.os }}-${{ runner.arch }}) + if: matrix.os == 'ubuntu-22.04' uses: actions/upload-artifact@v4 with: name: mithril-tooling-${{ runner.os }}-${{ runner.arch }} @@ -66,6 +72,7 @@ jobs: if-no-files-found: error - name: Prepare test lab eras + if: matrix.os == 'ubuntu-22.04' id: eras-test-lab run: | ERAS=$(./target/release/mithril-aggregator era list --json) @@ -326,12 +333,12 @@ jobs: e2e: runs-on: ubuntu-24.04 - needs: [build-ubuntu-X64] + needs: [build-ubuntu] strategy: fail-fast: false matrix: mode: ["std"] - era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }} + era: ${{ fromJSON(needs.build-ubuntu.outputs.eras) }} next_era: [""] cardano_node_version: ["10.3.1", "10.4.1"] hard_fork_latest_era_at_epoch: [0] @@ -341,7 +348,7 @@ jobs: include: # Include a test for partial decentralization with leader/follower signer registration and P2P signature registration - mode: "leader-follower" - era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }} + era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }} next_era: [""] cardano_node_version: "10.3.1" hard_fork_latest_era_at_epoch: 0 @@ -349,7 +356,7 @@ jobs: extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=passthrough --relay-signature-registration-mode=p2p" # Include a test for full dedentralization P2P signer registration and P2P signature registration - mode: "decentralized" - era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }} + era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }} next_era: "" cardano_node_version: "10.3.1" hard_fork_latest_era_at_epoch: 0 @@ -357,16 +364,16 @@ jobs: extra_args: "--number-of-aggregators=2 --use-relays --relay-signer-registration-mode=p2p --relay-signature-registration-mode=p2p" # Include a test for the era switch without regenesis - mode: "std" - era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }} - next_era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[1] }} + era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }} + next_era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[1] }} cardano_node_version: "10.3.1" hard_fork_latest_era_at_epoch: 0 run_id: "#1" extra_args: "" # Include a test for the era switch with regenesis - mode: "std" - era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[0] }} - next_era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras)[1] }} + era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[0] }} + next_era: ${{ fromJSON(needs.build-ubuntu.outputs.eras)[1] }} cardano_node_version: "10.3.1" hard_fork_latest_era_at_epoch: 0 run_id: "#1" From 47ae56f370f2330bb5dbb6486a692a4b045f2ca2 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:14:14 +0200 Subject: [PATCH 02/12] ci: include `Ubuntu 24.04 ARM` in test matrix --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e695e11fe6..26106240eed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -180,11 +180,13 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, macos-14, windows-latest] + os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-latest] include: - os: ubuntu-24.04 test-args: --features full,unstable,future_dmq --workspace + - os: ubuntu-24.04-arm + test-args: --features full,unstable,future_dmq --workspace # Exclude nodes not officially supported on Windows and macOS (only mithril-client is supported) - os: macos-14 test-args: > From b06092f7ed3724ba547407bd53b5bb57942ea382 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Mon, 30 Jun 2025 19:14:26 +0200 Subject: [PATCH 03/12] ci: add `Download built artifacts` step for `Ubuntu 22.04 ARM` in `unstable-release` and `create-pre-release` jobs --- .github/workflows/ci.yml | 12 ++++++++++++ .github/workflows/pre-release.yml | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 26106240eed..d005896f30c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -637,6 +637,18 @@ jobs: name: mithril-deb-packages-Linux-X64 path: ./package + - name: Download built artifacts (Linux-ARM64) + uses: actions/download-artifact@v4 + with: + name: mithril-distribution-Linux-ARM64 + path: ./package-Linux-ARM64 + + - name: Download Debian packages (Linux-ARM64) + uses: actions/download-artifact@v4 + with: + name: mithril-deb-packages-Linux-ARM64 + path: ./package + - name: Download built artifacts (macOS-ARM64) uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index c72ffcb19fa..acb2f3abd99 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -36,6 +36,24 @@ jobs: workflow: ci.yml workflow_conclusion: success + - name: Download built artifacts (Linux-ARM64) + uses: dawidd6/action-download-artifact@v6 + with: + name: mithril-distribution-Linux-ARM64 + path: ./package-Linux-ARM64 + commit: ${{ github.sha }} + workflow: ci.yml + workflow_conclusion: success + + - name: Download Debian packages (Linux-ARM64) + uses: dawidd6/action-download-artifact@v6 + with: + name: mithril-deb-packages-Linux-ARM64 + path: ./package + commit: ${{ github.sha }} + workflow: ci.yml + workflow_conclusion: success + - name: Download built artifacts (macOS-ARM64) uses: dawidd6/action-download-artifact@v6 with: From 46a953b8349697492769273efccf6b90d677a666 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:55:01 +0200 Subject: [PATCH 04/12] ci: update `prepare-distribution` action to add a platform support table in the release note --- .../actions/prepare-distribution/action.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions/prepare-distribution/action.yml b/.github/workflows/actions/prepare-distribution/action.yml index fbc41734cb2..082dbadc00f 100644 --- a/.github/workflows/actions/prepare-distribution/action.yml +++ b/.github/workflows/actions/prepare-distribution/action.yml @@ -84,12 +84,24 @@ runs: | jq -r 'keys_unsorted[] as $network | "| \($network) | \(.[$network]) |"' \ >> ./release-notes-addon.txt - - name: Add minimum supported libc version + - name: Add platform support table shell: bash run: | cat >> ./release-notes-addon.txt << EOF - ## Linux Requirements + ## Platform Support + + Summary of the platforms for which pre-built binaries are provided. + + | Binary | Linux x64 | Linux arm64 | macOS arm64 | Windows x64 | + | ------------------ | :-------: | :---------: | :---------: | :---------: | + | mithril-aggregator | ✔ | ✔ ⁽\*⁾ | ⛔ | ⛔ | + | mithril-signer | ✔ | ✔ ⁽\*⁾ | ⛔ | ⛔ | + | mithril-client | ✔ | ✔ ⁽\*⁾ | ✔ | ✔ | + + ⁽\*⁾⚠️ Linux arm64 builds are not guaranteed, use at your own risk. + + ### Linux Requirements The Linux binaries target \`glibc\`: to run them or install the \`.deb\` packages you must have \`glibc\` version \`2.35+\` installed. Compatible systems include, but are not limited to, \`Ubuntu 22.04+\` or \`Debian 12+\` (Bookworm)). EOF From 7911cb5e308134737af07d2413a9a7a72e808e65 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Tue, 1 Jul 2025 18:46:27 +0200 Subject: [PATCH 05/12] ci: enable multi-arch Docker images with ARM64 support via QEMU The `docker-mithril` job builds and pushes multi-platform Docker images (`linux/amd64`, `linux/arm64`) using Docker Buildx and QEMU for emulation. Each binary is injected per architecture using `$TARGETARCH` at build time. Disable `provenance` to avoid "unknown/unknown" issue: Known behavior, provenance generation triggers a multi-platform image index, which causes the image to appear as "unknown/unknown". Disabling it ensures that only a single manifest is generated. --- .github/workflows/ci.yml | 20 +++++++++++++++++--- .github/workflows/pre-release.yml | 19 ++++++++++++++++++- .github/workflows/release.yml | 19 ++++++++++++++++++- mithril-aggregator/Dockerfile.ci | 9 ++++++--- mithril-client-cli/Dockerfile.ci | 7 +++++-- mithril-relay/Dockerfile.ci | 7 +++++-- mithril-signer/Dockerfile.ci | 9 ++++++--- 7 files changed, 75 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d005896f30c..caf85d2ff4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -503,6 +503,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -519,11 +525,17 @@ jobs: unstable type=raw,value=${{ github.base_ref || github.ref_name }}-{{sha}} - - name: Download built artifacts + - name: Download built artifacts (Linux-X64) uses: actions/download-artifact@v4 with: - name: mithril-distribution-${{ runner.os }}-${{ runner.arch }} - path: ${{ matrix.project }} + name: mithril-distribution-Linux-X64 + path: ${{ matrix.project }}/bin-linux-amd64 + + - name: Download built artifacts (Linux-ARM64) + uses: actions/download-artifact@v4 + with: + name: mithril-distribution-Linux-ARM64 + path: ${{ matrix.project }}/bin-linux-arm64 - name: Build and push Docker image uses: docker/build-push-action@v6 @@ -532,6 +544,8 @@ jobs: file: ${{ env.DOCKER_FILE }} push: ${{ env.PUSH_PACKAGES }} tags: ${{ steps.meta.outputs.tags }} + platforms: linux/amd64,linux/arm64 + provenance: false publish-crate-test: strategy: diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index acb2f3abd99..3152c609a44 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -130,6 +130,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -150,7 +156,16 @@ jobs: uses: dawidd6/action-download-artifact@v6 with: name: mithril-distribution-Linux-X64 - path: ${{ matrix.project }} + path: ${{ matrix.project }}/bin-linux-amd64 + commit: ${{ github.sha }} + workflow: ci.yml + workflow_conclusion: success + + - name: Download built artifacts (Linux-arm64) + uses: dawidd6/action-download-artifact@v6 + with: + name: mithril-distribution-Linux-ARM64 + path: ${{ matrix.project }}/bin-linux-arm64 commit: ${{ github.sha }} workflow: ci.yml workflow_conclusion: success @@ -162,6 +177,8 @@ jobs: file: ${{ env.DOCKER_FILE }} push: true tags: ${{ steps.meta.outputs.tags }} + platforms: linux/amd64,linux/arm64 + provenance: false deploy-pre-release: strategy: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7d60cf4680b..6efaccea184 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,12 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to the Container registry uses: docker/login-action@v3 with: @@ -51,7 +57,16 @@ jobs: uses: dawidd6/action-download-artifact@v6 with: name: mithril-distribution-Linux-X64 - path: ${{ matrix.project }} + path: ${{ matrix.project }}/bin-linux-amd64 + commit: ${{ github.sha }} + workflow: ci.yml + workflow_conclusion: success + + - name: Download built artifacts (Linux-arm64) + uses: dawidd6/action-download-artifact@v6 + with: + name: mithril-distribution-Linux-ARM64 + path: ${{ matrix.project }}/bin-linux-arm64 commit: ${{ github.sha }} workflow: ci.yml workflow_conclusion: success @@ -63,6 +78,8 @@ jobs: file: ${{ env.DOCKER_FILE }} push: true tags: ${{ steps.meta.outputs.tags }} + platforms: linux/amd64,linux/arm64 + provenance: false deploy-release: strategy: diff --git a/mithril-aggregator/Dockerfile.ci b/mithril-aggregator/Dockerfile.ci index 2ddb88ef649..a067cb37a55 100644 --- a/mithril-aggregator/Dockerfile.ci +++ b/mithril-aggregator/Dockerfile.ci @@ -1,9 +1,12 @@ # Creates a docker image to run an executable built outside of the image # This relies on the fact the mithril-aggregator executable has been built -# on a debian-compatible x86-64 environment +# on a debian-compatible environment ARG DOCKER_IMAGE_FROM=debian:12-slim FROM $DOCKER_IMAGE_FROM +# Build-time platform architecture +ARG TARGETARCH + # Create appuser RUN adduser --no-create-home --disabled-password appuser @@ -17,7 +20,7 @@ RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && a ARG CARDANO_NODE_VERSION=10.4.1 ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz ARG EMBED-CARDANO-CLI=0 -RUN if [ "$EMBED-CARDANO-CLI" = 1 ] ; then \ +RUN if [ "$EMBED-CARDANO-CLI" = 1 ] && [ "$TARGETARCH" = "amd64" ] ; then \ wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \ && mkdir -p /app/bin \ && (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin) \ @@ -27,7 +30,7 @@ RUN if [ "$EMBED-CARDANO-CLI" = 1 ] ; then \ fi # Copy the executable -COPY mithril-aggregator/mithril-aggregator /app/bin/mithril-aggregator +COPY mithril-aggregator/bin-linux-$TARGETARCH/mithril-aggregator /app/bin/mithril-aggregator # Copy the config files COPY mithril-aggregator/config /app/config diff --git a/mithril-client-cli/Dockerfile.ci b/mithril-client-cli/Dockerfile.ci index 2b4023fc0bd..d7872b8baf8 100644 --- a/mithril-client-cli/Dockerfile.ci +++ b/mithril-client-cli/Dockerfile.ci @@ -1,9 +1,12 @@ # Creates a docker image to run an executable built outside of the image # This relies on the fact the mithril-client executable has been built -# on a debian-compatible x86-64 environment +# on a debian-compatible environment ARG DOCKER_IMAGE_FROM=debian:12-slim FROM $DOCKER_IMAGE_FROM +# Build-time platform architecture +ARG TARGETARCH + # Create appuser RUN adduser --disabled-password appuser @@ -14,7 +17,7 @@ RUN mkdir -p /app/bin RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/* # Copy the executable -COPY mithril-client-cli/mithril-client /app/bin/mithril-client +COPY mithril-client-cli/bin-linux-$TARGETARCH/mithril-client /app/bin/mithril-client # Copy the config files COPY mithril-client-cli/config /app/config diff --git a/mithril-relay/Dockerfile.ci b/mithril-relay/Dockerfile.ci index e82ec9e5283..ce11236f5bb 100644 --- a/mithril-relay/Dockerfile.ci +++ b/mithril-relay/Dockerfile.ci @@ -1,9 +1,12 @@ # Creates a docker image to run an executable built outside of the image # This relies on the fact the mithril-relay executable has been built -# on a debian-compatible x86-64 environment +# on a debian-compatible environment ARG DOCKER_IMAGE_FROM=debian:12-slim FROM $DOCKER_IMAGE_FROM +# Build-time platform architecture +ARG TARGETARCH + # Create appuser RUN adduser --no-create-home --disabled-password appuser @@ -14,7 +17,7 @@ RUN mkdir -p /app/bin RUN apt-get update -y && apt-get install -y libssl-dev ca-certificates wget && apt-get clean && rm -rf /var/lib/apt/lists/* # Copy the executable -COPY mithril-relay/mithril-relay /app/bin/mithril-relay +COPY mithril-relay/bin-linux-$TARGETARCH/mithril-relay /app/bin/mithril-relay # Copy the config files COPY mithril-relay/config /app/config diff --git a/mithril-signer/Dockerfile.ci b/mithril-signer/Dockerfile.ci index 860d84e3161..15c8823641c 100644 --- a/mithril-signer/Dockerfile.ci +++ b/mithril-signer/Dockerfile.ci @@ -1,9 +1,12 @@ # Creates a docker image to run an executable built outside of the image # This relies on the fact the mithril-signer executable has been built -# on a debian-compatible x86-64 environment +# on a debian-compatible environment ARG DOCKER_IMAGE_FROM=debian:12-slim FROM $DOCKER_IMAGE_FROM +# Build-time platform architecture +ARG TARGETARCH + # Create appuser RUN adduser --no-create-home --disabled-password appuser @@ -18,7 +21,7 @@ ARG CARDANO_NODE_VERSION=10.4.1 ARG CARDANO_BIN_URL=https://github.com/input-output-hk/cardano-node/releases/download/$CARDANO_NODE_VERSION/cardano-node-$CARDANO_NODE_VERSION-linux.tar.gz ARG EMBED-CARDANO-CLI=0 # Install cardano-cli -RUN if [ "$EMBED-CARDANO-CLI" = 1 ] ; then \ +RUN if [ "$EMBED-CARDANO-CLI" = 1 ] && [ "$TARGETARCH" = "amd64" ] ; then \ wget -nv -O cardano-bin.tar.gz $CARDANO_BIN_URL \ && mkdir -p /app/bin \ && (tar xzf cardano-bin.tar.gz ./bin/cardano-cli && mv /bin/cardano-cli /app/bin) || (tar xzf cardano-bin.tar.gz ./cardano-cli && mv cardano-cli /app/bin) \ @@ -28,7 +31,7 @@ RUN if [ "$EMBED-CARDANO-CLI" = 1 ] ; then \ fi # Copy the executable -COPY mithril-signer/mithril-signer /app/bin/mithril-signer +COPY mithril-signer/bin-linux-$TARGETARCH/mithril-signer /app/bin/mithril-signer # Copy the config files COPY mithril-signer/config /app/config From 303bad92a69d55519f94e4cca1929c4db2cdc16d Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Tue, 1 Jul 2025 20:49:35 +0200 Subject: [PATCH 06/12] ci: update Test Docker images build workflow with multi platform images support --- .../workflows/test-docker-distribution.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-docker-distribution.yml b/.github/workflows/test-docker-distribution.yml index 2215344b0c4..e1d45b39f26 100644 --- a/.github/workflows/test-docker-distribution.yml +++ b/.github/workflows/test-docker-distribution.yml @@ -73,11 +73,26 @@ jobs: run: | git checkout ${{ inputs.commit_sha }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Download built artifacts (Linux-x64) uses: dawidd6/action-download-artifact@v6 with: name: mithril-distribution-Linux-X64 - path: ${{ matrix.project }} + path: ${{ matrix.project }}/bin-linux-amd64 + commit: ${{ inputs.commit_sha }} + workflow: ci.yml + workflow_conclusion: completed + + - name: Download built artifacts (Linux-arm64) + uses: dawidd6/action-download-artifact@v6 + with: + name: mithril-distribution-Linux-ARM64 + path: ${{ matrix.project }}/bin-linux-arm64 commit: ${{ inputs.commit_sha }} workflow: ci.yml workflow_conclusion: completed @@ -108,3 +123,5 @@ jobs: CARDANO_BIN_URL=${{ inputs.cardano_bin_url }} push: ${{ inputs.dry_run == false }} tags: ${{ steps.meta.outputs.tags }} + platforms: linux/amd64,linux/arm64 + provenance: false From 0bb4924a0cda892a5f713a941b13d88675342483 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Tue, 1 Jul 2025 15:25:36 +0200 Subject: [PATCH 07/12] ci: include `Ubuntu 24.04 ARM` in `test-binaries` matrix of the `Mithril Client multi-platform test` workflow --- .github/workflows/test-client.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-client.yml b/.github/workflows/test-client.yml index 8b8ab9a70f7..c178d9c5e6c 100644 --- a/.github/workflows/test-client.yml +++ b/.github/workflows/test-client.yml @@ -76,7 +76,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-24.04, macos-14, windows-latest] + os: [ubuntu-24.04, ubuntu-24.04-arm, macos-14, windows-latest] extra_args: ["", "--include-ancillary"] runs-on: ${{ matrix.os }} @@ -163,12 +163,13 @@ jobs: 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 - name: Cardano Database Snapshot / verify Cardano node starts successfully - if: runner.os == 'Linux' + if: matrix.os == 'ubuntu-24.04' shell: bash run: .github/workflows/scripts/verify-cardano-db-restoration.sh ./bin/cdb-download-output.txt "${{ matrix.extra_args }}" + # The 'snapshot-converter' binary is not currently supported on Linux ARM64 platforms. - name: Ledger state snapshot conversion from InMemory to LMDB - if: matrix.extra_args == '--include-ancillary' + if: matrix.os != 'ubuntu-24.04-arm' && matrix.extra_args == '--include-ancillary' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} shell: bash @@ -268,7 +269,7 @@ jobs: 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 - name: Cardano Database V2 Snapshot / verify Cardano node starts successfully - if: runner.os == 'Linux' && steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true' + if: matrix.os == 'ubuntu-24.04' && steps.aggregator_capability_unix.outputs.cardano_database_v2_enabled == 'true' shell: bash run: .github/workflows/scripts/verify-cardano-db-restoration.sh ./bin/cdb-v2-download-output.txt "${{ matrix.extra_args }}" From 0514392b13eb428e78a63ef9074d86526cb33f20 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Wed, 2 Jul 2025 14:53:03 +0200 Subject: [PATCH 08/12] feat(cli): prevent snapshot converter execution and hide post-download commands on Linux ARM --- .../src/commands/cardano_db/shared_steps.rs | 63 ++++++++++--------- mithril-client-cli/src/commands/tools/mod.rs | 10 ++- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/mithril-client-cli/src/commands/cardano_db/shared_steps.rs b/mithril-client-cli/src/commands/cardano_db/shared_steps.rs index 7361fd27a10..554df3f8aa7 100644 --- a/mithril-client-cli/src/commands/cardano_db/shared_steps.rs +++ b/mithril-client-cli/src/commands/cardano_db/shared_steps.rs @@ -134,6 +134,10 @@ pub fn log_download_information( json_output: bool, include_ancillary: bool, ) -> MithrilResult<()> { + fn is_linux_arm() -> bool { + cfg!(target_os = "linux") && cfg!(target_arch = "aarch64") + } + let canonical_filepath = &db_dir .canonicalize() .with_context(|| format!("Could not get canonical filepath of '{}'", db_dir.display()))?; @@ -155,21 +159,21 @@ pub fn log_download_information( }; if json_output { - let json = if include_ancillary { - serde_json::json!({ - "timestamp": Utc::now().to_rfc3339(), - "db_directory": canonical_filepath, - "run_docker_cmd": docker_cmd, - "snapshot_converter_cmd_to_lmdb": snapshot_converter_cmd("LMDB"), - "snapshot_converter_cmd_to_legacy": snapshot_converter_cmd("Legacy") - }) - } else { - serde_json::json!({ - "timestamp": Utc::now().to_rfc3339(), - "db_directory": canonical_filepath, - "run_docker_cmd": docker_cmd - }) - }; + let mut json = serde_json::json!({ + "timestamp": Utc::now().to_rfc3339(), + "db_directory": canonical_filepath, + }); + + if !is_linux_arm() { + json["run_docker_cmd"] = serde_json::Value::String(docker_cmd); + + if include_ancillary { + json["snapshot_converter_cmd_to_lmdb"] = + serde_json::Value::String(snapshot_converter_cmd("LMDB")); + json["snapshot_converter_cmd_to_legacy"] = + serde_json::Value::String(snapshot_converter_cmd("Legacy")); + } + } println!("{json}"); } else { @@ -177,31 +181,34 @@ pub fn log_download_information( r###"Cardano database snapshot '{}' archives have been successfully unpacked. Immutable files have been successfully verified with Mithril. Files in the directory '{}' can be used to run a Cardano node with version >= {cardano_node_version}. - - If you are using Cardano Docker image, you can restore a Cardano Node with: - - {} - "###, snapshot_hash, - db_dir.display(), - docker_cmd + db_dir.display() ); - if include_ancillary { + if !is_linux_arm() { println!( - r###"Upgrade and replace the restored ledger state snapshot to 'LMDB' flavor by running the command: + r###"If you are using the Cardano Docker image, you can restore a Cardano node with: + + {docker_cmd} + + "### + ); + + if include_ancillary { + println!( + r###"Upgrade and replace the restored ledger state snapshot to 'LMDB' flavor by running the command: {} Or to 'Legacy' flavor by running the command: {} - "###, - snapshot_converter_cmd("LMDB"), - snapshot_converter_cmd("Legacy"), - ); + snapshot_converter_cmd("LMDB"), + snapshot_converter_cmd("Legacy"), + ); + } } } diff --git a/mithril-client-cli/src/commands/tools/mod.rs b/mithril-client-cli/src/commands/tools/mod.rs index cc2651b52e4..1c151f29881 100644 --- a/mithril-client-cli/src/commands/tools/mod.rs +++ b/mithril-client-cli/src/commands/tools/mod.rs @@ -7,6 +7,7 @@ mod snapshot_converter; pub use snapshot_converter::*; +use anyhow::anyhow; use clap::Subcommand; use mithril_client::MithrilResult; @@ -40,7 +41,14 @@ impl UTxOHDCommands { /// Execute UTxO-HD command pub async fn execute(&self) -> MithrilResult<()> { match self { - Self::SnapshotConverter(cmd) => cmd.execute().await, + Self::SnapshotConverter(cmd) => { + if cfg!(target_os = "linux") && cfg!(target_arch = "aarch64") { + return Err(anyhow!( + "'snapshot-converter' command is not supported on Linux ARM" + )); + } + cmd.execute().await + } } } } From 0ff851cf5d85e9f2123db5ecb31202cb385b5ec3 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:58:19 +0200 Subject: [PATCH 09/12] fix: add missing Linux-ARM64 step in `prepare-distribution` action --- .../workflows/actions/prepare-distribution/action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/actions/prepare-distribution/action.yml b/.github/workflows/actions/prepare-distribution/action.yml index 082dbadc00f..31733f5226b 100644 --- a/.github/workflows/actions/prepare-distribution/action.yml +++ b/.github/workflows/actions/prepare-distribution/action.yml @@ -29,6 +29,15 @@ runs: --version "${{ inputs.version-name }}" \ --target "linux-x64" + - name: Package distribution (Linux-ARM64) + shell: bash + run: | + python3 ./.github/workflows/scripts/package-distribution.py \ + --input package-Linux-ARM64/ \ + --dest package/ \ + --version "${{ inputs.version-name }}" \ + --target "linux-arm64" + - name: Package distribution (macOS-ARM64) shell: bash run: | From e4e8edccccd868daf83fd392b6a84d0c742ea989 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:01:28 +0200 Subject: [PATCH 10/12] docs: add warning about snapshot converter incompatibility with Linux ARM --- docs/website/root/manual/develop/nodes/mithril-client.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/website/root/manual/develop/nodes/mithril-client.md b/docs/website/root/manual/develop/nodes/mithril-client.md index 3fb2cb81538..d7a0efa86cd 100644 --- a/docs/website/root/manual/develop/nodes/mithril-client.md +++ b/docs/website/root/manual/develop/nodes/mithril-client.md @@ -637,6 +637,12 @@ Here is a list of the available parameters: `tools utxo-hd snapshot-converter` command: +:::warning + +This command is not compatible with **Linux ARM environments**. + +::: + | Parameter | Command line (long) | Command line (short) | Environment variable | Description | Default value | Example | Mandatory | | ---------------------- | ------------------------ | :------------------: | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | -------- | :----------------: | | `db_directory` | `--db-directory` | - | - | Path to the Cardano node database directory | - | - | :heavy_check_mark: | From bd57424fc63cfc27405b50f65ccae0b94bdfd474 Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:35:03 +0200 Subject: [PATCH 11/12] docs: update `CHANGELOG` --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f10c6d9d8e..788cd5ebdf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ As a minor extension, we have adopted a slightly different versioning convention - Upgrade the Rust edition of the repository from 2021 to 2024 +- Add pre-built Linux ARM binaries in the distribution for the signer, client CLI, and aggregator. + - **UNSTABLE** : - Support for DMQ signature publisher in the signer and signature consumer in the aggregator. From 8ec1c796830b9ffd0401f8caadd411196517d78e Mon Sep 17 00:00:00 2001 From: Damien Lachaume <135982616+dlachaume@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:36:44 +0200 Subject: [PATCH 12/12] chore: upgrade crate versions * mithril-client-cli from `0.12.18` to `0.12.19` --- Cargo.lock | 2 +- mithril-client-cli/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab6f9321c98..8b6748b8af1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4108,7 +4108,7 @@ dependencies = [ [[package]] name = "mithril-client-cli" -version = "0.12.18" +version = "0.12.19" dependencies = [ "anyhow", "async-trait", diff --git a/mithril-client-cli/Cargo.toml b/mithril-client-cli/Cargo.toml index f5cc0452a85..1a2f95c0376 100644 --- a/mithril-client-cli/Cargo.toml +++ b/mithril-client-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-client-cli" -version = "0.12.18" +version = "0.12.19" description = "A Mithril Client" authors = { workspace = true } edition = { workspace = true }