Skip to content

Commit 5ec2821

Browse files
committed
ci: Fix wheel build test and publish (#595)
Signed-off-by: Charlie Truong <chtruong@nvidia.com>
1 parent 51ae152 commit 5ec2821

File tree

4 files changed

+121
-269
lines changed

4 files changed

+121
-269
lines changed

.github/workflows/build-test-publish-wheel.yml

Lines changed: 54 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -28,52 +28,60 @@ defaults:
2828

2929
jobs:
3030
pre-flight:
31-
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cicd_preflight.yml@v0.64.2
31+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cicd_preflight.yml@v0.70.1
32+
with:
33+
default_runner_prefix: ${{ vars.DEFAULT_RUNNER_PREFIX }}
34+
non_nvidia_runner_prefix: ${{ vars.NON_NVIDIA_RUNNER_PREFIX }}
35+
default_test_data_path: ${{ vars.DEFAULT_TEST_DATA_PATH }}
36+
non_nvidia_test_data_path: ${{ vars.NON_NVIDIA_TEST_DATA_PATH }}
37+
secrets:
38+
NVIDIA_MANAGEMENT_ORG_PAT: ${{ secrets.NVIDIA_MANAGEMENT_ORG_PAT }}
3239

33-
# build-test-publish-wheel:
34-
# needs: [pre-flight]
35-
# if: |
36-
# !(needs.pre-flight.outputs.docs_only == 'true'
37-
# || needs.pre-flight.outputs.is_deployment_workflow == 'true')
38-
# uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_test_publish_wheel.yml@v0.48.0
39-
# with:
40-
# dry-run: true
41-
# python-package: nemo_export_deploy_common
42-
# python-version: "3.10"
43-
# packaging: uv
44-
# no-publish: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/r')) }}
45-
# skip-test-wheel: true
46-
# custom-container: nvcr.io/nvidia/pytorch:25.11-py3
47-
# no-build-isolation: true
48-
# runner: linux-amd64-cpu16
49-
# secrets:
50-
# TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
51-
# TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
52-
# SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }}
53-
# SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }}
54-
# GH_TOKEN: ${{ secrets.PAT }}
40+
build-test-publish-wheel:
41+
needs: [pre-flight]
42+
if: |
43+
!(needs.pre-flight.outputs.docs_only == 'true'
44+
|| needs.pre-flight.outputs.is_deployment_workflow == 'true')
45+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_test_publish_wheel.yml@v0.70.1
46+
with:
47+
dry-run: true
48+
python-package: nemo_export_deploy_common
49+
python-version: "3.10"
50+
packaging: uv
51+
no-publish: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/r')) }}
52+
skip-test-wheel: true
53+
custom-container: nvcr.io/nvidia/pytorch:25.11-py3
54+
no-build-isolation: true
55+
runner: ${{ needs.pre-flight.outputs.runner_prefix }}-gpu-x2-container
56+
container-options: "--gpus all --runtime=nvidia"
57+
secrets:
58+
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
59+
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
60+
SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }}
61+
SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }}
62+
GH_TOKEN: ${{ secrets.PAT }}
5563

56-
# build-test-publish-wheel-summary:
57-
# needs: [pre-flight, build-test-publish-wheel]
58-
# if: |
59-
# (
60-
# needs.pre-flight.outputs.docs_only == 'true'
61-
# || needs.pre-flight.outputs.is_deployment_workflow == 'true'
62-
# || always()
63-
# )
64-
# && !cancelled()
65-
# runs-on: ubuntu-latest
66-
# steps:
67-
# - name: Result
68-
# run: |
69-
# FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0
64+
build-test-publish-wheel-summary:
65+
needs: [pre-flight, build-test-publish-wheel]
66+
if: |
67+
(
68+
needs.pre-flight.outputs.docs_only == 'true'
69+
|| needs.pre-flight.outputs.is_deployment_workflow == 'true'
70+
|| always()
71+
)
72+
&& !cancelled()
73+
runs-on: ubuntu-latest
74+
steps:
75+
- name: Result
76+
run: |
77+
FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0
7078
71-
# if [ "${FAILED_JOBS:-0}" -eq 0 ] || [ "$SKIPPING_IS_ALLOWED" == "true" ]; then
72-
# echo "✅ All previous jobs completed successfully"
73-
# exit 0
74-
# else
75-
# echo "❌ Found $FAILED_JOBS failed job(s)"
76-
# # Show which jobs failed
77-
# gh run view $GITHUB_RUN_ID --json jobs --jq '.jobs[] | select(.status == "completed" and .conclusion != "success") | .name'
78-
# exit 1
79-
# fi
79+
if [ "${FAILED_JOBS:-0}" -eq 0 ] || [ "$SKIPPING_IS_ALLOWED" == "true" ]; then
80+
echo "✅ All previous jobs completed successfully"
81+
exit 0
82+
else
83+
echo "❌ Found $FAILED_JOBS failed job(s)"
84+
# Show which jobs failed
85+
gh run view $GITHUB_RUN_ID --json jobs --jq '.jobs[] | select(.status == "completed" and .conclusion != "success") | .name'
86+
exit 1
87+
fi

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
skip-test-wheel: true
5555
custom-container: nvcr.io/nvidia/pytorch:25.11-py3
5656
no-build-isolation: true
57-
runner: linux-amd64-cpu16
57+
runner: nemo-ci-aws-gpu-x2-container
5858
secrets:
5959
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
6060
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
[build-system]
16-
requires = ["setuptools>=42", "wheel", "cython>=3.0.0"]
16+
requires = ["setuptools>=42", "wheel", "cython>=3.0.0", "torch"]
1717
build-backend = "setuptools.build_meta"
1818

1919
[tool.setuptools]
@@ -136,6 +136,9 @@ default-groups = ["linting", "build", "test"]
136136
link-mode = "copy"
137137
conflicts = [[{ extra = "trtllm" }, { extra = "vllm" }, { extra = "trt-onnx" }]]
138138
override-dependencies = [
139+
"torch; sys_platform == 'never'",
140+
"torchvision; sys_platform == 'never'",
141+
"triton; sys_platform == 'never'",
139142
"urllib3>1.27.0",
140143
"tiktoken>=0.9.0", # because nemo-toolkit and megatron-bridge disagree on tiktoken, we need to pin it here,
141144
"fsspec[http]>=2023.1.0,<=2024.9.0",

0 commit comments

Comments
 (0)