Unverified Commit 9a3212b8 authored by Alec's avatar Alec Committed by GitHub
Browse files

ci: improve CI rules to run CI only when needed (#5025)


Signed-off-by: default avataralec-flowers <aflowers@nvidia.com>
parent 6aa4c694
...@@ -2,27 +2,42 @@ docs: &docs ...@@ -2,27 +2,42 @@ docs: &docs
- 'docs/**' - 'docs/**'
- '**/*.md' - '**/*.md'
- '**/*.rst' - '**/*.rst'
- '**/*.txt'
ci: &ci ci: &ci
- '.github/workflows/**' - '.github/workflows/**'
- '.github/filters.yaml' - '.github/filters.yaml'
- '.github/actions/**' - '.github/actions/**'
has_code_changes: core:
- *ci - *ci
- 'benchmarks/**' - 'container/build.sh'
- 'components/**' - 'container/deps/*'
- 'container/**'
- 'deploy/**'
- 'examples/**'
- 'launch/**'
- 'lib/**' - 'lib/**'
- 'recipes/**'
- 'tests/**' - 'tests/**'
- 'components/src/dynamo/router/**'
- 'components/src/dynamo/mocker/**'
- 'components/src/dynamo/frontend/**'
- 'components/src/dynamo/common/**'
- '*.toml' - '*.toml'
- '*.lock' - '*.lock'
- '*.py' - '*.py'
- '*.rs' - '*.rs'
- '!**/*.md' # Avoid running on doc changes
- '!**/*.rst' # Avoid running on doc changes
- '!**/*.txt' # Avoid running on doc changes
operator:
- *ci
- 'deploy/cloud/operator/**'
deploy:
- 'deploy/cloud/helm/**'
- 'deploy/utils/**'
planner:
- 'components/src/dynamo/planner/**'
- 'tests/planner/**'
vllm: &vllm vllm: &vllm
- 'container/Dockerfile.vllm' - 'container/Dockerfile.vllm'
...@@ -30,24 +45,14 @@ vllm: &vllm ...@@ -30,24 +45,14 @@ vllm: &vllm
- 'container/deps/vllm/**' - 'container/deps/vllm/**'
- 'examples/backends/vllm/**' - 'examples/backends/vllm/**'
- 'components/src/dynamo/vllm/**' - 'components/src/dynamo/vllm/**'
- 'container/build.sh'
- 'tests/serve/test_vllm.py'
sglang: &sglang sglang: &sglang
- 'container/Dockerfile.sglang' - 'container/Dockerfile.sglang'
- 'examples/backends/sglang/**' - 'examples/backends/sglang/**'
- 'components/src/dynamo/sglang/**' - 'components/src/dynamo/sglang/**'
- 'container/build.sh'
- 'tests/serve/test_sglang.py'
trtllm: &trtllm trtllm: &trtllm
- 'container/Dockerfile.trtllm' - 'container/Dockerfile.trtllm'
- 'examples/backends/trtllm/**' - 'examples/backends/trtllm/**'
- 'components/src/dynamo/trtllm/**' - 'components/src/dynamo/trtllm/**'
- 'container/build.sh'
- 'container/build_trtllm_wheel.sh' - 'container/build_trtllm_wheel.sh'
- 'container/deps/**'
- 'tests/serve/test_trtllm.py'
sdk:
- 'deploy/**'
...@@ -30,7 +30,12 @@ jobs: ...@@ -30,7 +30,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
environment: ${{ github.event_name == 'workflow_dispatch' && 'protected-deploy' || '' }} environment: ${{ github.event_name == 'workflow_dispatch' && 'protected-deploy' || '' }}
outputs: outputs:
has_code_changes: ${{ steps.filter.outputs.has_code_changes }} core: ${{ steps.filter.outputs.core }}
operator: ${{ steps.filter.outputs.operator }}
deploy: ${{ steps.filter.outputs.deploy }}
vllm: ${{ steps.filter.outputs.vllm }}
sglang: ${{ steps.filter.outputs.sglang }}
trtllm: ${{ steps.filter.outputs.trtllm }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
...@@ -51,7 +56,7 @@ jobs: ...@@ -51,7 +56,7 @@ jobs:
operator: operator:
needs: changed-files needs: changed-files
if: needs.changed-files.outputs.has_code_changes == 'true' if: needs.changed-files.outputs.operator == 'true'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -127,7 +132,7 @@ jobs: ...@@ -127,7 +132,7 @@ jobs:
vllm: vllm:
needs: changed-files needs: changed-files
if: needs.changed-files.outputs.has_code_changes == 'true' if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.vllm == 'true'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -194,7 +199,7 @@ jobs: ...@@ -194,7 +199,7 @@ jobs:
sglang: sglang:
needs: changed-files needs: changed-files
if: needs.changed-files.outputs.has_code_changes == 'true' if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.sglang == 'true'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -255,7 +260,7 @@ jobs: ...@@ -255,7 +260,7 @@ jobs:
trtllm: trtllm:
needs: changed-files needs: changed-files
if: needs.changed-files.outputs.has_code_changes == 'true' if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.trtllm == 'true'
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
...@@ -316,7 +321,7 @@ jobs: ...@@ -316,7 +321,7 @@ jobs:
deploy-operator: deploy-operator:
runs-on: cpu-amd-m5-2xlarge runs-on: cpu-amd-m5-2xlarge
if: needs.changed-files.outputs.has_code_changes == 'true' if: needs.changed-files.outputs.core == 'true'
needs: [changed-files, operator, vllm, sglang, trtllm] needs: [changed-files, operator, vllm, sglang, trtllm]
env: env:
DYNAMO_INGRESS_SUFFIX: dev.aire.nvidia.com DYNAMO_INGRESS_SUFFIX: dev.aire.nvidia.com
...@@ -581,7 +586,7 @@ jobs: ...@@ -581,7 +586,7 @@ jobs:
# - Run rest of jobs only on push to main or manual trigger # - Run rest of jobs only on push to main or manual trigger
deploy-test-vllm-disagg-router: deploy-test-vllm-disagg-router:
runs-on: cpu-amd-m5-2xlarge runs-on: cpu-amd-m5-2xlarge
if: needs.changed-files.outputs.has_code_changes == 'true' if: needs.changed-files.outputs.core == 'true' || needs.changed-files.outputs.vllm == 'true' || needs.changed-files.outputs.deploy == 'true'
needs: [changed-files, deploy-operator, vllm] needs: [changed-files, deploy-operator, vllm]
permissions: permissions:
contents: read contents: read
......
...@@ -16,7 +16,31 @@ concurrency: ...@@ -16,7 +16,31 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }} cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs: jobs:
changed-files:
runs-on: ubuntu-latest
outputs:
core: ${{ steps.filter.outputs.core }}
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: Check for changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: .github/filters.yaml
dynamo-status-check:
runs-on: ubuntu-latest
needs: [build-test]
if: always()
steps:
- name: "Check build-test result"
run: |
echo '${{ toJson(needs) }}' | jq -e 'to_entries | map(.value.result) | all(. as $result | ["success", "skipped"] | any($result == .))'
build-test: build-test:
needs: changed-files
if: needs.changed-files.outputs.core == 'true'
runs-on: runs-on:
group: Fastchecker group: Fastchecker
name: Build and Test - dynamo name: Build and Test - dynamo
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment