Files
leleka/scripts/check-local.sh
T

51 lines
4.2 KiB
Bash

#!/usr/bin/env bash
set -euo pipefail
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
python3 -m py_compile "${repo_root}/scripts/prepare-keyless-routing.py" "${repo_root}/scripts/calibrate-keyless-routing.py" "${repo_root}/scripts/test-keyless-routing.py" "${repo_root}/scripts/bench-chat-paired.py" "${repo_root}/scripts/compare-chat-reports.py" "${repo_root}/scripts/bench-chat-sequential-server.py" "${repo_root}/scripts/check-kar-cuda-records.py" "${repo_root}/scripts/strata-agent-profile.py" "${repo_root}/scripts/strata-dual-256-experiment.py" "${repo_root}/scripts/strata-dual-request-proxy.py" "${repo_root}/scripts/kv-keyless-feasibility.py" "${repo_root}/scripts/kv-keyless-attention.py" "${repo_root}/scripts/bench-expert-reserve.py" "${repo_root}/scripts/ple-cache-reuse.py" "${repo_root}/scripts/split-ple-row-trace.py" "${repo_root}/scripts/bench-kar-ple-device.py" "${repo_root}/scripts/bench-kar-ple-serve.py"
python3 "${repo_root}/scripts/test-benchmark-harness.py"
python3 "${repo_root}/scripts/test-native-service.py"
python3 "${repo_root}/scripts/test-native-api.py"
python3 "${repo_root}/scripts/test-native-menu.py"
python3 "${repo_root}/scripts/test-model-switch.py"
python3 "${repo_root}/scripts/test-cuda-bootstrap.py"
python3 "${repo_root}/scripts/test-static-cuda-profile.py"
python3 "${repo_root}/scripts/test-static-cuda-elf.py"
python3 "${repo_root}/scripts/test-linux-package.py"
python3 "${repo_root}/scripts/test-runtime-image.py"
python3 "${repo_root}/scripts/test-ple-config-parity.py"
python3 "${repo_root}/scripts/test-gitea-release.py"
python3 "${repo_root}/scripts/test-keyless-routing.py"
cargo fmt --manifest-path "${repo_root}/crates/model-format/Cargo.toml" --check
cargo clippy --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-model-format --all-targets -- -D warnings
cargo test --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-model-format
cargo test --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-backend-api
cargo fmt --manifest-path "${repo_root}/crates/quant-core/Cargo.toml" --check
cargo clippy --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-quant-core --all-targets -- -D warnings
cargo test --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-quant-core
cargo fmt --manifest-path "${repo_root}/crates/cuda-driver/Cargo.toml" --check
cargo clippy --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-cuda-driver --all-targets --all-features -- -D warnings
cargo test --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-cuda-driver
"${repo_root}/scripts/test-cuda-driver-bootstrap.sh"
cargo fmt --manifest-path "${repo_root}/control-plane/Cargo.toml" --check
cargo clippy --manifest-path "${repo_root}/control-plane/Cargo.toml" --locked --all-targets -- -D warnings
cargo test --manifest-path "${repo_root}/control-plane/Cargo.toml" --locked
cargo fmt --manifest-path "${repo_root}/crates/offline-tools/Cargo.toml" --check
cargo clippy --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-offline-tools -p leleka-tokenizer -p leleka-context --all-targets -- -D warnings
cargo test --manifest-path "${repo_root}/Cargo.toml" --locked -p leleka-offline-tools -p leleka-tokenizer -p leleka-context
# Live differentials against the unmodified Python oracle (docs/offline-port.md). Opt in with a venv that has
# numpy, pyyaml, tqdm, jinja2 and regex, and the pinned llama.cpp gguf-py:
# OFFLINE_ORACLE_PYTHON=/venv/bin/python STRATA_GGUF_PY=/llama.cpp/gguf-py scripts/check-local.sh
if [[ -n "${OFFLINE_ORACLE_PYTHON:-}" && -n "${STRATA_GGUF_PY:-}" ]]; then
cargo build --manifest-path "${repo_root}/Cargo.toml" --locked -p strata-control --bin strata-next
strata_next="${CARGO_TARGET_DIR:-${repo_root}/target}/debug/strata-next"
for oracle in native_pack gguf_header tokenizer dequant tools mtp_fetch chat_template; do
"${OFFLINE_ORACLE_PYTHON}" "${repo_root}/scripts/offline/diff_${oracle}.py" "${strata_next}"
done
fi
replay="$(cargo run --quiet --manifest-path "${repo_root}/control-plane/Cargo.toml" --locked --bin replay-responses -- --sse "${repo_root}/benchmarks/fixtures/responses/structured-tool.json")"
[[ "${replay}" == *"event: response.completed"* ]]
"${repo_root}/scripts/build-cpu.sh"