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
1 change: 1 addition & 0 deletions .github/workflows/_setup-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
default: "stable-release"
env:
CACHE_SHARED_KEY: stable-release
STRATUS_PROFILE: ci
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build-debug-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ jobs:
# importer-offline) the e2e consumers require.
run: |
source <(cargo llvm-cov show-env --export-prefix)
cargo test --no-run
cargo build --features dev
# --profile ci strips debug symbols from dependencies (stratus itself keeps
# full debug). Consumers run with STRATUS_PROFILE=ci so they hit this cache.
cargo test --no-run --profile ci
Comment thread
carneiro-cw marked this conversation as resolved.
cargo build --features dev --profile ci

- name: Rust Cache - Save shared key
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-contracts-rocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ on:

env:
CACHE_SHARED_KEY: stable-release
# Use the `ci` profile (deps stripped of debug symbols; stratus keeps full debug).
# See [profile.ci] in Cargo.toml and profile_flag in the justfile.
STRATUS_PROFILE: ci
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-leader-fake-leader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ on:

env:
CACHE_SHARED_KEY: stable-release
# Use the `ci` profile (deps stripped of debug symbols; stratus keeps full debug).
# See [profile.ci] in Cargo.toml and profile_flag in the justfile.
STRATUS_PROFILE: ci
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/e2e-leader-follower.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ on:

env:
CACHE_SHARED_KEY: stable-release
# Use the `ci` profile (deps stripped of debug symbols; stratus keeps full debug).
# See [profile.ci] in Cargo.toml and profile_flag in the justfile.
STRATUS_PROFILE: ci
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ on:

env:
CACHE_SHARED_KEY: stable-release
# Use the `ci` profile (deps stripped of debug symbols; stratus keeps full debug).
# See [profile.ci] in Cargo.toml and profile_flag in the justfile.
STRATUS_PROFILE: ci
CACHE_PATH: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -262,5 +262,13 @@ expect_used = "warn"
panic = "warn"


# CI-only profile: strips debug symbols from dependencies to keep the shared
# `stable-release` cache small, while keeping full debug info for stratus itself.
[profile.ci]
inherits = "dev"

[profile.ci.package."*"]
debug = false

[profile.release]
lto = "fat"
31 changes: 16 additions & 15 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export CARGO_COMMAND := env("CARGO_COMMAND", "")
# Global arguments that can be passed to receipts.
nightly_flag := if env("NIGHTLY", "") =~ "(true|1)" { "+nightly" } else { "" }
release_flag := if env("RELEASE", "") =~ "(true|1)" { "--release" } else { "" }
profile_flag := if env("STRATUS_PROFILE", "") != "" { "--profile " + env("STRATUS_PROFILE", "") } else { "" }
database_url := env("DATABASE_URL", "postgres://postgres:123@0.0.0.0:5432/stratus")

# Project: Show available tasks
Expand Down Expand Up @@ -110,8 +111,8 @@ stratus-test *args="":
FEATURES="dev,replication"
fi
echo "leader features: " $FEATURES
cargo build --features $FEATURES
cargo run --bin stratus --features $FEATURES -- --leader --rocks-cf-size-metrics-interval 30s {{args}} > stratus.log &
cargo build {{profile_flag}} --features $FEATURES
cargo run {{profile_flag}} --bin stratus --features $FEATURES -- --leader --rocks-cf-size-metrics-interval 30s {{args}} > stratus.log &
just _wait_for_stratus

# Bin: Stratus main service as leader while performing memory-profiling, producing a heap dump every 2^32 allocated bytes (~4gb)
Expand All @@ -134,8 +135,8 @@ stratus-follower-test *args="":
FEATURES="dev,replication"
fi
echo "follower features: " $FEATURES
cargo build --features $FEATURES
LOCAL_ENV_PATH=config/stratus-follower.env.local cargo run --bin stratus --features $FEATURES -- --follower --rocks-cf-size-metrics-interval 30s {{args}} -a 0.0.0.0:3001 > stratus_follower.log &
cargo build {{profile_flag}} --features $FEATURES
LOCAL_ENV_PATH=config/stratus-follower.env.local cargo run {{profile_flag}} --bin stratus --features $FEATURES -- --follower --rocks-cf-size-metrics-interval 30s {{args}} -a 0.0.0.0:3001 > stratus_follower.log &
just _wait_for_stratus 3001

