mirror of
https://github.com/ruvnet/RuVector.git
synced 2026-06-01 06:10:31 +00:00
Major new package implementing a distributed hypergraph database with: ## Core Components (crates/ruvector-graph/) - Cypher-compatible query parser with lexer, AST, optimizer - Query execution engine with SIMD optimization and parallel execution - ACID transaction support with MVCC isolation levels - Distributed consensus and federation layer - Vector-graph hybrid queries for AI/RAG workloads - Performance optimizations (100x faster than Neo4j target) ## Bindings - WASM bindings (crates/ruvector-graph-wasm/) - NAPI-RS Node.js bindings (crates/ruvector-graph-node/) - NPM packages for both targets ## CLI Integration - 8 new graph commands: create, query, shell, import, export, info, benchmark, serve ## CI/CD - Updated build-native.yml for graph packages - New graph-ci.yml for testing and benchmarks - New graph-release.yml for automated publishing ## Data Generation - OpenRouter/Kimi K2 integration (packages/graph-data-generator/) - Agentic-synth benchmark suite integration ## Tests & Benchmarks - 11 test files covering all components - Criterion benchmarks for performance validation - Neo4j compatibility test suite ## Architecture Highlights - CSR graph layout for cache-friendly access - SIMD-vectorized query operators - Roaring bitmaps for label indexes - Bloom filters for fast negative lookups - Adaptive radix tree for property indexes Note: This is a comprehensive implementation created by 15 parallel agents. Some integration fixes may be needed to resolve cross-module dependencies. Co-authored-by: Claude AI Swarm <swarm@claude.ai>
315 lines
8.7 KiB
YAML
315 lines
8.7 KiB
YAML
name: Graph CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main, develop]
|
|
paths:
|
|
- 'crates/ruvector-graph/**'
|
|
- 'npm/packages/graph-node/**'
|
|
- 'npm/packages/graph-wasm/**'
|
|
- '.github/workflows/graph-ci.yml'
|
|
pull_request:
|
|
branches: [main, develop]
|
|
paths:
|
|
- 'crates/ruvector-graph/**'
|
|
- 'npm/packages/graph-node/**'
|
|
- 'npm/packages/graph-wasm/**'
|
|
- '.github/workflows/graph-ci.yml'
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
RUST_BACKTRACE: 1
|
|
|
|
jobs:
|
|
rust-test:
|
|
name: Rust Tests
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
components: rustfmt, clippy
|
|
|
|
- name: Cache Rust
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: graph-rust-test
|
|
|
|
- name: Check formatting
|
|
working-directory: crates/ruvector-graph
|
|
run: cargo fmt --check
|
|
|
|
- name: Run clippy
|
|
working-directory: crates/ruvector-graph
|
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
|
|
- name: Run tests
|
|
working-directory: crates/ruvector-graph
|
|
run: cargo test --all-features
|
|
|
|
- name: Run doc tests
|
|
working-directory: crates/ruvector-graph
|
|
run: cargo test --doc
|
|
|
|
wasm-build:
|
|
name: WASM Build and Test
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
targets: wasm32-unknown-unknown
|
|
|
|
- name: Install wasm-pack
|
|
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
|
|
|
- name: Cache Rust
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: graph-wasm
|
|
|
|
- name: Build WASM
|
|
working-directory: npm/packages/graph-wasm
|
|
run: npm run build:wasm
|
|
|
|
- name: Install dependencies
|
|
working-directory: npm/packages/graph-wasm
|
|
run: npm ci
|
|
|
|
- name: Run WASM tests
|
|
working-directory: npm/packages/graph-wasm
|
|
run: npm test
|
|
|
|
- name: Upload WASM artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: wasm-build
|
|
path: npm/packages/graph-wasm/pkg/
|
|
if-no-files-found: error
|
|
|
|
napi-build:
|
|
name: NAPI Build ${{ matrix.settings.platform }}
|
|
runs-on: ${{ matrix.settings.host }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
settings:
|
|
- host: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
platform: linux-x64-gnu
|
|
- host: ubuntu-22.04
|
|
target: aarch64-unknown-linux-gnu
|
|
platform: linux-arm64-gnu
|
|
- host: macos-15-intel
|
|
target: x86_64-apple-darwin
|
|
platform: darwin-x64
|
|
- host: macos-14
|
|
target: aarch64-apple-darwin
|
|
platform: darwin-arm64
|
|
- host: windows-2022
|
|
target: x86_64-pc-windows-msvc
|
|
platform: win32-x64-msvc
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
targets: ${{ matrix.settings.target }}
|
|
|
|
- name: Cache Rust
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: graph-napi-${{ matrix.settings.target }}
|
|
|
|
- name: Install cross-compilation tools (Linux ARM64)
|
|
if: matrix.settings.platform == 'linux-arm64-gnu'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
|
|
|
- name: Install dependencies
|
|
working-directory: npm
|
|
run: npm ci
|
|
|
|
- name: Build NAPI module
|
|
working-directory: npm/packages/graph-node
|
|
run: npm run build:napi -- --target ${{ matrix.settings.target }}
|
|
env:
|
|
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
|
|
|
|
- name: Test NAPI module (native platform only)
|
|
if: |
|
|
(matrix.settings.platform == 'linux-x64-gnu' && runner.os == 'Linux') ||
|
|
(matrix.settings.platform == 'darwin-x64' && runner.os == 'macOS' && runner.arch == 'X64') ||
|
|
(matrix.settings.platform == 'darwin-arm64' && runner.os == 'macOS' && runner.arch == 'ARM64') ||
|
|
(matrix.settings.platform == 'win32-x64-msvc' && runner.os == 'Windows')
|
|
working-directory: npm/packages/graph-node
|
|
run: npm test
|
|
|
|
- name: Upload NAPI artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: napi-${{ matrix.settings.platform }}
|
|
path: npm/packages/graph-node/*.node
|
|
if-no-files-found: error
|
|
|
|
integration-tests:
|
|
name: Integration Tests
|
|
runs-on: ubuntu-22.04
|
|
needs: [rust-test, wasm-build, napi-build]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18'
|
|
|
|
- name: Download WASM artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: wasm-build
|
|
path: npm/packages/graph-wasm/pkg/
|
|
|
|
- name: Download NAPI artifact (Linux x64)
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: napi-linux-x64-gnu
|
|
path: npm/packages/graph-node/
|
|
|
|
- name: Install dependencies
|
|
working-directory: npm
|
|
run: npm ci
|
|
|
|
- name: Run integration tests
|
|
working-directory: npm/packages/graph-node
|
|
run: npm run test:integration
|
|
|
|
- name: Run WASM integration tests
|
|
working-directory: npm/packages/graph-wasm
|
|
run: npm run test:integration
|
|
|
|
benchmark:
|
|
name: Performance Benchmarks
|
|
runs-on: ubuntu-22.04
|
|
needs: [rust-test, napi-build]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
|
|
- name: Cache Rust
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
key: graph-bench
|
|
|
|
- name: Download NAPI artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: napi-linux-x64-gnu
|
|
path: npm/packages/graph-node/
|
|
|
|
- name: Run Rust benchmarks
|
|
working-directory: crates/ruvector-graph
|
|
run: |
|
|
cargo bench --bench graph_bench -- --output-format bencher | tee bench-output.txt
|
|
|
|
- name: Compare with baseline
|
|
run: |
|
|
if [ -f .github/benchmarks/graph-baseline.txt ]; then
|
|
echo "Comparing with baseline..."
|
|
# Simple comparison - in production, use a proper benchmark comparison tool
|
|
diff .github/benchmarks/graph-baseline.txt crates/ruvector-graph/bench-output.txt || true
|
|
else
|
|
echo "No baseline found, skipping comparison"
|
|
fi
|
|
|
|
- name: Upload benchmark results
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: benchmark-results
|
|
path: crates/ruvector-graph/bench-output.txt
|
|
|
|
- name: Comment PR with benchmark results
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/github-script@v7
|
|
with:
|
|
script: |
|
|
const fs = require('fs');
|
|
const benchResults = fs.readFileSync('crates/ruvector-graph/bench-output.txt', 'utf8');
|
|
github.rest.issues.createComment({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
body: `### Graph Benchmark Results\n\n\`\`\`\n${benchResults}\n\`\`\``
|
|
});
|
|
|
|
security-audit:
|
|
name: Security Audit
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install cargo-audit
|
|
run: cargo install cargo-audit
|
|
|
|
- name: Run security audit
|
|
working-directory: crates/ruvector-graph
|
|
run: cargo audit
|
|
|
|
coverage:
|
|
name: Code Coverage
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Install cargo-tarpaulin
|
|
run: cargo install cargo-tarpaulin
|
|
|
|
- name: Generate coverage
|
|
working-directory: crates/ruvector-graph
|
|
run: cargo tarpaulin --out Xml --output-dir coverage
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
with:
|
|
files: crates/ruvector-graph/coverage/cobertura.xml
|
|
flags: graph
|
|
name: graph-coverage
|