|
1 | 1 | # SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
2 | 2 | # SPDX-License-Identifier: Apache-2.0
|
3 | 3 |
|
4 |
| -name: NVIDIA Dynamo Backends Github Validation |
| 4 | +name: Docker Build and Test |
5 | 5 |
|
6 | 6 | on:
|
7 | 7 | push:
|
8 | 8 | branches:
|
9 | 9 | - main
|
10 | 10 | - "pull-request/[0-9]+"
|
11 | 11 |
|
| 12 | +concurrency: |
| 13 | + group: ${{ github.workflow }}-build-test-${{ github.ref_name || github.run_id }} |
| 14 | + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 15 | + |
12 | 16 | jobs:
|
13 |
| - build-test: |
14 |
| - runs-on: gpu-l40-amd64 |
15 |
| - strategy: |
16 |
| - fail-fast: false |
17 |
| - matrix: |
18 |
| - framework: [vllm, sglang, trtllm] |
19 |
| - include: |
20 |
| - - framework: vllm |
21 |
| - target: runtime |
22 |
| - pytest_marks: "e2e and vllm and gpu_1 and not slow" |
23 |
| - - framework: sglang |
24 |
| - target: runtime |
25 |
| - pytest_marks: "e2e and sglang and gpu_1 and not slow" |
26 |
| - - framework: trtllm |
27 |
| - target: runtime |
28 |
| - pytest_marks: "e2e and trtllm_marker and gpu_1 and not slow" |
| 17 | + changed-files: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + outputs: |
| 20 | + has_code_changes: ${{ steps.filter.outputs.has_code_changes }} |
| 21 | + steps: |
| 22 | + - name: Checkout code |
| 23 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 |
| 24 | + - name: Check for changes |
| 25 | + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 |
| 26 | + id: filter |
| 27 | + with: |
| 28 | + filters: .github/filters.yaml |
29 | 29 |
|
30 |
| - # Do not cancel main branch runs |
31 |
| - concurrency: |
32 |
| - group: ${{ github.workflow }}-${{ matrix.framework }}-build-test-${{ github.ref_name || github.run_id }} |
33 |
| - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} |
| 30 | + backend-status-check: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + needs: [vllm, sglang, trtllm] |
| 33 | + if: always() |
| 34 | + steps: |
| 35 | + - name: "Check all dependent jobs" |
| 36 | + run: | |
| 37 | + echo '${{ toJson(needs) }}' | jq -e 'to_entries | map(.value.result) | all(. as $result | ["success", "skipped"] | any($result == .))' |
34 | 38 |
|
35 |
| - name: Build and Test - ${{ matrix.framework }} |
36 |
| - env: |
37 |
| - CONTAINER_ID: test_${{ github.run_id }}_${{ github.run_attempt }}_${{ github.job }}_${{ matrix.framework }} |
38 |
| - PYTEST_XML_FILE: pytest_test_report.xml |
39 |
| - FRAMEWORK: ${{ matrix.framework }} |
40 |
| - TARGET: ${{ matrix.target }} |
41 |
| - PYTEST_MARKS: ${{ matrix.pytest_marks }} |
| 39 | + vllm: |
| 40 | + runs-on: gpu-l40-amd64 |
| 41 | + needs: changed-files |
| 42 | + if: needs.changed-files.outputs.has_code_changes == 'true' |
| 43 | + steps: |
| 44 | + - name: Checkout code |
| 45 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 |
| 46 | + - name: Build Container |
| 47 | + id: build-image |
| 48 | + uses: ./.github/actions/docker-build |
| 49 | + with: |
| 50 | + framework: vllm |
| 51 | + target: runtime |
| 52 | + ngc_ci_access_token: ${{ secrets.NGC_CI_ACCESS_TOKEN }} |
| 53 | + ci_token: ${{ secrets.CI_TOKEN }} |
| 54 | + aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }} |
| 55 | + sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }} |
| 56 | + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 57 | + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 58 | + - name: Run tests |
| 59 | + uses: ./.github/actions/pytest |
| 60 | + with: |
| 61 | + image_tag: ${{ steps.build-image.outputs.image_tag }} |
| 62 | + pytest_marks: "e2e and vllm and gpu_1 and not slow" |
42 | 63 |
|
| 64 | + sglang: |
| 65 | + runs-on: gpu-l40-amd64 |
| 66 | + needs: changed-files |
| 67 | + if: needs.changed-files.outputs.has_code_changes == 'true' |
43 | 68 | steps:
|
44 | 69 | - name: Checkout repository
|
45 |
| - uses: actions/checkout@v4 |
46 |
| - - name: Set up Docker Buildx |
47 |
| - uses: docker/setup-buildx-action@v3 |
48 |
| - - name: Login to NGC |
49 |
| - if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'push' |
50 |
| - run: | |
51 |
| - echo "${{ secrets.NGC_CI_ACCESS_TOKEN }}" | docker login nvcr.io -u '$oauthtoken' --password-stdin |
52 |
| - - name: Cleanup |
53 |
| - if: always() |
54 |
| - run: | |
55 |
| - docker system prune -af |
56 |
| - - name: Build image |
57 |
| - env: |
58 |
| - GITHUB_TOKEN: ${{ secrets.CI_TOKEN }} |
59 |
| - AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
60 |
| - SCCACHE_S3_BUCKET: ${{ secrets.SCCACHE_S3_BUCKET }} |
61 |
| - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
62 |
| - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
63 |
| - run: | |
64 |
| - ./container/build.sh --tag ${{ matrix.framework }}:latest \ |
65 |
| - --target ${{ matrix.target }} \ |
66 |
| - --framework ${{ matrix.framework }} \ |
67 |
| - --use-sccache \ |
68 |
| - --sccache-bucket "$SCCACHE_S3_BUCKET" \ |
69 |
| - --sccache-region "$AWS_DEFAULT_REGION" |
70 |
| - - name: Run pytest |
71 |
| - env: |
72 |
| - HF_HOME: /runner/_work/_temp |
73 |
| - run: | |
74 |
| - docker run --runtime=nvidia --rm --gpus all -w /workspace \ |
75 |
| - --network host \ |
76 |
| - --name ${{ env.CONTAINER_ID }}_pytest \ |
77 |
| - ${{ matrix.framework }}:latest \ |
78 |
| - bash -c "pytest -xsv --basetemp=/tmp --junitxml=${{ env.PYTEST_XML_FILE }} -m \"${{ env.PYTEST_MARKS }}\"" |
| 70 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 |
| 71 | + - name: Build Container |
| 72 | + id: build-image |
| 73 | + uses: ./.github/actions/docker-build |
| 74 | + with: |
| 75 | + framework: sglang |
| 76 | + target: runtime |
| 77 | + ngc_ci_access_token: ${{ secrets.NGC_CI_ACCESS_TOKEN }} |
| 78 | + ci_token: ${{ secrets.CI_TOKEN }} |
| 79 | + aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }} |
| 80 | + sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }} |
| 81 | + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 82 | + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 83 | + - name: Run tests |
| 84 | + uses: ./.github/actions/pytest |
| 85 | + with: |
| 86 | + image_tag: ${{ steps.build-image.outputs.image_tag }} |
| 87 | + pytest_marks: "e2e and sglang and gpu_1" |
| 88 | + |
| 89 | + trtllm: |
| 90 | + runs-on: gpu-l40-amd64 |
| 91 | + needs: changed-files |
| 92 | + if: needs.changed-files.outputs.has_code_changes == 'true' |
| 93 | + steps: |
| 94 | + - name: Checkout code |
| 95 | + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 |
| 96 | + - name: Build Container |
| 97 | + id: build-image |
| 98 | + uses: ./.github/actions/docker-build |
| 99 | + with: |
| 100 | + framework: trtllm |
| 101 | + target: runtime |
| 102 | + ngc_ci_access_token: ${{ secrets.NGC_CI_ACCESS_TOKEN }} |
| 103 | + ci_token: ${{ secrets.CI_TOKEN }} |
| 104 | + aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }} |
| 105 | + sccache_s3_bucket: ${{ secrets.SCCACHE_S3_BUCKET }} |
| 106 | + aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 107 | + aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 108 | + - name: Run tests |
| 109 | + uses: ./.github/actions/pytest |
| 110 | + with: |
| 111 | + image_tag: ${{ steps.build-image.outputs.image_tag }} |
| 112 | + pytest_marks: "e2e and trtllm_marker and gpu_1 and not slow" |
0 commit comments