mirror of
https://gitlab.com/pezkuwichain/pezkuwi-sdk.git
synced 2026-10-20 18:56:23 +00:00
fix(ci): add intra-cache-key cleanup, switch tests to debug mode
Two root causes from pipeline 2480888929: 1. /cache volume bloat — kurditv hit 93G/96G (97% full). The before_script pruned old cache KEYS but never cleaned other job dirs within the SAME key. Old test-partition-1/, test-partition-2/, wasm-check/, … accumulated across pipelines alongside the new test-release/ dir, filling the volume. Fix: add a second find that removes every sibling dir in CACHE_KEY/ except the current job's dir. .test-base keeps only test-release/; wasm-check keeps only wasm-check/. Each pipeline run starts with a clean slate per job type. 2. Release builds exceeded 300m — vps3 was still compiling pezbridge-hub-zagros-runtime at minute 300 in --release mode. Clippy (debug) took 162m cold; release mode is 2-3x slower. Fix: remove --release from all cargo nextest run commands. RUSTFLAGS already includes -Cdebug-assertions=y so assertion coverage is identical. Debug artifacts are smaller (less disk pressure) and compile faster. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
0354c96a84
commit
1486a3c2c8
1 file changed
+16
-8
+16
-8
@@ -375,11 +375,17 @@ cargo-audit:
|
|||||||
# cargo fingerprinting handles different feature sets within the same dir.
|
# cargo fingerprinting handles different feature sets within the same dir.
|
||||||
- export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/test-release"
|
- export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/test-release"
|
||||||
- mkdir -p "$CARGO_TARGET_DIR"
|
- mkdir -p "$CARGO_TARGET_DIR"
|
||||||
|
# Remove dirs with outdated cache keys (e.g. old Cargo.lock)
|
||||||
- find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
|
- find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
|
||||||
|
# Remove other job dirs within the SAME cache key — keeps only test-release.
|
||||||
|
# Previous per-job dirs (test-partition-1, test-no-try-runtime-2, …) accumulate
|
||||||
|
# and fill the /cache volume. One shared dir is all we need.
|
||||||
|
- find /cache/cargo-target/"${CACHE_KEY}" -mindepth 1 -maxdepth 1 -type d ! -name "test-release" -exec rm -rf {} + 2>/dev/null || true
|
||||||
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR (disk $(df -h /cache/cargo-target | tail -1 | awk '{print $3 "/" $2 " used, " $4 " free"}'))"
|
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR (disk $(df -h /cache/cargo-target | tail -1 | awk '{print $3 "/" $2 " used, " $4 " free"}'))"
|
||||||
cache: []
|
cache: []
|
||||||
# 300m: cold release build on VPS (jemalloc+rocksdb C compilation) can take 3h+.
|
# 300m: cold debug build on VPS can still take 2-3h (first run after cache change).
|
||||||
# Warm cache (second run on same runner) completes in ~30m.
|
# Warm cache completes in ~45m. Debug mode compiles 2-3x faster than --release
|
||||||
|
# while -Cdebug-assertions=y (set in RUSTFLAGS) keeps the same assertion coverage.
|
||||||
timeout: 300m
|
timeout: 300m
|
||||||
retry:
|
retry:
|
||||||
max: 1
|
max: 1
|
||||||
@@ -398,7 +404,7 @@ test-partition-1:
|
|||||||
- git config --global --add safe.directory '*'
|
- git config --global --add safe.directory '*'
|
||||||
- |
|
- |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--workspace --locked --release --no-fail-fast --cargo-quiet \
|
--workspace --locked --no-fail-fast --cargo-quiet \
|
||||||
--features try-runtime,experimental,ci-only-tests \
|
--features try-runtime,experimental,ci-only-tests \
|
||||||
--partition count:1/3
|
--partition count:1/3
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -414,7 +420,7 @@ test-partition-2:
|
|||||||
- git config --global --add safe.directory '*'
|
- git config --global --add safe.directory '*'
|
||||||
- |
|
- |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--workspace --locked --release --no-fail-fast --cargo-quiet \
|
--workspace --locked --no-fail-fast --cargo-quiet \
|
||||||
--features try-runtime,experimental,ci-only-tests \
|
--features try-runtime,experimental,ci-only-tests \
|
||||||
--partition count:2/3
|
--partition count:2/3
|
||||||
artifacts:
|
artifacts:
|
||||||
@@ -430,7 +436,7 @@ test-partition-3:
|
|||||||
- git config --global --add safe.directory '*'
|
- git config --global --add safe.directory '*'
|
||||||
- |
|
- |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--workspace --locked --release --no-fail-fast --cargo-quiet \
|
--workspace --locked --no-fail-fast --cargo-quiet \
|
||||||
--features try-runtime,experimental,ci-only-tests \
|
--features try-runtime,experimental,ci-only-tests \
|
||||||
--partition count:3/3
|
--partition count:3/3
|
||||||
# First partition also runs runtime-api tests
|
# First partition also runs runtime-api tests
|
||||||
@@ -448,7 +454,7 @@ test-no-try-runtime-1:
|
|||||||
- git config --global --add safe.directory '*'
|
- git config --global --add safe.directory '*'
|
||||||
- |
|
- |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--workspace --locked --release --no-fail-fast --cargo-quiet \
|
--workspace --locked --no-fail-fast --cargo-quiet \
|
||||||
--features experimental,ci-only-tests \
|
--features experimental,ci-only-tests \
|
||||||
--partition count:1/2
|
--partition count:1/2
|
||||||
|
|
||||||
@@ -458,7 +464,7 @@ test-no-try-runtime-2:
|
|||||||
- git config --global --add safe.directory '*'
|
- git config --global --add safe.directory '*'
|
||||||
- |
|
- |
|
||||||
cargo nextest run \
|
cargo nextest run \
|
||||||
--workspace --locked --release --no-fail-fast --cargo-quiet \
|
--workspace --locked --no-fail-fast --cargo-quiet \
|
||||||
--features experimental,ci-only-tests \
|
--features experimental,ci-only-tests \
|
||||||
--partition count:2/2
|
--partition count:2/2
|
||||||
|
|
||||||
@@ -476,7 +482,9 @@ wasm-check:
|
|||||||
- export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/${CI_JOB_NAME}"
|
- export CARGO_TARGET_DIR="/cache/cargo-target/${CACHE_KEY}/${CI_JOB_NAME}"
|
||||||
- mkdir -p "$CARGO_TARGET_DIR"
|
- mkdir -p "$CARGO_TARGET_DIR"
|
||||||
- find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
|
- find /cache/cargo-target -mindepth 1 -maxdepth 1 -type d ! -name "${CACHE_KEY}" -exec rm -rf {} + 2>/dev/null || true
|
||||||
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR"
|
# Keep only wasm-check dir; remove test-release and any other stale dirs
|
||||||
|
- find /cache/cargo-target/"${CACHE_KEY}" -mindepth 1 -maxdepth 1 -type d ! -name "${CI_JOB_NAME}" -exec rm -rf {} + 2>/dev/null || true
|
||||||
|
- echo "CARGO_TARGET_DIR=$CARGO_TARGET_DIR (disk $(df -h /cache/cargo-target | tail -1 | awk '{print $3 "/" $2 " used, " $4 " free"}'))"
|
||||||
cache: []
|
cache: []
|
||||||
timeout: 2h
|
timeout: 2h
|
||||||
retry:
|
retry:
|
||||||
|
|||||||
Reference in new issue
Block a user