-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into doc-readme
- Loading branch information
Showing
45 changed files
with
2,546 additions
and
593 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
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
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,59 @@ | ||
--- | ||
name: Docker | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
paths-ignore: | ||
- "docs/**" | ||
push: | ||
paths-ignore: | ||
- "docs/**" | ||
branches: | ||
- master | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [alpine, debian] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@master | ||
with: | ||
platforms: amd64 | ||
|
||
- name: Set up Docker Build | ||
uses: docker/[email protected] | ||
|
||
# ARM build takes very long time, so we build PRs for AMD64 only | ||
- name: Select target platform | ||
id: select_platforms | ||
run: | | ||
if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] ; then | ||
echo "build_platforms=linux/amd64" >> $GITHUB_ENV | ||
else | ||
echo "build_platforms=linux/amd64,linux/arm64" >> $GITHUB_ENV | ||
fi | ||
- name: Build Docker sample image | ||
id: docker_build | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
file: ./Dockerfile-${{ matrix.os }} | ||
build-args: | | ||
REVISION=${{ github.ref }} | ||
platforms: ${{ env.build_platforms }} | ||
push: false | ||
cache-from: | | ||
type=gha | ||
cache-to: | | ||
type=gha,mode=max | ||
- name: Show Docker image digest | ||
run: echo ${{ steps.docker_build.outputs.digest }} |
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
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
Empty file.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[workspace] | ||
|
||
resolver = "2" | ||
members = ["abci", "proto-compiler", "proto"] |
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,56 @@ | ||
# This is an example Dockerfile, demonstrating build process of rs-tenderdash-abci | ||
|
||
# rust:alpine3.17, published Mar 24, 2023 at 2:55 am | ||
FROM rust:alpine3.17 | ||
|
||
RUN apk add --no-cache \ | ||
git \ | ||
wget \ | ||
alpine-sdk \ | ||
openssl-dev \ | ||
libc6-compat \ | ||
perl \ | ||
unzip \ | ||
bash | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# one of: aarch_64, x86_64 | ||
# ARG PROTOC_ARCH=x86_64 | ||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
|
||
# Install protoc - protobuf compiler | ||
# The one shipped with Alpine does not work | ||
RUN if [[ "$BUILDPLATFORM" == "linux/arm64" ]] ; then export PROTOC_ARCH=aarch_64; else export PROTOC_ARCH=x86_64 ; fi; \ | ||
wget -q -O /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-${PROTOC_ARCH}.zip && \ | ||
unzip -qd /opt/protoc /tmp/protoc.zip && \ | ||
rm /tmp/protoc.zip && \ | ||
ln -s /opt/protoc/bin/protoc /usr/bin/ | ||
|
||
# Create a dummy package | ||
RUN cargo init /usr/src/abci-app | ||
WORKDIR /usr/src/abci-app | ||
|
||
# Let's display ABCI version instead of "hello world" | ||
RUN sed -i'' -e 's/println!("Hello, world!");/println!("ABCI version: {}",tenderdash_abci::proto::ABCI_VERSION);/' src/main.rs | ||
|
||
# revspec or SHA of commit/branch/tag to use | ||
ARG REVISION="refs/heads/master" | ||
|
||
# Add tenderdash-abci as a dependency and build the package | ||
# | ||
# Some notes here: | ||
# 1. All these --mount... are to cache reusable info between runs. | ||
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci | ||
# 2. We add `--config net.git-fetch-with-cli=true` to address ARM build issue, | ||
# see https://github.com/rust-lang/cargo/issues/10781#issuecomment-1441071052 | ||
# 3. To preserve space on github cache, we call `cargo clean`. | ||
RUN --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ | ||
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ | ||
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ | ||
cargo add --config net.git-fetch-with-cli=true \ | ||
--git https://github.com/dashpay/rs-tenderdash-abci --rev "${REVISION}" tenderdash-abci && \ | ||
cargo build --config net.git-fetch-with-cli=true && \ | ||
cargo run --config net.git-fetch-with-cli=true && \ | ||
cargo clean |
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,47 @@ | ||
# This is an example Dockerfile, demonstrating build process of rs-tenderdash-abci | ||
|
||
# We use Debian base image, as Alpine has some segmentation fault issue | ||
FROM rust:bullseye | ||
|
||
RUN --mount=type=cache,sharing=locked,target=/var/lib/apt/lists \ | ||
--mount=type=cache,sharing=locked,target=/var/cache/apt \ | ||
rm -f /etc/apt/apt.conf.d/docker-clean && \ | ||
apt-get update -qq && \ | ||
apt-get install -qq --yes \ | ||
git \ | ||
wget \ | ||
bash | ||
|
||
# Install protoc - protobuf compiler | ||
# The one shipped with Alpine does not work | ||
RUN if [[ "$BUILDPLATFORM" == "linux/arm64" ]] ; then export PROTOC_ARCH=aarch_64; else export PROTOC_ARCH=x86_64 ; fi; \ | ||
wget -q -O /tmp/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v25.2/protoc-25.2-linux-${PROTOC_ARCH}.zip && \ | ||
unzip -qd /opt/protoc /tmp/protoc.zip && \ | ||
rm /tmp/protoc.zip && \ | ||
ln -s /opt/protoc/bin/protoc /usr/bin/ | ||
|
||
# Create a dummy package | ||
RUN cargo init /usr/src/abci-app | ||
WORKDIR /usr/src/abci-app | ||
|
||
|
||
# revspec or SHA of commit/branch/tag to use | ||
ARG REVISION="refs/heads/master" | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Add tenderdash-abci as a dependency and build the package | ||
# | ||
# Some notes here: | ||
# 1. All these --mount... are to cache reusable info between runs. | ||
# See https://doc.rust-lang.org/cargo/guide/cargo-home.html#caching-the-cargo-home-in-ci | ||
# 2. We add `--config net.git-fetch-with-cli=true` to address ARM build issue, | ||
# see https://github.com/rust-lang/cargo/issues/10781#issuecomment-1441071052 | ||
# 3. To preserve space on github cache, we call `cargo clean`. | ||
RUN --mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \ | ||
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/cache \ | ||
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/git/db \ | ||
cargo add --config net.git-fetch-with-cli=true \ | ||
--git https://github.com/dashpay/rs-tenderdash-abci --rev "${REVISION}" tenderdash-abci && \ | ||
cargo build --config net.git-fetch-with-cli=true && \ | ||
cargo clean |
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
Oops, something went wrong.