feat: Enable P2P Transfers via NIXL #454
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: | |
| - main | |
| - 'release/*' | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUST_BACKTRACE: 1 | |
| # Cancel any previous check runs for the same pull request to avoid redundant workflows. | |
| concurrency: | |
| group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.event.pull_request.number) || format('{0}-{1}', github.workflow, github.run_id) }} | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| rust: | |
| - stable | |
| - beta | |
| - nightly | |
| include: | |
| - rust: stable | |
| can-fail: false | |
| - rust: beta | |
| can-fail: false | |
| - rust: nightly | |
| can-fail: true | |
| continue-on-error: ${{ matrix.can-fail }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Check Rust version | |
| run: rustc --version | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-${{ matrix.rust }}- | |
| ${{ runner.os }}-cargo- | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| - name: Check formatting | |
| if: matrix.rust == 'stable' | |
| run: cargo fmt --all -- --check | |
| - name: Lint with clippy | |
| if: matrix.rust == 'stable' | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Build debug | |
| run: cargo build --verbose | |
| - name: Run unit tests | |
| run: cargo test --verbose --lib | |
| - name: Build release | |
| run: cargo build --release --verbose | |
| - name: Run doc tests | |
| run: cargo test --doc | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Check Rust version | |
| run: rustc --version | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target/ | |
| key: ${{ runner.os }}-cargo-stable-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| - name: Build release | |
| run: cargo build --release | |
| - name: Start server in background | |
| run: | | |
| ./target/release/modelexpress-server & | |
| echo $! > server.pid | |
| sleep 5 # Give server time to start | |
| if [ -f server.pid ]; then | |
| kill $(cat server.pid) || true | |
| rm server.pid | |
| fi | |
| - name: Run integration test script | |
| if: always() | |
| run: | | |
| if [ -f run_integration_tests.sh ]; then | |
| chmod +x run_integration_tests.sh | |
| ./run_integration_tests.sh || echo "Integration test script failed (expected in CI)" | |
| fi | |
| - name: Stop server | |
| if: always() | |
| run: | | |
| if [ -f server.pid ]; then | |
| kill $(cat server.pid) || true | |
| rm server.pid | |
| fi | |
| security-audit: | |
| name: Security Audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Check Rust version | |
| run: rustc --version | |
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| - name: Install and Run cargo-deny | |
| run: | | |
| cargo-deny --version || cargo install cargo-deny@0.16.4 | |
| cargo-deny --no-default-features check --hide-inclusion-graph licenses bans --config ${{ github.workspace }}/deny.toml | |
| code-coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Check Rust version | |
| run: rustc --version | |
| - name: Install LLVM tools | |
| run: | | |
| rustup component add llvm-tools-preview | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| - name: Install cargo-llvm-cov | |
| run: cargo install cargo-llvm-cov | |
| - name: Generate code coverage | |
| run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| files: lcov.info | |
| fail_ci_if_error: false | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Build Docker image | |
| run: | | |
| docker build -t model-express:latest . | |
| - name: Test Docker image | |
| run: | | |
| docker run --rm --detach --name test-server -p 8001:8001 model-express:latest | |
| sleep 10 | |
| # Test that the server is responding (basic health check) | |
| timeout 30 bash -c 'until curl -s http://localhost:8001/health; do sleep 1; done' || echo "Health check failed (expected for gRPC)" | |
| docker stop test-server || true | |
| benchmark: | |
| name: Performance Benchmarks | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Check Rust version | |
| run: rustc --version | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| - name: Run benchmarks | |
| run: cargo bench --verbose || echo "No benchmarks configured" | |
| release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| needs: [test, integration-test, security-audit, docker-build] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| run: | | |
| curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Check Rust version | |
| run: rustc --version | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y protobuf-compiler | |
| - name: Build release binaries | |
| run: | | |
| cargo build --release | |
| strip target/release/modelexpress-server | |
| - name: Create release archive | |
| run: | | |
| mkdir -p release | |
| cp target/release/modelexpress-server release/ | |
| cp target/release/test_client release/ || true | |
| cp target/release/fallback_test release/ || true | |
| cp README.md LICENSE release/ || true | |
| tar -czf model-express-linux-x86_64.tar.gz -C release . | |
| - name: Upload release artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: model-express-binaries | |
| path: model-express-linux-x86_64.tar.gz | |
| notify: | |
| name: Notify on Failure | |
| runs-on: ubuntu-latest | |
| needs: [test, integration-test, security-audit, docker-build] | |
| if: failure() | |
| steps: | |
| - name: Notify failure | |
| run: | | |
| echo "::warning::One or more CI jobs failed. Please check the logs." | |
| echo "Failed jobs may include: tests, integration tests, security audit, or docker build." |