Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
Expand All @@ -51,9 +48,6 @@ jobs:
file: ./Dockerfile-${{ matrix.os }}
build-args: |
REVISION=${{ github.ref }}
SCCACHE_GHA_ENABLED=true
ACTIONS_CACHE_URL=${{ env.ACTIONS_CACHE_URL }}
ACTIONS_RUNTIME_TOKEN=${{ env.ACTIONS_RUNTIME_TOKEN }}
platforms: ${{ env.build_platforms }}
push: false
cache-from: |
Expand Down
18 changes: 3 additions & 15 deletions Dockerfile-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ RUN apk add --no-cache \
libc6-compat \
perl \
unzip \
sccache \
bash

SHELL ["/bin/bash", "-c"]
Expand All @@ -29,13 +28,6 @@ RUN if [[ "$BUILDPLATFORM" == "linux/arm64" ]] ; then export PROTOC_ARCH=aarch_6
rm /tmp/protoc.zip && \
ln -s /opt/protoc/bin/protoc /usr/bin/

# Set RUSTC_WRAPPER=/usr/bin/sccache to enable `sccache` caching.
ARG RUSTC_WRAPPER=/usr/bin/sccache
# These should be set for Github Actions caching
ARG SCCACHE_GHA_ENABLED
ARG ACTIONS_CACHE_URL
ARG ACTIONS_RUNTIME_TOKEN

# Create a dummy package
RUN cargo init /usr/src/abci-app
WORKDIR /usr/src/abci-app
Expand All @@ -54,15 +46,11 @@ ARG REVISION="refs/heads/master"
# 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`.
# 4. We set SCCACHE_SERVER_PORT to avoid conflicts during parallel builds
RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \
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 \
SCCACHE_SERVER_PORT=$((RANDOM+1025)) cargo add --config net.git-fetch-with-cli=true \
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 && \
sccache --show-stats

cargo clean
28 changes: 3 additions & 25 deletions Dockerfile-debian
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@ RUN --mount=type=cache,sharing=locked,target=/var/lib/apt/lists \
wget \
bash


#
# Install sccache - build cache for Rust.
# This is optional, but it will speed up the build process
#
ARG SCCACHE_URL="https://github.com/mozilla/sccache/releases/download/v0.4.0/sccache-v0.4.0-x86_64-unknown-linux-musl.tar.gz"
RUN wget -q -O /tmp/sccache.tar.gz ${SCCACHE_URL} \
&& mkdir -p /tmp/sccache \
&& tar -z -C /tmp/sccache -xf /tmp/sccache.tar.gz \
&& mv /tmp/sccache/sccache*/sccache /usr/bin/sccache \
&& rm -r /tmp/sccache.tar.gz /tmp/sccache

# Set RUSTC_WRAPPER=/usr/bin/sccache to enable `sccache` caching.
ARG RUSTC_WRAPPER=/usr/bin/sccache
# These should be set for Github Actions caching
ARG SCCACHE_GHA_ENABLED
ARG ACTIONS_CACHE_URL
ARG ACTIONS_RUNTIME_TOKEN

# Create a dummy package
RUN cargo init /usr/src/abci-app
WORKDIR /usr/src/abci-app
Expand All @@ -50,13 +31,10 @@ SHELL ["/bin/bash", "-c"]
# 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`.
# 4. We set SCCACHE_SERVER_PORT to avoid conflicts during parallel builds
RUN --mount=type=cache,sharing=shared,target=/root/.cache/sccache \
--mount=type=cache,sharing=shared,target=${CARGO_HOME}/registry/index \
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 \
SCCACHE_SERVER_PORT=$((RANDOM+1025)) cargo add --config net.git-fetch-with-cli=true \
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 && \
sccache --show-stats
cargo clean