Skip to content

Commit

Permalink
add arm64 linux build (#1019)
Browse files Browse the repository at this point in the history
* add arm64 linux builders
* fix docker mainnet config, update on tag build
* update release to include linux arm64 artifacts
  • Loading branch information
jgreat authored Nov 18, 2024
1 parent 05e6739 commit 1231e69
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 46 deletions.
2 changes: 2 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ self-hosted-runner:
# Labels of self-hosted runner in array of string
labels:
- mco-dev-large-x64
- mco-dev-large-arm64
- mco-dev-small-x64
- mco-dev-small-arm64
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
name: Build and Publish Docker
description: Build docker containers
name: Publish Docker
description: Gather digests and publish Docker images

inputs:
network:
description: "main|test"
required: true
version:
description: "version of the build"
required: true
cache_buster:
description: "cache buster"
required: true
Expand All @@ -27,7 +24,7 @@ runs:
# Set the MobileCoin network details for "batteries included" builds.
if [[ "${{ inputs.network }}" == "main" ]]
then
MC_PEER=mc://node1.prod.mobilecoinww.com/,mc://node2.prod.mobilecoinww.co
MC_PEER=mc://node1.prod.mobilecoinww.com/,mc://node2.prod.mobilecoinww.com/
MC_TX_SOURCE_URL=https://ledger.mobilecoinww.com/node1.prod.mobilecoinww.com/,https://ledger.mobilecoinww.com/node2.prod.mobilecoinww.com
else
MC_PEER=mc://node1.test.mobilecoin.com/,mc://node2.test.mobilecoin.com/
Expand Down Expand Up @@ -61,14 +58,13 @@ runs:
with:
dockerfile: .internal-ci/docker/Dockerfile.full-service
images: mobilecoin/full-service
save_digest: true
outputs: type=image,name=mobilecoin/full-service,push-by-digest=true,name-canonical=true,push=true
build_args: |
RUST_BIN_PATH=${{ env.RUST_BIN_PATH }}
MC_CHAIN_ID=${{ inputs.network }}
MC_PEER=${{ env.MC_PEER }}
MC_TX_SOURCE_URL=${{ env.MC_TX_SOURCE_URL }}
flavor: |
latest=false
tags: |
${{ inputs.version }}-${{ inputs.network }}net
password: ${{ inputs.docker_password }}
username: ${{ inputs.docker_username }}
digest_artifact_prefix: digests-${{ inputs.network }}net
32 changes: 32 additions & 0 deletions .github/actions/publish-docker/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build Docker
description: Build all the docker containers

inputs:
network:
description: "main|test"
required: true
version:
description: "version of the build"
required: true
docker_username:
description: "Docker repo username"
required: true
docker_password:
description: "Docker repo password"
required: true


# need artifacts to have testnet/mainnet designators
runs:
using: composite
steps:
- name: Merge and Tag Digests
uses: mobilecoinofficial/gh-actions/docker-merge-digests@v0
with:
images: mobilecoin/full-service
flavor: latest=false
tags: |
${{ inputs.version }}-${{ inputs.network }}net
username: ${{ inputs.docker_username }}
password: ${{ inputs.docker_password }}
digest_artifact_prefix: digests-${{ inputs.network }}net
59 changes: 31 additions & 28 deletions .github/workflows/on-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# CBB List:
# - Lint Shell
# - CodeCov
# - Integration tests

name: on-pr
Expand Down Expand Up @@ -64,7 +63,7 @@ jobs:
lint-rust:
runs-on: mco-dev-large-x64
container:
image: mobilecoin/rust-sgx-base:v0.0.36
image: mobilecoin/rust-base:v0.0.37
env:
SGX_MODE: SW
steps:
Expand Down Expand Up @@ -122,7 +121,7 @@ jobs:
test-rust:
runs-on: mco-dev-large-x64
container:
image: mobilecoin/rust-sgx-base:v0.0.36
image: mobilecoin/rust-base:v0.0.37
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
Expand Down Expand Up @@ -157,9 +156,6 @@ jobs:
env:
SGX_MODE: SW
CARGO_BACKTRACE: "1"
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
run: |
cargo test
Expand All @@ -168,35 +164,20 @@ jobs:
shell: bash
run: touch .dummy/success

# skip coverage for now, old actions-rs/grcov is deprecated
# need to learn how to generate .xml reports for codecov below
# - name: grcov
# shell: bash
# run: |
# cargo install grcov

# - name: Codecov
# uses: codecov/codecov-action@v3.1.4
# with:
# files: ${{ steps.coverage.outputs.report }}
# verbose: true
# fail_ci_if_error: true
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

build-rust-linux:
needs:
- meta
strategy:
matrix:
runner:
- mco-dev-large-x64
- mco-dev-large-arm64
network:
- main
- test
runs-on: ${{ matrix.runner }}
container:
image: mobilecoin/rust-sgx-base:v0.0.36
image: mobilecoin/rust-base:v0.0.37
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
Expand Down Expand Up @@ -238,14 +219,15 @@ jobs:
version: ${{ needs.meta.outputs.version }}
cache_buster: ${{ vars.CACHE_BUSTER }}

build-publish-containers:
build-containers:
needs:
- meta
- build-rust-linux
strategy:
matrix:
runner:
- mco-dev-small-x64
- mco-dev-small-arm64
network:
- main
- test
Expand All @@ -254,19 +236,40 @@ jobs:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Build and Publish Docker
uses: ./.github/actions/build-publish-docker
- name: Build Docker
uses: ./.github/actions/build-docker
with:
network: ${{ matrix.network }}
version: ${{ needs.meta.outputs.version }}
cache_buster: ${{ vars.CACHE_BUSTER }}
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}

