Commit 37a8ebaf authored by Harrison Saturley-Hall's avatar Harrison Saturley-Hall Committed by GitHub
Browse files
parent f229b41b
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: PR Reminder Full CI Comment Bot
on:
pull_request_target:
types: [opened]
jobs:
pr_reminder:
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
permissions:
actions: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Reminder to run full CI on PR
uses: actions/github-script@v7
env:
REPOSITORY: ${{ github.repository }}
CONTRIBUTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
script: |
const { REPOSITORY, CONTRIBUTOR } = process.env
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `👋 Hi ${CONTRIBUTOR}! Thank you for contributing to ${REPOSITORY}.\n\n` +
'Just a reminder: The `NVIDIA Test Github Validation` CI runs an essential subset of the testing framework to quickly catch errors.' +
'Your PR reviewers may elect to test the changes comprehensively before approving your changes.\n\n' +
'🚀'
})
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: NVIDIA Test Github Validation
on:
pull_request:
paths-ignore:
- 'deploy/Kubernetes/**'
- '**/*.md'
jobs:
build-test:
runs-on: ${{ fromJSON(vars.PR_FASTCHECK_RUNNERS) }}
strategy:
matrix:
framework:
- standard
- vllm
name: Build and Test - ${{ matrix.framework }}
env:
CONTAINER_ID: test_${{ github.run_id }}_${{ github.run_attempt }}_${{ github.job }}_${{ matrix.framework }}
IMAGE_TAG: ghcr.io/triton-inference-server/triton_distributed:pr_${{ github.event.pull_request.number}}_${{ matrix.framework }}
PYTEST_XML_FILE: pytest_test_report.xml
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Decide on cache
id: which_cache
env:
DEFAULT_CACHE_LOCATION: ghcr.io/triton-inference-server/triton_distributed:buildcache_${{ matrix.framework }}
run: |
set +e
docker manifest inspect ${{ env.IMAGE_TAG }}
if [ $? -eq 0 ]; then
echo "USING ${{ env.IMAGE_TAG }}"
echo "cache_from_location=${{ env.IMAGE_TAG }}" >> $GITHUB_OUTPUT
else
echo "USING ${{ env.DEFAULT_CACHE_LOCATION }}"
echo "cache_from_location=${{ env.DEFAULT_CACHE_LOCATION }}" >> $GITHUB_OUTPUT
fi
echo "cache_to_location=${{ env.IMAGE_TAG }}" >> $GITHUB_OUTPUT
- name: Build image
env:
CACHE_FROM: "type=registry,ref=${{ steps.which_cache.outputs.cache_from_location }}"
CACHE_TO: "type=registry,ref=${{ steps.which_cache.outputs.cache_to_location }},image-manifest=true,mode=max"
run: |
./container/build.sh --tag $IMAGE_TAG --framework ${{ matrix.framework }} --cache-from "${{ env.CACHE_FROM }}" --cache-to "${{ env.CACHE_TO }}"
- name: Run pytest
env:
PYTEST_MARKS: "pre_merge or mypy"
run: |
docker run -w /workspace --name ${{ env.CONTAINER_ID }} ${{ env.IMAGE_TAG }} pytest --basetemp=/tmp --junitxml=${{ env.PYTEST_XML_FILE }} -m "${{ env.PYTEST_MARKS }}"
- name: Copy test report from test Container
if: always()
run: |
docker cp ${{ env.CONTAINER_ID }}:/workspace/${{ env.PYTEST_XML_FILE }} .
- name: Archive test report
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.framework }}-python-test-results
if-no-files-found: error
path: |
${{ env.PYTEST_XML_FILE }}
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: Event File
path: ${{ github.event_path }}
......@@ -72,6 +72,34 @@ jobs:
timeout-minutes: 2
working-directory: /workspace
codeql:
name: Analyze Codebase
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{matrix.language}}
queries: +security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
# providers_validation:
# runs-on: ubuntu-latest
# container:
......
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: 'Test Report'
on:
workflow_run:
workflows: ['NVIDIA Test Github Validation']
types:
- completed
jobs:
test-results:
name: Test Results
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'
permissions:
checks: write
# required by download step to access artifacts API
actions: read
# needed unless run with comment_mode: off
pull-requests: write
# only needed for private repository
contents: read
issues: read
steps:
- name: Download and Extract Artifacts
uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
with:
run_id: ${{ github.event.workflow_run.id }}
path: artifacts
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
with:
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
\ No newline at end of file
......@@ -38,8 +38,14 @@ center scale without sacrificing performance or ease of use.
## Building Triton Distributed
### Requirements
Triton Distributed development and examples are container based.
* [Docker](https://docs.docker.com/get-started/get-docker/)
* [buildx](https://github.com/docker/buildx)
### Development
You can build the Triton Distributed container using the build scripts
in `container/` (or directly with `docker build`).
......
......@@ -183,6 +183,14 @@ get_options() {
missing_requirement $1
fi
;;
--cache-to)
if [ "$2" ]; then
CACHE_TO="--cache-to $2"
shift
else
missing_requirement $1
fi
;;
--build-context)
if [ "$2" ]; then
BUILD_CONTEXT_ARG="--build-context $2"
......@@ -282,6 +290,8 @@ show_help() {
echo " [--tensorrtllm-backend-rebuild whether or not to rebuild the backend]"
echo " [--skip-clone-tensorrtllm whether or not to skip cloning the trt-llm backend repo]"
echo " [--build-arg additional build args to pass to docker build]"
echo " [--cache-from cache location to start from]"
echo " [--cache-to location where to cache the build output]"
echo " [--tag tag for image]"
echo " [--no-cache disable docker build cache]"
echo " [--dry-run print docker commands without running]"
......@@ -341,7 +351,7 @@ if [ -z "$RUN_PREFIX" ]; then
set -x
fi
$RUN_PREFIX docker build -f $DOCKERFILE $TARGET_STR $PLATFORM $BUILD_ARGS $CACHE_FROM $TAG $LATEST_TAG $BUILD_CONTEXT_ARG $BUILD_CONTEXT $NO_CACHE
$RUN_PREFIX docker buildx build -f $DOCKERFILE $TARGET_STR $PLATFORM $BUILD_ARGS $CACHE_FROM $CACHE_TO --output type=docker $TAG $LATEST_TAG $BUILD_CONTEXT_ARG $BUILD_CONTEXT $NO_CACHE
{ set +x; } 2>/dev/null
......
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