-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #45 from mobilecoinofficial/jgreat/arm64
Add arm64 builds
Showing
9 changed files
with
357 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,22 +4,14 @@ name: tag | |
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
|
||
jobs: | ||
tag: | ||
runs-on: mco-dev-small-x64 | ||
steps: | ||
# We need to use an external PAT here because GHA will not run downstream events if we use the built in token. | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: bump tag | ||
uses: mobilecoinofficial/gh-actions/tag@v0 | ||
with: | ||
token: ${{ secrets.ACTIONS_TOKEN }} | ||
|
||
- name: Bump GitHub tag | ||
id: bump | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} | ||
WITH_V: 'true' | ||
DEFAULT_BUMP: patch | ||
github_token: ${{ secrets.ACTIONS_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (c) 2022 to 2024 MobileCoin Inc. | ||
# hadolint global ignore=DL3008, DL3015, DL3007 | ||
|
||
# Fat builder image for building and local testing of MobileCoin services. | ||
|
||
# Set BASE_IMAGE the rust-base or rust-sgx image and Name/Tag the image | ||
# "FROM mobilecoin/rust-base:latest" as mobilecoin/rust-builder:latest | ||
# "FROM mobilecoin/rust-sgx:latest" as mobilecoin/rust-sgx-builder:latest | ||
|
||
ARG BASE_IMAGE=rust-base | ||
ARG BASE_IMAGE_TAG=latest | ||
FROM mobilecoin/${BASE_IMAGE}:${BASE_IMAGE_TAG} | ||
ARG TARGETARCH | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
nginx \ | ||
postgresql \ | ||
postgresql-client \ | ||
python3 \ | ||
python3-pip \ | ||
psmisc \ | ||
sudo \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
ARG GO_PKG="go1.22.2.linux-${TARGETARCH}.tar.gz" | ||
|
||
RUN curl -sSfL -o go.tgz "https://golang.org/dl/${GO_PKG}" \ | ||
&& tar -C /usr/local -xzf go.tgz \ | ||
&& rm -rf go.tgz | ||
|
||
ENV GOPATH=/opt/go/ | ||
ENV PATH="/usr/local/go/bin:${GOPATH}/bin:${PATH}" | ||
RUN mkdir -p "${GOPATH}" | ||
|
||
RUN curl -sSLf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash \ | ||
&& cargo binstall cargo-nextest@0.9.82 --no-confirm \ | ||
&& cargo binstall cbindgen@0.24.2 --no-confirm \ | ||
&& cargo binstall sccache@0.3.0 --no-confirm | ||
|
||
COPY entrypoint-builder-install.sh /usr/local/bin/entrypoint.sh | ||
|
||
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Copyright (c) 2022 to 2024 MobileCoin Inc. | ||
# hadolint global ignore=DL3008, DL3015 | ||
|
||
FROM ubuntu:focal-20241011 | ||
ARG TARGETARCH | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# Utilities: | ||
# build-essential, cmake, curl, git, jq | ||
# | ||
# Build Requirements: | ||
# libclang-dev, libprotobuf-dev, libpq-dev, libssl1.1, | ||
# libssl-dev, llvm, llvm-dev, pkg-config | ||
# | ||
# Needed for GHA cache actions: | ||
# zstd | ||
# | ||
# Needed for building ledger-mob and full service: | ||
# libdbus-1-dev | ||
# | ||
RUN ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \ | ||
&& apt-get update \ | ||
&& apt-get upgrade -y \ | ||
&& apt-get install -y \ | ||
build-essential \ | ||
clang \ | ||
cmake \ | ||
curl \ | ||
git \ | ||
jq \ | ||
libclang-dev \ | ||
libdbus-1-dev \ | ||
libhidapi-dev \ | ||
libprotobuf-dev \ | ||
libpq-dev \ | ||
libssl1.1 \ | ||
libssl-dev \ | ||
libudev-dev \ | ||
libusb-1.0-0-dev \ | ||
llvm \ | ||
llvm-dev \ | ||
pkg-config \ | ||
unzip \ | ||
wget \ | ||
zstd \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
# Install a newer version of the protobuf compiler, that's not available in apt | ||
COPY install_protoc.sh /tmp/install_protoc.sh | ||
RUN /tmp/install_protoc.sh \ | ||
&& rm /tmp/install_protoc.sh | ||
|
||
# Github actions overwrites the runtime home directory, so we need to install in a global directory. | ||
ENV RUSTUP_HOME=/opt/rustup | ||
ENV CARGO_HOME=/opt/cargo | ||
RUN mkdir -p "${RUSTUP_HOME}" \ | ||
&& mkdir -p "${CARGO_HOME}/bin" | ||
|
||
# Install rustup | ||
RUN curl -sSLf https://sh.rustup.rs | \ | ||
sh -s -- -y --default-toolchain nightly-2023-10-01 | ||
|
||
ENV PATH=/opt/cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2022 to 2024 MobileCoin Inc. | ||
# hadolint global ignore=DL3008, DL3015, DL3007 | ||
|
||
# Rust with SGX libraries | ||
# Note: only works for x86_64/amd64 and is intended to be built immediately after the rust-base image. | ||
ARG BASE_IMAGE_TAG=latest | ||
FROM mobilecoin/rust-base:${BASE_IMAGE_TAG} | ||
|
||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# Install SGX SDK | ||
ARG SGX_URL=https://download.01.org/intel-sgx/sgx-linux/2.23/distro/ubuntu20.04-server/sgx_linux_x64_sdk_2.23.100.2.bin | ||
RUN curl -sSfL -o sgx.bin "${SGX_URL}" \ | ||
&& chmod +x ./sgx.bin \ | ||
&& ./sgx.bin --prefix=/opt/intel \ | ||
&& rm ./sgx.bin | ||
|
||
# Install DCAP libraries | ||
ARG DCAP_VERSION=1.20.100.2-focal1 | ||
RUN mkdir -p /etc/apt/keyrings \ | ||
&& curl -sSfL https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | gpg --dearmor -o /etc/apt/keyrings/intel-sgx.gpg \ | ||
&& echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/intel-sgx.gpg] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main" | tee /etc/apt/sources.list.d/intel-sgx.list \ | ||
&& apt-get update \ | ||
&& apt-get install -y \ | ||
libsgx-dcap-ql=${DCAP_VERSION} \ | ||
libsgx-dcap-ql-dev=${DCAP_VERSION} \ | ||
libsgx-dcap-quote-verify=${DCAP_VERSION} \ | ||
libsgx-dcap-quote-verify-dev=${DCAP_VERSION} \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
ENV SGX_SDK=/opt/intel/sgxsdk | ||
ENV PATH=${PATH}:/opt/intel/sgxsdk/bin:/opt/intel/sgxsdk/bin/x64 | ||
ENV PKG_CONFIG_PATH=/opt/intel/sgxsdk/pkgconfig | ||
ENV LD_LIBRARY_PATH=/opt/intel/sgxsdk/sdk_libs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -e -o pipefail | ||
|
||
case ${TARGETARCH:?} in | ||
amd64) | ||
PROTOC=protoc-25.2-linux-x86_64.zip | ||
;; | ||
arm64) | ||
PROTOC=protoc-25.2-linux-aarch_64.zip | ||
;; | ||
*) | ||
echo "Unsupported architecture: ${TARGETARCH}" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
curl -sSL -o protoc.zip "https://github.com/protocolbuffers/protobuf/releases/download/v25.2/${PROTOC}" | ||
unzip protoc.zip -d protoc | ||
cp protoc/bin/protoc /usr/bin/protoc | ||
cp -r protoc/include/google /usr/include/google | ||
rm -rf protoc protoc.zip |