Skip to content

Commit 8491fe4

Browse files
chtruong814claude
andcommitted
ci: build container once and share across downstream tests (#661)
Signed-off-by: Charlie Truong <chtruong@nvidia.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Charlie Truong <chtruong@nvidia.com>
1 parent 1fba42f commit 8491fe4

8 files changed

Lines changed: 419 additions & 246 deletions

File tree

‎.github/actions/test-template/action.yml‎

Lines changed: 44 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -34,57 +34,25 @@ inputs:
3434
description: "Run tests on CPU only"
3535
required: false
3636
default: "false"
37-
azure-client-id:
38-
description: "Azure Client ID"
39-
required: true
40-
azure-tenant-id:
41-
description: "Azure Tenant ID"
42-
required: true
43-
azure-subscription-id:
44-
description: "Azure Subscription ID"
45-
required: true
46-
has-azure-credentials:
47-
description: "Has Azure credentials"
48-
required: false
49-
default: "false"
5037
PAT:
5138
description: "GitHub Personal Access Token"
5239
required: true
40+
container-image:
41+
description: "Pre-built container image to use for test"
42+
required: true
5343
inference-framework:
54-
description: "Inference Framework"
44+
description: "Inference framework extra to install at runtime (trtllm, vllm, trt-onnx, inframework)"
5545
required: true
5646
test-data-path:
5747
description: "Test data path"
5848
required: true
5949
runner:
6050
description: "The GHA runner to use"
6151
required: true
62-
ngc-api-user:
63-
description: "NGC API User"
64-
required: false
65-
ngc-api-key:
66-
description: "NGC API Key"
67-
required: false
6852

6953
runs:
7054
using: "composite"
7155
steps:
72-
- name: Install Azure CLI
73-
if: ${{ inputs.has-azure-credentials == 'true' }}
74-
shell: bash
75-
run: |
76-
echo ::group::Install Azure CLI
77-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
78-
echo ::endgroup::
79-
80-
- name: Azure Login
81-
if: ${{ inputs.has-azure-credentials == 'true' }}
82-
uses: azure/login@v2
83-
with:
84-
client-id: ${{ inputs.azure-client-id }}
85-
tenant-id: ${{ inputs.azure-tenant-id }}
86-
subscription-id: ${{ inputs.azure-subscription-id }}
87-
8856
- name: Install uuidgen
8957
shell: bash -x -e -u -o pipefail {0}
9058
if: ${{ contains(inputs.runner, 'aws') }}
@@ -98,37 +66,6 @@ runs:
9866
path: Export-Deploy
9967

10068

101-
- name: Cache uv
102-
uses: actions/cache@v4
103-
id: cache
104-
with:
105-
path: cache-mount
106-
key: ${{ runner.os }}-uv-${{ hashFiles('**/uv.lock') }}
107-
108-
- name: Login to NGC
109-
if: ${{ inputs.ngc-api-user != '' && inputs.ngc-api-key != '' }}
110-
shell: bash
111-
run: |
112-
echo ::group::Use credentials
113-
echo ${{ inputs.ngc-api-key }} | docker login -u '${{ inputs.ngc-api-user }}' --password-stdin nvcr.io
114-
echo ::endgroup::
115-
116-
- name: Restore Docker cache mounts
117-
uses: reproducible-containers/buildkit-cache-dance@5b81f4d29dc8397a7d341dba3aeecc7ec54d6361
118-
with:
119-
cache-dir: cache-mount
120-
dockerfile: docker/Dockerfile.pytorch
121-
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
122-
123-
- name: Build container
124-
shell: bash
125-
env:
126-
GH_TOKEN: ${{ inputs.PAT }}
127-
run: |
128-
echo ::group::Build test container
129-
docker build -f docker/Dockerfile.pytorch --build-arg INFERENCE_FRAMEWORK=${{ inputs.inference-framework }} --secret id=GH_TOKEN -t export-deploy .
130-
echo ::endgroup::
131-
13269
- name: Start container
13370
shell: bash
13471
run: |
@@ -154,7 +91,7 @@ runs:
15491
--workdir /workspace \
15592
--volume $(pwd)/Export-Deploy:/workspace \
15693
--volume ${{ inputs.test-data-path }}:/home/TestData \
157-
export-deploy \
94+
${{ inputs.container-image }} \
15895
bash -c "sleep $(( ${{ inputs.timeout }} * 60 + 60 ))"
15996
RUN_TEST_EOF
16097
)
@@ -163,6 +100,45 @@ runs:
163100
bash retry_job.sh
164101
echo ::endgroup::
165102
103+
- name: Install framework deps
104+
if: ${{ inputs.inference-framework != 'inframework' }}
105+
shell: bash
106+
run: |
107+
echo ::group::Install ${{ inputs.inference-framework }} dependencies
108+
docker exec nemo_container_${{ github.run_id }} bash -c '
109+
uv sync --extra ${{ inputs.inference-framework }} --locked --all-groups \
110+
--no-install-package torch \
111+
--no-install-package torchvision \
112+
--no-install-package triton \
113+
--no-install-package nvidia-cublas-cu12 \
114+
--no-install-package nvidia-cuda-cupti-cu12 \
115+
--no-install-package nvidia-cuda-nvrtc-cu12 \
116+
--no-install-package nvidia-cuda-runtime-cu12 \
117+
--no-install-package nvidia-cudnn-cu12 \
118+
--no-install-package nvidia-cufft-cu12 \
119+
--no-install-package nvidia-cufile-cu12 \
120+
--no-install-package nvidia-curand-cu12 \
121+
--no-install-package nvidia-cusolver-cu12 \
122+
--no-install-package nvidia-cusparse-cu12 \
123+
--no-install-package nvidia-cusparselt-cu12 \
124+
--no-install-package nvidia-nccl-cu12 \
125+
--no-install-package nvidia-cublas \
126+
--no-install-package nvidia-cuda-cupti \
127+
--no-install-package nvidia-cuda-nvrtc \
128+
--no-install-package nvidia-cuda-runtime \
129+
--no-install-package nvidia-cudnn-cu13 \
130+
--no-install-package nvidia-cufft \
131+
--no-install-package nvidia-cufile \
132+
--no-install-package nvidia-curand \
133+
--no-install-package nvidia-cusolver \
134+
--no-install-package nvidia-cusparse \
135+
--no-install-package nvidia-cusparselt-cu13 \
136+
--no-install-package nvidia-nccl-cu13 \
137+
--no-install-package tensorrt-llm \
138+
--no-install-package vllm
139+
'
140+
echo ::endgroup::
141+
166142
- name: Create run-script
167143
id: create
168144
shell: bash

0 commit comments

Comments
 (0)