| 
 | 1 | +# NIXL PR Testing Matrix Configuration  | 
 | 2 | +#  | 
 | 3 | +# This file defines the build matrix for NIXL PR validation using the multi-target Docker system.  | 
 | 4 | +# Primary purpose: Fast feedback on code changes via build + test execution.  | 
 | 5 | +#  | 
 | 6 | +# Key Components:  | 
 | 7 | +# - Single NIXL Image Build: Uses multi-stage Dockerfile (base -> nixl) with layer caching  | 
 | 8 | +# - Integrated Testing: Runs C++ and Python tests directly in the built environment  | 
 | 9 | +# - CI-Demo Integration: Base image auto-builds only when Dockerfile changes  | 
 | 10 | +#  | 
 | 11 | +# PR Testing Benefits:  | 
 | 12 | +# - Fast feedback: Base layer cached when only code changes  | 
 | 13 | +# - Full rebuild: When infrastructure (Dockerfile) changes  | 
 | 14 | +# - No registry operations: Focus on validation, not distribution  | 
 | 15 | +# - Multi-OS/arch testing: Ensures compatibility across platforms  | 
 | 16 | +#  | 
 | 17 | + | 
 | 18 | +---  | 
 | 19 | +job: nixl-ci-build-multi-target  | 
 | 20 | + | 
 | 21 | +# Registry configuration for base image reusability  | 
 | 22 | +registry_host: urm.nvidia.com  | 
 | 23 | +registry_path: /sw-nbu-swx-nixl-docker-local/ci  | 
 | 24 | +registry_auth: svc-nixl-artifactory-token  | 
 | 25 | + | 
 | 26 | +# Build settings  | 
 | 27 | +failFast: false  | 
 | 28 | +timeout_minutes: 120  | 
 | 29 | + | 
 | 30 | +# Infrastructure requirements  | 
 | 31 | +kubernetes:  | 
 | 32 | +  cloud: il-ipp-blossom-prod  | 
 | 33 | +  namespace: swx-media  | 
 | 34 | +  limits: "{memory: 16Gi, cpu: 8000m}"  | 
 | 35 | +  requests: "{memory: 8Gi, cpu: 4000m}"  | 
 | 36 | + | 
 | 37 | +# Container images: Base for reusability + NIXL for PR testing  | 
 | 38 | +runs_on_dockers:  | 
 | 39 | +  - { name: "podman-v5.0.2", url: "quay.io/podman/stable:v5.0.2", privileged: true, category: 'tool' }  | 
 | 40 | + | 
 | 41 | +  # BASE IMAGE - Built & Pushed for Reusability  | 
 | 42 | +  # Registry: urm.nvidia.com/sw-nbu-swx-nixl-docker-local/ci/{arch}/nixl-base:base-{os}-{arch}  | 
 | 43 | +  # Contains: UCX, DOCA, AWS SDK, Rust toolchain, all dependencies  | 
 | 44 | +  - { file: 'contrib/Dockerfile.multi-target', name: "nixl-base", tag: "base-${os}-${arch}", target: 'base', arch: '${arch}', build_args: 'OS=${os}', category: 'reusable' }  | 
 | 45 | + | 
 | 46 | +  # NIXL TEST IMAGE - Uses base via multi-stage (PR testing only)  | 
 | 47 | +  # Local only: Built from base + NIXL source for validation  | 
 | 48 | +  - { file: 'contrib/Dockerfile.multi-target', name: "nixl-pr-test", tag: "test-${os}-${arch}", target: 'nixl', arch: '${arch}', build_args: 'OS=${os}', category: 'test' }  | 
 | 49 | + | 
 | 50 | +# Build matrix - test both architectures and OS versions  | 
 | 51 | +matrix:  | 
 | 52 | +  axes:  | 
 | 53 | +    arch:  | 
 | 54 | +      - x86_64  | 
 | 55 | +      - aarch64  | 
 | 56 | +    os:  | 
 | 57 | +      - ubuntu22.04  | 
 | 58 | +      - ubuntu24.04  | 
 | 59 | + | 
 | 60 | +# Environment configuration  | 
 | 61 | +env:  | 
 | 62 | +  NIXL_INSTALL_DIR: "/usr/local/nixl"  | 
 | 63 | +  NPROC: "16"  | 
 | 64 | + | 
 | 65 | +# Task naming for parallel execution  | 
 | 66 | +taskName: "${os}/${arch}/${axis_index}"  | 
 | 67 | + | 
 | 68 | +credentials:  | 
 | 69 | +  - credentialsId: 'svc-nixl-artifactory-token'  | 
 | 70 | +    usernameVariable: 'ARTIFACTORY_USERNAME'  | 
 | 71 | +    passwordVariable: 'ARTIFACTORY_PASSWORD'  | 
 | 72 | + | 
 | 73 | +# Build pipeline steps  | 
 | 74 | +steps:  | 
 | 75 | +  - name: Test NIXL with PR Changes  | 
 | 76 | +    parallel: true  | 
 | 77 | +    containerSelector: "{ name: 'nixl-pr-test' }"  | 
 | 78 | +    run: |  | 
 | 79 | +      echo "=== Testing NIXL with PR Changes ==="  | 
 | 80 | +
  | 
 | 81 | +      # Set up environment  | 
 | 82 | +      cd /workspace/nixl  | 
 | 83 | +      export ARCH=$(uname -m)  | 
 | 84 | +      [ "$ARCH" = "arm64" ] && ARCH="aarch64"  | 
 | 85 | +
  | 
 | 86 | +      echo "=== Running C++ Tests ==="  | 
 | 87 | +      if [ -f .gitlab/test_cpp.sh ]; then  | 
 | 88 | +        .gitlab/test_cpp.sh ${NIXL_INSTALL_DIR}  | 
 | 89 | +      else  | 
 | 90 | +        echo 'C++ test script not found, skipping C++ tests'  | 
 | 91 | +      fi  | 
 | 92 | +
  | 
 | 93 | +      echo "=== Running Python Tests ==="  | 
 | 94 | +      if [ -f .gitlab/test_python.sh ]; then  | 
 | 95 | +        .gitlab/test_python.sh ${NIXL_INSTALL_DIR}  | 
 | 96 | +      else  | 
 | 97 | +        echo 'Python test script not found, skipping Python tests'  | 
 | 98 | +      fi  | 
 | 99 | +
  | 
 | 100 | +      echo "✅ All tests completed successfully - PR is ready!"  | 
 | 101 | +
  | 
 | 102 | +# Pipeline completion  | 
 | 103 | +pipeline_stop:  | 
 | 104 | +  shell: action  | 
 | 105 | +  module: groovy  | 
 | 106 | +  run: |  | 
 | 107 | +    def jobStatus = currentBuild.result ?: 'SUCCESS'  | 
 | 108 | +    def statusColor = jobStatus == 'SUCCESS' ? 'green' : 'red'  | 
 | 109 | +
  | 
 | 110 | +    echo "NIXL PR testing completed with status: ${jobStatus}"  | 
 | 111 | +
  | 
 | 112 | +        if (params.MAIL_TO) {  | 
 | 113 | +        def userName = currentBuild.rawBuild.getCause(hudson.model.Cause.UserIdCause)?.userName ?: 'schedule'  | 
 | 114 | +
  | 
 | 115 | +        mail(  | 
 | 116 | +            to: params.MAIL_TO,  | 
 | 117 | +            subject: "NIXL PR Testing [${env.BUILD_NUMBER}] - ${jobStatus}",  | 
 | 118 | +            mimeType: 'text/html',  | 
 | 119 | +            body: """  | 
 | 120 | +                <h3>NIXL PR Testing Results</h3>  | 
 | 121 | +                <p><b>Status:</b> <span style="color: ${statusColor};">${jobStatus}</span></p>  | 
 | 122 | +                <p><b>Build:</b> <a href='${env.BUILD_URL}'>#${env.BUILD_NUMBER}</a></p>  | 
 | 123 | +                <p><b>Images:</b> Base image pushed for reuse, NIXL tested with PR changes</p>  | 
 | 124 | +                <p><a href='${env.BUILD_URL}console'>View Console Output</a></p>  | 
 | 125 | +            """  | 
 | 126 | +        )  | 
 | 127 | +    }  | 
0 commit comments