publish-containers:
needs:
- meta
- build-containers
strategy:
matrix:
network:
- main
- test
runs-on: mco-dev-small-x64
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Merge Digests and Push Tag
uses: ./.github/actions/publish-docker
with:
network: ${{ matrix.network }}
version: ${{ needs.meta.outputs.version }}
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}

build-publish-charts:
needs:
- meta
- build-publish-containers
- publish-containers
strategy:
matrix:
network:
Expand Down
42 changes: 34 additions & 8 deletions .github/workflows/on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ jobs:
matrix:
runner:
- mco-dev-large-x64
- mco-dev-large-arm64
network:
- main
- test
runs-on: ${{ matrix.runner }}
container:
image: mobilecoin/rust-sgx-base:v0.0.36
image: mobilecoin/rust-base:v0.0.37
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0
Expand Down Expand Up @@ -60,13 +61,14 @@ jobs:
version: ${{ github.ref_name }}
cache_buster: ${{ vars.CACHE_BUSTER }}

build-publish-containers:
build-containers:
needs:
- build-rust-linux
strategy:
matrix:
runner:
- mco-dev-small-x64
- mco-dev-small-arm64
network:
- main
- test
Expand All @@ -75,18 +77,38 @@ jobs:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Build and Publish Docker
uses: ./.github/actions/build-publish-docker
- name: Build Docker
uses: ./.github/actions/build-docker
with:
network: ${{ matrix.network }}
version: ${{ github.ref_name }}
cache_buster: ${{ vars.CACHE_BUSTER }}
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}

publish-containers:
needs:
- build-containers
strategy:
matrix:
network:
- main
- test
runs-on: mco-dev-small-x64
steps:
- name: Checkout
uses: mobilecoinofficial/gh-actions/checkout@v0

- name: Merge Digests and Push Tag
uses: ./.github/actions/publish-docker
with:
network: ${{ matrix.network }}
version: ${{ github.ref_name }}
docker_username: ${{ secrets.DOCKERHUB_USERNAME }}
docker_password: ${{ secrets.DOCKERHUB_TOKEN }}

build-publish-charts:
needs:
- build-publish-containers
- publish-containers
strategy:
matrix:
network:
Expand Down Expand Up @@ -136,21 +158,23 @@ jobs:
### TestNet
#### Binaries
- [Linux ARM64 TestNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-testnet-Linux-ARM64-${{ github.ref_name }}.tar.gz)
- [Linux X64 TestNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-testnet-Linux-X64-${{ github.ref_name }}.tar.gz)
- [MacOS ARM64 TestNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-testnet-macOS-ARM64-${{ github.ref_name }}.tar.gz)
- [MacOS X64 TestNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-testnet-macOS-X64-${{ github.ref_name }}.tar.gz)
#### Docker Images
#### Docker Images (amd64, arm64)
- [Docker Image TestNet](https://hub.docker.com/r/mobilecoin/full-service/tags?name=${{ github.ref_name }}-testnet)
### MainNet
#### Binaries
- [Linux ARM64 MainNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-mainnet-Linux-ARM64-${{ github.ref_name }}.tar.gz)
- [Linux X64 MainNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-mainnet-Linux-X64-${{ github.ref_name }}.tar.gz)
- [MacOS ARM64 MainNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-mainnet-macOS-ARM64-${{ github.ref_name }}.tar.gz)
- [MacOS X64 MainNet](https://github.com/mobilecoinofficial/full-service/releases/download/${{ github.ref_name }}/full-service-mainnet-macOS-X64-${{ github.ref_name }}.tar.gz)
#### Docker Images
#### Docker Images (amd64, arm64)
- [Docker Image MainNet](https://hub.docker.com/r/mobilecoin/full-service/tags?name=${{ github.ref_name }}-mainnet)
# Running full-service
Expand Down Expand Up @@ -212,9 +236,11 @@ jobs:
draft: true
fail_on_unmatched_files: true
files: |
build_artifacts/full-service-mainnet-Linux-X64-${{ github.ref_name }}/full-service-mainnet-Linux-ARM64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-mainnet-Linux-X64-${{ github.ref_name }}/full-service-mainnet-Linux-X64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-mainnet-macOS-ARM64-${{ github.ref_name }}/full-service-mainnet-macOS-ARM64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-mainnet-macOS-X64-${{ github.ref_name }}/full-service-mainnet-macOS-X64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-testnet-Linux-X64-${{ github.ref_name }}/full-service-testnet-Linux-ARM64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-testnet-Linux-X64-${{ github.ref_name }}/full-service-testnet-Linux-X64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-testnet-macOS-ARM64-${{ github.ref_name }}/full-service-testnet-macOS-ARM64-${{ github.ref_name }}.tar.gz
build_artifacts/full-service-testnet-macOS-X64-${{ github.ref_name }}/full-service-testnet-macOS-X64-${{ github.ref_name }}.tar.gz

0 comments on commit 1231e69

Please sign in to comment.