Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sacrifice build time for execution speed #640

Merged
merged 7 commits into from
Oct 24, 2022
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: 3 additions & 3 deletions .github/workflows/build-node-and-runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ jobs:
cache-version: v1

- name: Build binary and runtime
run: cargo build --release -p aleph-node
run: cargo build --profile production -p aleph-node

- name: Upload release binary
uses: actions/upload-artifact@v2
with:
name: ${{ inputs.artifact-prefix }}aleph-release-node
path: target/release/aleph-node
path: target/production/aleph-node
if-no-files-found: error
retention-days: 7

- name: Upload release runtime
uses: actions/upload-artifact@v2
with:
name: ${{ inputs.artifact-prefix }}aleph-release-runtime
path: target/release/wbuild/aleph-runtime/aleph_runtime.compact.wasm
path: target/production/wbuild/aleph-runtime/aleph_runtime.compact.wasm
if-no-files-found: error
retention-days: 7

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests-main-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ jobs:
- name: Build runtime and compare checksum with artifact
env:
ARTIFACT: aleph_runtime.compact.wasm
TARGET_DIR: target/release/wbuild/aleph-runtime
TARGET_DIR: target/production/wbuild/aleph-runtime
run: |
mkdir -p "$TARGET_DIR"
mv "$ARTIFACT" "$TARGET_DIR"
sha256sum "$TARGET_DIR/$ARTIFACT" > checksum.sha256
cargo clean
cargo build --release -p aleph-runtime
cargo build --profile production -p aleph-runtime
sha256sum -c checksum.sha256


Expand Down Expand Up @@ -554,7 +554,7 @@ jobs:
then
echo "::set-output name=diff::0"
else
echo "::set-output name=diff::1"
echo "::set-output name=diff::1"
fi

build-new-runtime-and-try_runtime:
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/nightly-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ jobs:
with:
name: aleph-test-node
path: target/release

- name: Build test docker image
id: build-image
run: |
chmod +x target/release/aleph-node
docker build --tag aleph-node:latest -f ./docker/Dockerfile .
docker save -o aleph-node.tar aleph-node:latest

- name: Upload test docker image
uses: actions/upload-artifact@v2
with:
Expand All @@ -51,7 +51,7 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1

Expand All @@ -62,17 +62,17 @@ jobs:
uses: actions/download-artifact@v2
with:
name: aleph-release-runtime

- name: Build runtime and compare checksum with artifact
env:
ARTIFACT: aleph_runtime.compact.wasm
TARGET_DIR: target/release/wbuild/aleph-runtime
TARGET_DIR: target/production/wbuild/aleph-runtime
run: |
mkdir -p "$TARGET_DIR"
mv "$ARTIFACT" "$TARGET_DIR"
sha256sum "$TARGET_DIR/$ARTIFACT" > checksum.sha256
cargo clean
cargo build --release -p aleph-runtime
cargo build --profile production -p aleph-runtime
sha256sum -c checksum.sha256

build-test-client:
Expand All @@ -83,28 +83,28 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1

- name: Restore cache
uses: ./.github/actions/restore-cache
with:
target-key: e2e
cargo-key: e2e
cache-version: v1
cargo-targets: e2e-tests/target/

- name: Build binary and docker image
run: |
cd e2e-tests/
cargo build --release
fbielejec marked this conversation as resolved.
Show resolved Hide resolved
cargo build
docker build --tag aleph-e2e-client:latest -f Dockerfile .
docker save -o aleph-e2e-client.tar aleph-e2e-client:latest

- name: Stop cache
uses: ./.github/actions/post-cache

- name: Upload artifact
uses: actions/upload-artifact@v2
with:
Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,12 @@ exclude = [
"benches/payout-stakers",
"bin/cliain",
]

[profile.release]
Marcin-Radecki marked this conversation as resolved.
Show resolved Hide resolved
# Substrate runtime requires unwinding.
panic = "unwind"
Marcin-Radecki marked this conversation as resolved.
Show resolved Hide resolved

[profile.production]
inherits = "release"
lto = true
Marcin-Radecki marked this conversation as resolved.
Show resolved Hide resolved
codegen-units = 1
Marcin-Radecki marked this conversation as resolved.
Show resolved Hide resolved