Files
leleka/.github/workflows/port.yml
T

130 lines
6.6 KiB
YAML

name: Rust port
# Checks for the Rust port of the Original engine. Everything here runs without a GPU, model
# weights or tokens. The existing "Linux" workflow is unchanged; the jobs below add the port-specific gates:
# port-fast fmt, Clippy and tests on the host-buildable crates (scripts/check-local.sh --fast)
# port-typecheck Linux-only crates (cuda-driver with the cuda-driver feature, leleka-runtime) type-checked, not run
# port-oracles CPU oracle differentials against the unmodified Python tools (needs pip and a pinned llama.cpp gguf-py)
# port-linux-tests Docker Linux harness (scripts/linux-tests/run.sh); optional until branch claude/port-linux-tests merges
# Type-checking is not execution: nothing here runs the Linux-gated tests or any GPU smoke.
on:
push:
branches: [main, 'claude/port-*']
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: never
RUST_BACKTRACE: '1'
jobs:
port-fast:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake python3
- name: Install pinned Rust
run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy
- name: Fast path (fmt, Clippy, tests on host-buildable crates)
# Known fmt/Clippy debt in leleka-model-format and the Linux-only crates is reported as warnings;
# set STRICT_DEBT=1 to make it fatal once the owners have cleaned it up.
run: scripts/check-local.sh --fast
port-typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake python3
- name: Install pinned Rust
run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy --target x86_64-unknown-linux-gnu
- name: Type-check the Linux-gated crates (no tests are run)
run: >-
cargo check --locked --target x86_64-unknown-linux-gnu --all-targets
-p leleka-cuda-model -p leleka-cuda-driver --features cuda-driver -p leleka-engine-qwen35-cuda -p leleka-runtime
- name: Format and Clippy debt report for the Linux-only crates (informational)
continue-on-error: true
run: |
cargo fmt -p leleka-cuda-model -p leleka-cuda-driver -p leleka-engine-qwen35-cuda -p leleka-native-cpu-expert --check
cargo clippy --locked --target x86_64-unknown-linux-gnu --no-deps -p leleka-cuda-model -p leleka-cuda-driver --features cuda-driver -p leleka-engine-qwen35-cuda -p leleka-runtime --all-targets -- -D warnings
port-oracles:
# CPU oracle differentials: the Rust side against the UNMODIFIED Python tools and the
# sampler host shim. Optional until it has run green on the hosted runner; the committed goldens are replayed by
# port-fast regardless.
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- name: Install build tools
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential cmake git python3 python3-venv
- name: Install pinned Rust
run: scripts/install-pinned-rustup.sh rustup toolchain install 1.99.0 --profile minimal --component rustfmt --component clippy
- name: Oracle Python environment (no model data)
# numpy 2.5.x needs Python >= 3.12 and the runner's distro Python is older, so the numpy pin follows the
# interpreter exactly as engine/strata/requirements.txt does (2.5.4 on 3.12+, 2.4.6 on 3.11, 2.2.6 below).
# The oracle differentials compare against recorded goldens with tolerances, not against a numpy build.
run: |
python3 -m venv "$RUNNER_TEMP/oracle-venv"
cat > "$RUNNER_TEMP/oracle-requirements.txt" <<'EOF'
numpy==2.5.4; python_version >= "3.12"
numpy==2.4.6; python_version == "3.11"
numpy==2.2.6; python_version < "3.11"
PyYAML==6.0.3
tqdm==4.70.1
Jinja2==3.1.6
regex==2026.9.10
EOF
"$RUNNER_TEMP/oracle-venv/bin/python" --version
"$RUNNER_TEMP/oracle-venv/bin/pip" install --disable-pip-version-check -r "$RUNNER_TEMP/oracle-requirements.txt"
- name: Fetch the pinned llama.cpp gguf-py
run: |
commit="$(sed -n 's/^LLAMA_CPP_COMMIT = "\(.*\)"$/\1/p' engine/strata/setup.py)"
test -n "$commit"
git init -q "$RUNNER_TEMP/llama.cpp"
git -C "$RUNNER_TEMP/llama.cpp" fetch --depth 1 https://github.com/ggml-org/llama.cpp "$commit"
git -C "$RUNNER_TEMP/llama.cpp" checkout -q FETCH_HEAD
- name: Port oracles (sampler shim and live Python differentials)
env:
OFFLINE_ORACLE_PYTHON: ${{ runner.temp }}/oracle-venv/bin/python
STRATA_GGUF_PY: ${{ runner.temp }}/llama.cpp/gguf-py
SKIP_LINUX_TYPECHECK: '1'
run: scripts/check-local.sh --port
port-linux-tests:
# Docker Linux harness that runs the Linux-gated tests of leleka-cuda-driver and leleka-runtime (mock driver, no
# GPU). The script is created on branch claude/port-linux-tests; until it is merged this job reports "absent"
# and stays green. Optional: a failure does not block the other jobs.
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- id: present
run: |
if [ -x scripts/linux-tests/run.sh ]; then
echo 'present=true' >> "$GITHUB_OUTPUT"
else
echo 'present=false' >> "$GITHUB_OUTPUT"
echo 'scripts/linux-tests/run.sh is absent (branch claude/port-linux-tests is not merged); skipping'
fi
- name: Install Docker
if: steps.present.outputs.present == 'true'
run: apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io
- name: Linux test harness
if: steps.present.outputs.present == 'true'
# The job runs in a container and uses the host's Docker daemon: the checkout path does not exist on that host,
# so the harness copies the source into the test container instead of bind-mounting it.
env:
LELEKA_TEST_COPY_SOURCE: '1'
run: scripts/linux-tests/run.sh
- name: Fake-libcuda mock gates (CPU-only ELF protocol tests of the driver)
if: steps.present.outputs.present == 'true'
env:
LELEKA_TEST_COPY_SOURCE: '1'
run: scripts/linux-tests/run.sh --mocks