# Bin: Stratus main service as fake leader (imports blocks like a follower, executes/mines locally like a leader)
Expand All @@ -144,8 +145,8 @@ stratus-fake-leader-test *args="":
source <(just coverage-env)
FEATURES="dev"
echo "fake-leader features: " $FEATURES
cargo build --features $FEATURES
LOCAL_ENV_PATH=config/stratus-follower.env.local cargo run --bin stratus --features $FEATURES -- --fake-leader --rocks-cf-size-metrics-interval 30s {{args}} -a 0.0.0.0:3001 > stratus_fake_leader.log &
cargo build {{profile_flag}} --features $FEATURES
LOCAL_ENV_PATH=config/stratus-follower.env.local cargo run {{profile_flag}} --bin stratus --features $FEATURES -- --fake-leader --rocks-cf-size-metrics-interval 30s {{args}} -a 0.0.0.0:3001 > stratus_fake_leader.log &
just _wait_for_stratus 3001

# Bin: Download external RPC blocks and receipts to temporary storage
Expand All @@ -155,8 +156,8 @@ rpc-downloader *args="":
rpc-downloader-test *args="":
#!/bin/bash
source <(just coverage-env)
cargo build
cargo run --bin rpc-downloader -- {{args}} > rpc-downloader.log
cargo build {{profile_flag}}
cargo run {{profile_flag}} --bin rpc-downloader -- {{args}} > rpc-downloader.log

# Bin: Import external RPC blocks from temporary storage to Stratus storage
importer-offline *args="":
Expand All @@ -165,8 +166,8 @@ importer-offline *args="":
importer-offline-test *args="":
#!/bin/bash
source <(just coverage-env)
cargo build
cargo run --bin importer-offline -- {{args}} --rocks-file-descriptors-limit=65536 > importer-offline.log
cargo build {{profile_flag}}
cargo run {{profile_flag}} --bin importer-offline -- {{args}} --rocks-file-descriptors-limit=65536 > importer-offline.log

# ------------------------------------------------------------------------------
# Test tasks
Expand All @@ -175,11 +176,11 @@ importer-offline-test *args="":
test:
#!/bin/bash
source <(just coverage-env)
cargo test
cargo test {{profile_flag}}
if command -v cargo-llvm-cov >/dev/null 2>&1; then
mkdir -p target/llvm-cov/reports
cargo llvm-cov report --html --ignore-filename-regex data_migration.rs
cargo llvm-cov report --lcov --output-path target/llvm-cov/reports/rust_tests.info --ignore-filename-regex data_migration.rs
cargo llvm-cov report {{profile_flag}} --html --ignore-filename-regex data_migration.rs
cargo llvm-cov report {{profile_flag}} --lcov --output-path target/llvm-cov/reports/rust_tests.info --ignore-filename-regex data_migration.rs
fi


Expand All @@ -205,8 +206,8 @@ run-test recipe="" *args="":
if command -v cargo-llvm-cov >/dev/null 2>&1; then
echo "Generating reports"
mkdir -p target/llvm-cov/reports
cargo llvm-cov report --html --ignore-filename-regex data_migration.rs
cargo llvm-cov report --lcov --output-path target/llvm-cov/reports/{{recipe}}.info --ignore-filename-regex data_migration.rs
cargo llvm-cov report {{profile_flag}} --html --ignore-filename-regex data_migration.rs
cargo llvm-cov report {{profile_flag}} --lcov --output-path target/llvm-cov/reports/{{recipe}}.info --ignore-filename-regex data_migration.rs
fi
exit $result_code

Expand Down
Loading