dlxj commited on
Commit ·
a7c2243
1
Parent(s): 996beb7
init
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .coveragercAdded+36
- .dockerignoreAdded+19
- .flake8Added+9
- .flake8.otherAdded+9
- .flake8.speechAdded+9
- .gitattributes+1
- .github/CODEOWNERSAdded
- .github/ISSUE_TEMPLATE/bug_report.mdAdded+42
- .github/ISSUE_TEMPLATE/config.ymlAdded+2
- .github/ISSUE_TEMPLATE/dev_container_bug_report.mdAdded+35
- .github/ISSUE_TEMPLATE/feature_request.mdAdded+25
- .github/PULL_REQUEST_TEMPLATE.mdAdded+57
- .github/actions/cancel-workflow/action.ymlAdded+25
- .github/actions/test-template/action.ymlAdded+231
- .github/labeler.ymlAdded+41
- .github/scripts/__init__.pyAdded
- .github/scripts/notify.pyAdded+79
- .github/workflows/_build_container.ymlAdded+89
- .github/workflows/_bump_mcore_tag.ymlAdded+56
- .github/workflows/build-docs.ymlAdded+76
- .github/workflows/build-test-publish-wheel.ymlAdded+38
- .github/workflows/cherry-pick-release-commit.ymlAdded+14
- .github/workflows/cicd-approve-test-queue.ymlAdded+175
- .github/workflows/cicd-main-speech.ymlAdded+483
- .github/workflows/cicd-main-unit-tests.ymlAdded+105
- .github/workflows/cicd-main.ymlAdded+395
- .github/workflows/cicd-relabel-bot.ymlAdded+36
- .github/workflows/claude-answer.ymlAdded+65
- .github/workflows/claude-fix.ymlAdded+114
- .github/workflows/claude-review.ymlAdded+58
- .github/workflows/close-inactive-issue-pr.ymlAdded+25
- .github/workflows/code-formatting.ymlAdded+73
- .github/workflows/code-init-file-checker.ymlAdded+23
- .github/workflows/code-linting.ymlAdded+160
- .github/workflows/codeql.ymlAdded+75
- .github/workflows/community-bot.ymlAdded+15
- .github/workflows/config/changelog-config.jsonAdded+134
- .github/workflows/config/codeql.ymlAdded+9
- .github/workflows/copyright-check.ymlAdded+22
- .github/workflows/install-test.ymlAdded+283
- .github/workflows/labeler.ymlAdded+14
- .github/workflows/mcore-tag-bump-bot.ymlAdded+62
- .github/workflows/monitor-single-vm.ymlAdded+54
- .github/workflows/monitor-vms.ymlAdded+54
- .github/workflows/release-docs.ymlAdded+123
- .github/workflows/release-freeze.ymlAdded+85
- .github/workflows/release-nightly-docs.ymlAdded+29
- .github/workflows/release.ymlAdded+83
- .github/workflows/secrets-detector.ymlAdded+43
- .github/workflows/update-buildcache.ymlAdded+110
123456789101112131415161718192021222324252627282930313233343536[run]concurrency = thread,multiprocessingomit = /tmp/* /home/TestData/* /workspace/Megatron-LM/* nemo/collections/multimodal/* nemo/collections/multimodal_autoregressive/* nemo/collections/vision/* nemo/collections/diffusion/* nemo/collections/nlp/*
nemo/collections/asr/* nemo/collections/speechlm/* nemo/collections/tts/*
# omit from audio nemo/collections/audio/data/data_simulation.py nemo/collections/audio/metrics/squim.py nemo/collections/audio/losses/maxine/* nemo/collections/audio/models/maxine/* nemo/collections/audio/parts/utils/maxine.py
nemo/core/* nemo/collections/common/*
/workspace/config-3.12.py /workspace/config-3.py /workspace/config.py
[paths]source = nemo/ /home/runner/work/NeMo/NeMo/nemo /workspace/nemo
12345678910111213141516171819__pycache__*.pyc*.pyo*.pyd.Pythonenvpip-log.txtpip-delete-this-directory.txt.tox.coverage.coverage.*.cachenosetests.xmlcoverage.xml*,cover*.log.git**/*.nemo**/*.ckpt123456789[flake8]max-line-length = 119select = F541, # f-string without any placeholders F841, # local variable 'x' is assigned to but never used F401, # 'x' imported but unused E741, # ambiguous variable name 'l' F821, # undefined name 'x' E266, # too many leading '#' for block comment123456789[flake8]max-line-length = 119select = F541, # f-string without any placeholders F841, # local variable 'x' is assigned to but never used F401, # 'x' imported but unused E741, # ambiguous variable name 'l' F821, # undefined name 'x' E266, # too many leading '#' for block comment123456789[flake8]max-line-length = 119select = F541, # f-string without any placeholders F841, # local variable 'x' is assigned to but never used F401, # 'x' imported but unused E741, # ambiguous variable name 'l' F821, # undefined name 'x' E266, # too many leading '#' for block comment1234*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.avro filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text12345*.7z filter=lfs diff=lfs merge=lfs -text*.ipynb filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.avro filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text
123456789101112131415161718192021222324252627282930313233343536373839404142---name: Bug reportabout: Create a report to help us improvetitle: ''labels: bugassignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**Steps/Code to reproduce bug**
Please list *minimal* steps or code snippet for us to be able to reproduce the bug.
A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment overview (please complete the following information)**
- Environment location: [Bare-metal, Docker, Cloud(specify cloud provider - AWS, Azure, GCP, Collab)] - Method of NeMo install: [pip install or from source]. Please specify exact commands you used to install. - If method of install is [Docker], provide `docker pull` & `docker run` commands used
**Environment details**
If NVIDIA docker image is used you don't need to specify these.Otherwise, please provide:- OS version- PyTorch version- Python version
**Additional context**
Add any other context about the problem here.Example: GPU model12blank_issues_enabled: false
1234567891011121314151617181920212223242526272829303132333435---container pulled on date: mm/dd/yyyyname: Dev container - Bug reportabout: Create a report to help us improvetitle: ''labels: bugassignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**Steps/Code to reproduce bug**
Please list *minimal* steps or code snippet for us to be able to reproduce the bug.
A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.
**Expected behavior**
A clear and concise description of what you expected to happen.
**Environment overview (please complete the following information)**
- Environment location: Docker - Method of install: Please specify exact commands you used to install. - If method of install is [Docker], provide `docker pull` & `docker run` commands used
**Additional context**
Add any other context about the problem here.Example: GPU model12345678910111213141516171819202122232425---name: Feature requestabout: Suggest an idea for this projecttitle: ''labels: feature requestassignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.Provide a code snippet on how new APIs/changes would be used by others.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657> [!IMPORTANT] > The `Update branch` button must only be pressed in very rare occassions.> An outdated branch is never blocking the merge of a PR.> Please reach out to the automation team before pressing that button.
# What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
**Collection**: [Note which collection this PR will affect]
# Changelog
- Add specific line by line info of high level changes in this PR.
# Usage
- You can potentially add a usage example below
```python# Add a code snippet demonstrating how to use this ```
# GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.To re-run CI remove and add the label again.To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
# Before your PR is "Ready for review"
**Pre checks**:
- [ ] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)- [ ] Did you write any new necessary tests?- [ ] Did you add or update any necessary documentation?- [ ] Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc) - [ ] Reviewer: Does the PR have correct import guards for all optional libraries? **PR Type**:
- [ ] New Feature- [ ] Bugfix- [ ] Documentation
If you haven't finished some of the above items you can still open "Draft" PR.
## Who can review?
Anyone in the community is free to review the PR once the checks have passed.[Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md) contains specific people who can review PRs to various areas.
# Additional Information
- Related to # (issue)12345678910111213141516171819202122232425name: Cancel Workflowdescription: > Cancels the current workflow run, i.e. all jobs. Useful if you want to cancel the rest of the workflow when one job fails. Note that this will cause the workflow to appear cancelled, not failed.
# Cancelling the workflow in a post-script (like this:# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#runspost; can also be done with# this action: https://github.com/webiny/action-post-run, see Git history of this file) wouldn't help the status, it# would still be cancelled. It actually indeed is, but it would be nicer to set it to failed, but there seems to be no# way to do this.
runs: using: "composite" steps: - name: Cancel Workflow # # Fork PRs won't have a token with write access to Actions, thus won't be able to cancel the workflow. # if: github.event.pull_request == '' || github.event.pull_request.head.repo.fork == false shell: bash run: | curl --verbose \ -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${{ github.token }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231# Copyright (c) 2025, NVIDIA CORPORATION.## 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 Template"description: "Template for running NeMo tests in a containerized environment"
inputs: runner: description: "Runner to use for test" required: true timeout: description: "Max runtime of test in minutes" required: false default: "10" script: description: "Test script to execute" required: true after_script: description: "Script to run after main test" required: false default: ":" is_optional: description: "Failure will cancel all other tests if set to true" required: false default: "false" is_unit_test: description: "Upload coverage as unit test" required: false default: "false" tests_to_run: description: "Tests to run" required: false default: '["all"]' image: description: "Image to use for test" required: false default: "nemo_container" cpu-only: description: "Run tests on CPU only" required: false default: "false" test_dir: description: "Directory under tests/ containing the test scripts" required: false default: "functional_tests"runs: using: "composite" steps: - name: Noop shell: bash run: | chmod -R u+rwX ${{ github.run_id }} echo "noop"
- name: Docker system cleanup shell: bash run: | docker system prune -af --filter "until=24h" --filter "label!=nemo.pr_number=${{ github.event.pull_request.number || 0 }}" --force || true
- name: Docker pull image shell: bash run: | docker pull nemoci.azurecr.io/${{ inputs.image }}:${{ github.run_id }}
- name: Clean repos shell: bash run: |
- name: Create UUID id: uuid shell: bash run: | echo "id=$(uuidgen)" >> "$GITHUB_OUTPUT"
- name: Checkout NeMo uses: actions/checkout@v6 env: DIR: ${{ github.run_id }} with: path: ${{ github.run_id }}/${{steps.uuid.outputs.id }}/NeMo
- name: Start container shell: bash env: DIR: ${{ github.run_id }} run: | mkdir -p $DIR
# Map of runner names to GPU device configurations declare -A GPU_CONFIGS=( ["myVm-01"]="0,1" ["myVm-02"]="2,3" ["myVm-03"]="4,5" ["myVm-04"]="6,7" )
ARG=("") if [[ "${{ inputs.cpu-only }}" == "false" ]]; then ARG=("--runtime=nvidia --gpus all") fi
cmd=$(cat <<RUN_TEST_EOF #!/bin/bash docker container rm -f nemo_container_${{ github.run_id }}_${{ inputs.runner }} || true docker run \ --rm \ -d \ --name nemo_container_${{ github.run_id }}_${{ inputs.runner }} ${ARG[@]} \ --shm-size=64g \ --env TRANSFORMERS_OFFLINE=0 \ --env HYDRA_FULL_ERROR=1 \ --env HF_HOME=/home/TestData/HF_HOME \ --env RUN_ID=${{ github.run_id }} \ --volume $(pwd)/${{ github.run_id }}/${{steps.uuid.outputs.id }}/NeMo:/workspace \ --volume /mnt/datadrive/TestData:/home/TestData nemoci.azurecr.io/${{ inputs.image }}:${{ github.run_id }} \ bash -c "sleep $(( ${{ inputs.timeout }} * 60 + 60 ))" RUN_TEST_EOF )
echo "$cmd" | tee "$DIR/retry_job.sh" bash $DIR/retry_job.sh
- name: Create run-script id: create env: DIR: ${{ github.run_id }} shell: bash run: | COVERAGE_PREFIX=$([[ "${{ inputs.is_unit_test }}" == "true" ]] && echo "unit-test" || echo "e2e") echo "coverage-prefix=$COVERAGE_PREFIX" | tee -a "$GITHUB_OUTPUT"
mkdir -p $DIR rm $DIR/.coverage || true rm $DIR/err.log || true
cmd=$(cat <<RUN_TEST_EOF #!/bin/bash
( set -e
docker exec -t nemo_container_${{ github.run_id }}_${{ inputs.runner }} bash -c '\ cp -r /opt/Megatron-LM/ /workspace/ && \ bash tests/${{ inputs.test_dir }}/${{ inputs.script }}.sh && \ echo "Finished successfully." || echo "Did not finish."' ) 2>&1 | tee $DIR/err.log
RUN_TEST_EOF )
echo "timeout_in_seconds=$(( ${{ inputs.timeout }} * 60 ))" | tee -a "$GITHUB_OUTPUT" echo "$cmd" | tee "$DIR/job.sh"
- name: Run main script uses: nick-fields/retry@v3 with: timeout_seconds: ${{ steps.create.outputs.timeout_in_seconds }} max_attempts: 3 shell: bash retry_on: timeout command: /bin/bash ${{ github.run_id }}/job.sh on_retry_command: /bin/bash ${{ github.run_id }}/retry_job.sh
- name: Check result id: check shell: bash env: DIR: ${{ github.run_id }} run: | cat $DIR/err.log
log=$(tail -c 2000 $DIR/err.log | base64 -w 0) echo "log=$log" >> "$GITHUB_OUTPUT"
potential_infra_failure=$(cat $DIR/err.log | grep -Eqiw "device" && echo true || echo false) echo "potential_infra_failure=$potential_infra_failure" >> "$GITHUB_OUTPUT"
docker exec nemo_container_${{ github.run_id }}_${{ inputs.runner }} coverage combine docker exec nemo_container_${{ github.run_id }}_${{ inputs.runner }} coverage xml docker cp nemo_container_${{ github.run_id }}_${{ inputs.runner }}:/workspace/.coverage $DIR/.coverage docker cp nemo_container_${{ github.run_id }}_${{ inputs.runner }}:/workspace/coverage.xml $DIR/coverage.xml
coverage_report=coverage-${{ steps.create.outputs.coverage-prefix }}-${{ github.run_id }}-$(uuidgen) echo "coverage_report=$coverage_report" >> "$GITHUB_OUTPUT"
IS_SUCCESS=$(tail -n 1 $DIR/err.log | grep -q "Finished successfully." && echo "true" || echo "false")
if [[ "$IS_SUCCESS" == "false" && "${{ inputs.is_optional }}" == "true" ]]; then echo "::warning:: Test failed, but displayed as successful because it is marked as optional." IS_SUCCESS=true fi
if [[ "$IS_SUCCESS" == "false" ]]; then echo Test did not finish successfully. exit 1 fi
exit $EXIT_CODE
- name: Test coverage shell: bash -x -e -u -o pipefail {0} run: | docker exec -t nemo_container_${{ github.run_id }}_${{ inputs.runner }} coverage report -i
- name: Upload artifacts uses: actions/upload-artifact@v6 if: ${{ steps.check.outputs.coverage_report != 'none' }} with: name: ${{ steps.check.outputs.coverage_report }} path: | ${{ github.run_id }}/coverage.xml ${{ github.run_id }}/.coverage include-hidden-files: true
- name: Container shutdown if: always() shell: bash run: | docker exec nemo_container_${{ github.run_id }}_${{ inputs.runner }} bash -c "chown -R $(id -u):$(id -g) /workspace" rm -rf $(pwd)/${{ github.run_id }}/${{steps.uuid.outputs.id }} || true docker container rm -f nemo_container_${{ github.run_id }}_${{ inputs.runner }} || true1234567891011121314151617181920212223242526272829303132333435363738394041ASR:- nemo/collections/asr/**/*- examples/asr/**/*- tutorials/asr/**/*- docs/source/asr/**/*- tests/collections/asr/**
Speaker Tasks:- examples/speaker_tasks/**/*- tutorials/speaker_tasks/**/*
TTS:- nemo/collections/tts/**/*- nemo/collections/common/tokenizers/text_to_speech/**- examples/tts/**/*- tutorials/tts/**/*- docs/source/tts/**/*- scripts/dataset_processing/tts/**- scripts/tts_dataset_files/**- tests/collections/tts/**- tests/collections/common/tokenizers/text_to_speech/**
Audio:- nemo/collections/audio/**/*- examples/audio/**/*- tutorials/audio/**/*- docs/source/audio/**/*- tests/collections/audio/**
core:- nemo/core/**/*- tests/core/**
common:- nemo/collections/common/**/*
CI:- .github/**/*- Jenkinsfile- Dockerfile- ci.groovy12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879# Copyright (c) 2025, NVIDIA CORPORATION.## 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.import os
import requestsfrom github import Github
def send_slack_notification(): # Get environment variables gh_token = os.environ.get('GH_TOKEN') webhook_url = os.environ.get('SLACK_WEBHOOK') repository = os.environ.get('REPOSITORY') run_id = os.environ.get('RUN_ID') server_url = os.environ.get('SERVER_URL', 'https://github.com') pr_number = int(os.environ.get('PR_NUMBER', 0)) branch_name = os.environ.get('BRANCH_NAME')
# Get failure info from GitHub API gh = Github(gh_token) repo = gh.get_repo(repository)
# Get failed jobs failed_jobs = [job.name for job in repo.get_workflow_run(int(run_id)).jobs() if job.conclusion == 'failure']
if pr_number != 0: pr = repo.get_pull(pr_number)
title = f"*<{server_url}/{repository}/pull/{pr_number}|PR#{pr_number}>: {pr.title.replace('`', '')}*" author = f"<{server_url}/{pr.user.login}|{pr.user.login}>" branch = f"<{server_url}/{pr.head.repo.full_name}/tree/{pr.head.ref}|{pr.head.ref}>" else: title = f"*Run on <{server_url}/{repository}/tree/{branch_name}|{branch_name}>*" author = "No author" branch = f"<{server_url}/{repository}/tree/{branch_name}|{branch_name}>"
blocks = [ { "type": "section", "text": { "type": "mrkdwn", "text": ( f"{title}\n" f"• Author: {author}\n" f"• Branch: {branch}\n" f"• Pipeline: <{server_url}/{repository}/actions/runs/{run_id}|View Run>\n" f"• Failed Jobs:\n" + "\n".join( [ f" • <{server_url}/{repository}/actions/runs/{run_id}|{job.split('/')[-1]}>" for job in failed_jobs if job.split('/')[-1] != 'Nemo_CICD_Test' ] ) ), }, } ]
print({"blocks": blocks})
# Send to Slack response = requests.post(webhook_url, json={"blocks": blocks}) response.raise_for_status()
if __name__ == "__main__": send_slack_notification()1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889name: ~Build container templateon: workflow_call: inputs: image-name: required: true type: string description: "The name of the image to build" dockerfile: required: true type: string runner: required: false default: self-hosted-azure-builder type: string description: "The runner to use for the build"
jobs: pre-flight: runs-on: ubuntu-latest outputs: build_args: ${{ steps.manifest.outputs.BUILD_ARGS }} cache-from: ${{ steps.cache_from.outputs.LAST_PRS }} steps: - name: Checkout repository uses: actions/checkout@v6
- name: Parse manifest.json id: manifest run: | BUILD_ARGS=$(cat << EOF BASE_IMAGE=$(cat requirements/manifest.json | jq -r '."ngc-pytorch"') TRTLLM_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."trt-llm".repo') TRTLLM_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."trt-llm".ref') MLM_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."megatron-lm".repo') MLM_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."megatron-lm".ref') TE_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".transformer_engine.repo') TE_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".transformer_engine.ref') APEX_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".apex.repo') APEX_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".apex.ref') EOF )
echo "BUILD_ARGS<<EOF" >> $GITHUB_OUTPUT echo "$BUILD_ARGS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
- name: Get last merged PR id: cache_from env: GH_TOKEN: ${{ github.token }} run: | LAST_PRS=$(gh api graphql -f query=' query { repository(owner: "NVIDIA", name: "NeMo") { pullRequests(states: MERGED, first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { number } } } }' | jq -r '.data.repository.pullRequests.nodes[].number' | while read -r number; do echo "nemoci.azurecr.io/${{ inputs.image-name }}-buildcache:$number" done)
echo "LAST_PRS<<EOF" >> $GITHUB_OUTPUT echo "$LAST_PRS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
build: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_container.yml@v0.27.0 needs: [pre-flight] with: image-name: ${{ inputs.image-name }} dockerfile: ${{ inputs.dockerfile }} image-label: nemo-core build-args: | IMAGE_LABEL=nemo-core NEMO_TAG=${{ github.sha }} NEMO_REPO=https://github.com/NVIDIA/NeMo PR_NUMBER=${{ github.event.pull_request.number || 0 }} ${{ needs.pre-flight.outputs.build_args }} prune-filter-timerange: 24h use-inline-cache: false cache-from: | nemoci.azurecr.io/${{ inputs.image-name }}-buildcache:main nemoci.azurecr.io/${{ inputs.image-name }}-buildcache:${{ github.event.pull_request.number || 0 }} ${{ needs.pre-flight.outputs.cache-from }} runner: ${{ inputs.runner }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556name: ~Bump Megatron Tag templateon: workflow_call: inputs: nemo-target-branch: required: true type: string description: "The target branch to bump" mcore-target-branch: required: true type: string description: "The target branch to bump" secrets: PAT: required: true
jobs: update-branch: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: ref: ${{ inputs.nemo-target-branch }}
- name: Set Git config run: | git config --local user.email "actions@github.com" git config --local user.name "Github Actions" - name: Merge weekly-bump-${{ inputs.nemo-target-branch }} back to base branch env: SOURCE_BRANCH: weekly-bump-${{ inputs.nemo-target-branch }} TARGET_BRANCH: ${{ inputs.nemo-target-branch }} run: | if git ls-remote --exit-code origin $SOURCE_BRANCH; then git fetch --unshallow git checkout $SOURCE_BRANCH git pull git merge --no-ff $TARGET_BRANCH -m "chore: Auto-merge $TARGET_BRANCH into $SOURCE_BRANCH" else git checkout -b $SOURCE_BRANCH $TARGET_BRANCH fi git push -u origin $SOURCE_BRANCH
mcore: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_bump_yamlfile.yml@v0.27.1 needs: [update-branch] with: source-repository: NVIDIA/Megatron-LM source-ref: ${{ inputs.mcore-target-branch }} yaml-path: '."vcs-dependencies"."megatron-lm".ref' file: requirements/manifest.json base-branch: weekly-bump-${{ inputs.nemo-target-branch }} cicd-labels: Run CICD,no-fail-fast pr-reviewers: ${{ inputs.pr-reviewers }} secrets: PAT: ${{ secrets.PAT }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576# Copyright (c) 2026, NVIDIA CORPORATION.## 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: Build docs
on: pull_request: branches: - main - r** paths: - "docs/**" push: branches: - main - r** paths: - "docs/**"
concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.label.name || 'main' }}-${{ github.event_name }} cancel-in-progress: true
jobs: pre-flight: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cicd_preflight.yml@v0.74.0
build-docs: needs: [pre-flight] if: needs.pre-flight.outputs.is_deployment_workflow != 'true' uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_docs.yml@v0.83.0 with: docs-directory: docs/source sync-all: true no-extras: "--no-extra cu12"
build-docs-summary: needs: [pre-flight, build-docs] if: | ( needs.pre-flight.outputs.is_deployment_workflow == 'true' || always() ) && !cancelled() runs-on: ubuntu-latest steps: - name: Get workflow result id: result shell: bash -x -e -u -o pipefail {0} env: GH_TOKEN: ${{ github.token }} RUN_ID: ${{ github.run_id }} SKIPPING_IS_ALLOWED: ${{ needs.pre-flight.outputs.docs_only == 'true' || needs.pre-flight.outputs.is_deployment_workflow == 'true' }} run: | FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0
if [ "${FAILED_JOBS:-0}" -eq 0 ] || [ "$SKIPPING_IS_ALLOWED" == "true" ]; then echo "✅ All previous jobs completed successfully" exit 0 else echo "❌ Found $FAILED_JOBS failed job(s)" # Show which jobs failed gh run view $GITHUB_RUN_ID --json jobs --jq '.jobs[] | select(.status == "completed" and .conclusion != "success") | .name' exit 1 fi1234567891011121314151617181920212223242526272829303132333435363738# Copyright (c) 2020-2021, NVIDIA CORPORATION.## 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: Build, test, and publish a PyPi wheel (to testpypi).
on: push: branches: - main - "r**"
defaults: run: shell: bash -x -e -u -o pipefail {0}
jobs: build-test-publish-wheel: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_test_publish_wheel.yml@v0.22.3 with: dry-run: true python-package: nemo python-version: "3.10" secrets: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }} SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }}1234567891011121314name: Create PR to main with cherry-pick from release
on: push: branches: - main
jobs: cherry-pick: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_cherry_pick.yml@v0.63.0 secrets: PAT: ${{ secrets.PAT }} SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.## 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: Approve Test Queue
on: schedule: - cron: '*/5 * * * *' # Runs every 5 minutes workflow_dispatch: # Allows manual triggering
jobs: approve-queue: runs-on: ubuntu-latest environment: main steps: - name: Checkout repository uses: actions/checkout@v6
- name: Set up Python uses: actions/setup-python@v6 with: python-version: "3.12"
- name: Install dependencies run: | python -m pip install --upgrade pip pip install requests
- name: Approve waiting deployments env: GITHUB_TOKEN: ${{ secrets.PAT }} MAX_CONCURRENCY: ${{ vars.MAX_CONCURRENCY || 1 }} run: | python - <<EOF import os import requests
# GitHub API configuration GITHUB_TOKEN = os.environ["GITHUB_TOKEN"] REPO = os.environ["GITHUB_REPOSITORY"] MAX_CONCURRENCY = int(os.environ["MAX_CONCURRENCY"]) API_BASE = f"https://api.github.com/repos/{REPO}"
# Headers for GitHub API headers = { "Authorization": f"token {GITHUB_TOKEN}", "Accept": "application/vnd.github.v3+json", "X-GitHub-Api-Version": "2022-11-28", }
def make_request(endpoint, method="GET", data=None): """Make a request to the GitHub API with error handling.""" url = f"{API_BASE}/{endpoint}" try: if method == "GET": response = requests.get(url, headers=headers) else: response = requests.post(url, headers=headers, json=data) response.raise_for_status() response_json = response.json() if hasattr(response, "links") and "actions/runs?status" in endpoint: response_json["next"] = response.links.get("next", {}).get("url")
return response_json except requests.exceptions.RequestException as e: print(f"Error making request to {endpoint}: {str(e)}") if hasattr(e.response, 'text'): print(f"Response: {e.response.text}") return None
def get_workflow_runs(status): """Get all workflow runs for a given status.""" all_results = [] endpoint = f"actions/runs?status={status}" while endpoint: response = make_request(endpoint) if not response: break
all_results.extend(response.get("workflow_runs", [])) endpoint = None next_url = response.get("next") if next_url: endpoint = f"actions/runs?{next_url.split('?')[1]}"
return all_results
# Get current running and queued workflows print("Fetching workflow runs...") queued_workflow_runs = get_workflow_runs("queued") in_progress_workflow_runs = get_workflow_runs("in_progress")
# Count running and queued workflows queued_workflows = sum(1 for run in queued_workflow_runs if run["name"] == "CICD NeMo") in_progress_workflows = sum(1 for run in in_progress_workflow_runs if run["name"] == "CICD NeMo")
total_workflows = queued_workflows + in_progress_workflows print(f"Current queued workflows: {queued_workflows}") print(f"Current running workflows: {in_progress_workflows}") print(f"Total workflows: {total_workflows}") print(f"Max concurrency: {MAX_CONCURRENCY}")
if total_workflows >= MAX_CONCURRENCY: print("Maximum concurrency reached, no new approvals will be made") exit(0)
# Get waiting CI workflows for test environment print("Fetching deployments...") pending_workflows = get_workflow_runs("waiting") pending_workflows = [run for run in pending_workflows if run["name"] == "CICD NeMo"]
# Sort deployments by creation date (oldest first) print("Sorting workflows...") pending_workflows = sorted(pending_workflows, key=lambda x: x["created_at"])
# Process each deployment print("Processing ...") for workflow in pending_workflows: if total_workflows >= MAX_CONCURRENCY: print("Maximum concurrency reached, stopping approvals") break
workflow_id = workflow["id"] workflow_name = workflow["display_title"] print(f"Approving workflow {workflow_name} with Run Id: {workflow_id}")
deployment_url = f"actions/runs/{workflow_id}/pending_deployments" deployment = make_request(deployment_url)[0] environment_id = deployment["environment"]["id"]
# Approve the deployment status_data = { "environment_ids": [environment_id], "state": "approved", "comment": "Automatically approved by queue manager" } result = make_request(deployment_url, method="POST", data=status_data)
if result: total_workflows += 1 else: print(f"Failed to approve deployment {deployment['id']}") exit(1)
EOF notify: if: failure() runs-on: ubuntu-latest needs: [approve-queue] steps: - name: Notify env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_WEBHOOK_ADMIN: <!subteam^${{ secrets.SLACK_WEBHOOK_ADMIN }}> GITHUB_RUN_ID: ${{ github.run_id }} GITHUB_REPOSITORY: ${{ github.repository }} run: | curl -X POST \ -H 'Content-type: application/json' \ --data "{\"text\":\":robot_joy: <https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}|Test-queue-approval-bot workflow> failed. Please review manually.\n\ncc ${SLACK_WEBHOOK_ADMIN}\"}" \ $SLACK_WEBHOOK123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483# Copyright (c) 2025, NVIDIA CORPORATION.## 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: NeMo E2E Speech Testson: workflow_call: inputs: test_to_run: required: true type: string image-name: required: false default: nemo_container_speech type: string
jobs: build: uses: ./.github/workflows/_build_container.yml with: image-name: ${{ inputs.image-name }} dockerfile: docker/Dockerfile.ci
unit-tests: strategy: fail-fast: false matrix: include: - script: L0_Unit_Tests_GPU_ASR runner: self-hosted-azure-gpus-1 timeout: 30 - script: L0_Unit_Tests_CPU_ASR runner: azure-gpu-vm-runner1-cpu cpu-only: true timeout: 30 - script: L0_Unit_Tests_GPU_TTS runner: self-hosted-azure-gpus-1 - script: L0_Unit_Tests_CPU_TTS runner: self-hosted-azure-cpu cpu-only: true - script: L0_Unit_Tests_GPU_Audio runner: self-hosted-azure-gpus-1 - script: L0_Unit_Tests_CPU_Audio runner: self-hosted-azure-cpu cpu-only: true - script: L0_Unit_Tests_GPU_SpeechLM2 runner: self-hosted-azure-gpus-1 timeout: 20 - script: L0_Unit_Tests_CPU_SpeechLM2 runner: self-hosted-azure-cpu cpu-only: true timeout: 20 needs: [build] runs-on: ${{ matrix.runner }} name: ${{ matrix.script }} steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }} - name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: ${{ matrix.script }} is_unit_test: true tests_to_run: ${{ inputs.test_to_run }} image: ${{ inputs.image-name }} timeout: ${{ matrix.timeout || 10 }} cpu-only: ${{ matrix.cpu-only || false }} is_optional: ${{ matrix.is-optional || false }}
e2e-tests: strategy: fail-fast: false matrix: include: - runner: self-hosted-azure-gpus-1 script: ASR_dev_run_Speech_to_Text - runner: self-hosted-azure-gpus-1 script: Optional_ASR_dev_run_Speech_To_Text_Finetuning is-optional: true - runner: self-hosted-azure-gpus-1 script: Optional_ASR_dev_run_Speech_To_Text_HF_Finetuning is-optional: true - runner: self-hosted-azure-gpus-1 script: ASR_dev_run_Speech_to_Text_WPE_-_Conformer - runner: self-hosted-azure-gpus-1 script: ASR_dev_run_Speech_to_Text_Hybrid_RNNT_CTC_Prompt - runner: self-hosted-azure-gpus-1 script: L2_ASR_Multi-dataloader_dev_run_Speech_to_Text_multi-dataloader - runner: self-hosted-azure-gpus-1 script: L2_ASR_Multi-dataloader_dev_run_Speech_to_Label_multi-dataloader - runner: self-hosted-azure-gpus-1 script: L2_ASR_Adapters_Linear_Adapters - runner: self-hosted-azure-gpus-1 script: L2_ASR_Adapters_RelPos_MHA_Adapters - runner: self-hosted-azure script: L2_Speech_to_Text_EMA - runner: self-hosted-azure-gpus-1 script: L2_Speech_to_Text_AED - runner: self-hosted-azure-gpus-1 script: L2_Speaker_dev_run_Speech_to_Label - runner: self-hosted-azure script: L2_Speech_Estimate_Duration_Bins - runner: self-hosted-azure script: L2_Speech_Batch_Size_OOMptimizer - runner: self-hosted-azure script: Optional_L2_Speech_Batch_Size_OOMptimizer_Canary is-optional: true - runner: self-hosted-azure script: L2_Speech_Transcription_Speech_to_Text_Transcribe - runner: self-hosted-azure script: L2_Speech_Transcription_Speech_to_Text_Streaming_Infer - runner: self-hosted-azure script: L2_Speech_Transcription_Speech_to_Text_Cache_Aware_Infer - runner: self-hosted-azure script: L2_Speech_Transcription_Streaming_Inference - runner: self-hosted-azure script: L2_Speech_Transcription_Speech_to_Text_Inference_Boost_GT - runner: self-hosted-azure script: L2_Speech_Transcription_Speech_to_Text_Transcribe_Boost_GT - runner: self-hosted-azure script: L2_Speech_Transcription_Canary_Transcribe_Full_Manifest - runner: self-hosted-azure script: L2_Speech_Transcription_Canary_Transcribe_With_Prompt - runner: self-hosted-azure script: L2_Speech_Transcription_Canary_Transcribe_Audio_Dir - runner: self-hosted-azure script: L2_Speech_Transcription_Canary_Streaming_Full_Manifest - runner: self-hosted-azure script: L2_Longform_Speech_Transcription_Canary_Chunked_Infer_from_Audio_Dir - runner: self-hosted-azure script: L2_Longform_Speech_Transcription_with_TimeStamps_Canary_Chunked_Infer_from_Audio_Dir - runner: self-hosted-azure script: L2_Longform_Speech_Transcription_with_TimeStamps_Canary_Chunked_Infer_from_Manifest - runner: self-hosted-azure-gpus-1 script: Speech_Checkpoints_tests timeout: 20 - runner: self-hosted-azure-gpus-1 script: L2_Speaker_dev_run_Speaker_Recognition - runner: self-hosted-azure-gpus-1 script: L2_Speaker_dev_run_EndtoEnd_Speaker_Diarization_Sortformer - runner: self-hosted-azure script: L2_Speaker_dev_run_EndtoEnd_Diarizer_Inference - runner: self-hosted-azure script: L2_Speaker_dev_run_Speaker_Diarization_with_ASR_Inference - runner: self-hosted-azure script: L2_Speaker_dev_run_Clustering_Diarizer_Inference - runner: self-hosted-azure script: L2_Speaker_dev_run_Multispeaker_ASR_Data_Simulation - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_1_FastPitch - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_1_Hifigan - runner: self-hosted-azure script: L2_G2P_Models_G2P_Conformer_training_evaluation_and_inference - runner: self-hosted-azure script: SPEECHLM_HF_Training_DuplexS2S - runner: self-hosted-azure script: SPEECHLM_HF_Training_DuplexS2SSpeechDecoder - runner: self-hosted-azure script: SPEECHLM_HF_Training_SALM timeout: 20 - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_Magpietts_DecoderContext - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_Magpietts_MultiEncoder - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_Magpietts_MoE - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_Magpietts_OnlinePO - runner: self-hosted-azure script: L2_TTS_InferEvaluate_Magpietts_ZeroShot - runner: self-hosted-azure script: L2_TTS_InferEvaluate_Magpietts_SeenSpeakers - runner: self-hosted-azure script: L2_TTS_InferEvaluatelongform_Magpietts_ZeroShot - runner: self-hosted-azure script: L2_TTS_InferEvaluate_Magpietts_MoE_ZeroShot - runner: self-hosted-azure script: L2_TTS_InferEvaluatelongform_Magpietts_MoE_ZeroShot - runner: self-hosted-azure script: L2_TTS_InferEvaluate_Magpietts_FrameStacking - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_EasyMagpietts_Qwen - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_EasyMagpietts_Nemotron - runner: self-hosted-azure script: L2_TTS_Fast_dev_runs_EasyMagpietts_OnlinePO timeout: 20 - runner: self-hosted-azure script: L2_TTS_InferEvaluate_EasyMagpietts needs: [unit-tests] runs-on: ${{ matrix.runner }} name: ${{ matrix.is-optional && 'PLEASEFIXME_' || '' }}${{ matrix.script }} steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }} - name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: ${{ matrix.script }} tests_to_run: ${{ inputs.test_to_run }} image: ${{ inputs.image-name }} timeout: ${{ matrix.timeout || 10 }} is_optional: ${{ matrix.is-optional || false }}
e2e-nightly: if: ${{ github.event_name == 'schedule' || contains(github.event.pull_request.labels.*.name, 'Run e2e nightly') }} strategy: fail-fast: false matrix: include: - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_de_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_es_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_it_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_ua_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_pl_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_hr_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_be_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_fr_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_ru_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_nl_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_fa_fastconformer_hybrid_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_ka_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_kk_ru_fastconformer_hybrid_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_ka_fastconformer_hybrid_transducer_ctc_large_streaming_80ms_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_uz_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_ar_fastconformer_hybrid_large_pc_v1_0 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_hy_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_hybrid_medium_streaming_80ms_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_hybrid_medium_streaming_80ms timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_pt_fastconformer_hybrid_large_pc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_es_fastconformer_hybrid_large_pc_nc timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_ar_fastconformer_hybrid_large_pcd_v1_0 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_hybrid_large_streaming_multi timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_ctc_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_transducer_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_ctc_xlarge timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_transducer_xlarge timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_transducer_xxlarge timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_ctc_xxlarge timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__stt_en_fastconformer_tdt_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_stt_en_fastconformer_hybrid_large_streaming_1040ms timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_stt_multilingual_fastconformer_hybrid_large_pc_blend_eu timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_rnnt_1_1b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_ctc_1_1b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_rnnt_0_6b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_ctc_0_6b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_tdt_1_1b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_tdt_ctc_1_1b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_tdt_ctc_0_6b_ja timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_tdt_ctc_110m timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_tdt_0_6b_v2 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_rnnt_110m_da_dk timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_tdt_0_6b_v3 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_ctc_0_6b_Vietnamese timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__canary_1b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__canary_1b_flash timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__canary_180m_flash timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__canary_1b_v2 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__parakeet_realtime_eou_120m_v1 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__multitalker_parakeet_streaming_0_6b_v1 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__nemotron_speech_streaming_en_0_6b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__canary_qwen_2_5b timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__diar_sortformer_4spk_v1 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__diar_streaming_sortformer_4spk_v2 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__diar_streaming_sortformer_4spk_v2_1 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_titanet_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__speakerverification_en_titanet_large timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__ssl_en_nest_large_v1_0 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__ssl_en_nest_xlarge_v1_0 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_vad_multilingual_marblenet timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_vad_multilingual_frame_marblenet timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__Frame_VAD_Multilingual_MarbleNet_v2_0 timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__se_den_sb_16k_small timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__se_der_sb_16k_small timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__sr_ssl_flowmatching_16k_430m timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_mel_codec_44khz_medium timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_mel_codec_22khz_fullband_medium timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__low_frame_rate_speech_codec_22khz timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__audio_codec_22khz timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__audio_codec_44khz timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__mel_codec_22khz timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__mel_codec_44khz timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__nemo_nano_codec_22khz_1_78kbps_12_5fps timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__nemo_nano_codec_22khz_1_89kbps_21_5fps timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__nemo_nano_codec_22khz_0_6kbps_12_5fps timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__tts_en_fastpitch timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__tts_hifigan timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_nvidia__magpie_tts_multilingual_357m timeout: 15 - runner: self-hosted-azure script: L2_Model_Support_tts_en_e2e_fastspeech2hifigan timeout: 15 needs: [unit-tests] runs-on: ${{ matrix.runner }} name: ${{ matrix.script }} steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }} - name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: ${{ matrix.script }} tests_to_run: ${{ inputs.test_to_run }} image: ${{ inputs.image-name }} timeout: ${{ matrix.timeout || 10 }} test_dir: e2e_nightly123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105# Copyright (c) 2025, NVIDIA CORPORATION.## 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: NeMo Unit Testson: workflow_call: inputs: test_to_run: required: true type: string
jobs: collections-common-tests: strategy: fail-fast: false matrix: include: - script: L0_Unit_Tests_GPU_Common runner: self-hosted-azure-gpus-1 - script: L0_Unit_Tests_CPU_Common runner: self-hosted-azure-cpu cpu-only: true runs-on: ${{ matrix.runner }} name: ${{ matrix.script }} steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }} - name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: ${{ matrix.script }} is_unit_test: true tests_to_run: ${{ inputs.test_to_run }} cpu-only: ${{ matrix.cpu-only || false }}
core-tests: strategy: fail-fast: false matrix: include: - script: L0_Unit_Tests_GPU_Core runner: self-hosted-azure-gpus-1 - script: L0_Unit_Tests_CPU_Core runner: self-hosted-azure-cpu cpu-only: true - script: L0_Unit_Tests_GPU_Hydra runner: self-hosted-azure-gpus-1 - script: L0_Unit_Tests_CPU_Hydra runner: self-hosted-azure-cpu cpu-only: true runs-on: ${{ matrix.runner }} name: ${{ matrix.script }} steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }} - name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: ${{ matrix.script }} is_unit_test: true tests_to_run: ${{ inputs.test_to_run }} cpu-only: ${{ matrix.cpu-only || false }}
other-tests: strategy: fail-fast: false matrix: include: - script: L0_Unit_Tests_GPU_Others runner: self-hosted-azure-gpus-1 - script: L0_Unit_Tests_CPU_Others runner: self-hosted-azure-cpu cpu-only: true runs-on: ${{ matrix.runner }} name: ${{ matrix.script }} steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }} - name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: ${{ matrix.script }} is_unit_test: true tests_to_run: ${{ inputs.test_to_run }} cpu-only: ${{ matrix.cpu-only || false }} is_optional: ${{ matrix.is-optional || false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395# Copyright (c) 2025, NVIDIA CORPORATION.## 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: CICD NeMoon: schedule: - cron: 0 0 * * * pull_request: branches: - main - r** - weekly-bump* types: [labeled] workflow_dispatch: inputs: test_to_run: required: false default: all type: string description: Comma-separated list of tests to run. Use "all" to run the full test suite.
concurrency: # group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}-${{ github.event_name }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.label.name || 'main' }}-${{ github.event_name }} cancel-in-progress: true
jobs: pre-flight: runs-on: ubuntu-latest outputs: test_to_run: ${{ steps.test_to_run.outputs.main }} is_ci_workload: ${{ steps.is_ci_workload.outputs.main }} no_fail_fast: ${{ steps.no_fail_fast.outputs.main }} components_to_run: ${{ steps.components_to_run.outputs.main }} env: TESTS_TO_RUN: ${{ inputs.test_to_run }} EVENT_NAME: ${{ github.event_name }} HAS_LABEL: ${{ github.event.label.name == 'Run CICD' }} steps: - name: Checkout branch uses: actions/checkout@v6 with: fetch-depth: 0
- name: Select components to run id: components_to_run run: | echo "main=[\"speech\"]" | tee -a "$GITHUB_OUTPUT"
- name: Select tests to run id: test_to_run run: | # For manual dispatch, we replace `all` with the actual job names if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then TESTS_TO_RUN=$TESTS_TO_RUN
# For correctly labeled PR, we replace `all` with the actual job names elif [[ "$EVENT_NAME" == "pull_request" && "$HAS_LABEL" == "true" ]]; then TESTS_TO_RUN=all
# For incorrectly labeled PR, run no tests elif [[ "$EVENT_NAME" == "pull_request" && "$HAS_LABEL" != "true" ]]; then TESTS_TO_RUN=""
# For push events, run all tests. This is so that we can generate coverage # on branch `main`. elif [[ "$EVENT_NAME" == "push" || "$EVENT_NAME" == "schedule" ]]; then TESTS_TO_RUN=all
else echo "Unsupported event_name $EVENT_NAME provided". exit 1 fi
parsed_string=$(echo "$TESTS_TO_RUN" | jq -c --raw-input 'split(",")') echo "main=${parsed_string}" | tee -a "$GITHUB_OUTPUT"
- name: Check if this is a CI workload shell: bash id: is_ci_workload run: | branch_name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
if [[ "$branch_name" =~ ^bump-ci-container || "$EVENT_NAME" == "schedule" ]]; then is_ci_workload=true echo "main=true" | tee -a "$GITHUB_OUTPUT" else is_ci_workload=false fi
echo "main=$is_ci_workload" | tee -a "$GITHUB_OUTPUT"
- name: Check if no-fail-fast is set shell: bash id: no_fail_fast env: HAS_FAIL_FAST_LABEL: ${{ contains(github.event.pull_request.labels.*.name, 'no-fail-fast') }} run: | if [[ "$HAS_FAIL_FAST_LABEL" == "true" || "$EVENT_NAME" == "schedule" ]]; then no_fail_fast=true else no_fail_fast=false fi
echo "main=$no_fail_fast" | tee -a "$GITHUB_OUTPUT"
code-linting: if: needs.pre-flight.outputs.test_to_run != '[]' needs: [pre-flight] uses: ./.github/workflows/code-linting.yml
cicd-wait-in-queue: needs: [pre-flight, code-linting] runs-on: ubuntu-latest environment: test if: | needs.pre-flight.outputs.test_to_run != '[]' && needs.pre-flight.outputs.components_to_run != '[]' && needs.pre-flight.outputs.is_ci_workload == 'false' steps: - name: Running CI tests run: | echo "Running CI tests"
cicd-test-container-build: uses: ./.github/workflows/_build_container.yml needs: [pre-flight, code-linting, cicd-wait-in-queue] if: | needs.pre-flight.outputs.test_to_run != '[]' && needs.pre-flight.outputs.components_to_run != '[]' && ( success() || ( needs.cicd-wait-in-queue.result == 'skipped' && needs.pre-flight.outputs.is_ci_workload == 'true' ) ) && !cancelled() with: image-name: nemo_container dockerfile: docker/Dockerfile.ci
cicd-import-tests: if: | needs.pre-flight.outputs.test_to_run != '[]' && needs.pre-flight.outputs.components_to_run != '[]' && ( success() || ( needs.cicd-wait-in-queue.result == 'skipped' && needs.pre-flight.outputs.is_ci_workload == 'true' ) ) && !cancelled() needs: [cicd-test-container-build, pre-flight] runs-on: self-hosted-azure-gpus-1 steps: - name: Create UUID id: uuid run: | echo "id=$(uuidgen)" >> "$GITHUB_OUTPUT"
- name: Checkout NeMo uses: actions/checkout@v6 with: path: ${{ github.run_id }}/${{steps.uuid.outputs.id }}/NeMo
- name: Run some checks run: | docker run \ --rm \ --device=/dev/nvidia0 \ --gpus all \ --shm-size=8g \ --volume $(pwd)/${{ github.run_id }}/${{steps.uuid.outputs.id }}/NeMo:/workspace \ --env TRANSFORMERS_OFFLINE=0 \ --env HYDRA_FULL_ERROR=1 --env PYTHONUNBUFFERED=1 nemoci.azurecr.io/nemo_container:${{ github.run_id }} bash -c '\ # PyTorch Lightning version python -c "import lightning.pytorch; print(lightning.pytorch.__version__)"
# PyTorch Lightning DDP Checks CUDA_VISIBLE_DEVICES="0,1" python "tests/core_ptl/check_for_ranks.py"
# Basic Import Checks python tests/core_ptl/check_imports.py --domain asr python tests/core_ptl/check_imports.py --domain tts '
L0_Setup_Test_Data_And_Models: needs: [pre-flight, cicd-test-container-build, cicd-wait-in-queue] runs-on: self-hosted-azure if: | needs.pre-flight.outputs.test_to_run != '[]' && needs.pre-flight.outputs.components_to_run != '[]' && ( success() || ( needs.cicd-wait-in-queue.result == 'skipped' && needs.pre-flight.outputs.is_ci_workload == 'true' ) ) && !cancelled() steps: - name: Checkout uses: actions/checkout@v6 with: path: ${{ github.run_id }}
- name: main uses: NVIDIA/NeMo/.github/actions/test-template@main with: runner: ${{ runner.name }} script: L0_Setup_Test_Data_And_Models tests_to_run: '["L0_Setup_Test_Data_And_Models"]'
cicd-main-unit-tests: needs: [pre-flight, cicd-test-container-build] uses: ./.github/workflows/cicd-main-unit-tests.yml if: | needs.pre-flight.outputs.test_to_run != '[]' && needs.pre-flight.outputs.components_to_run != '[]' && ( success() || ( needs.cicd-wait-in-queue.result == 'skipped' && needs.pre-flight.outputs.is_ci_workload == 'true' ) ) && !cancelled() with: test_to_run: ${{ needs.pre-flight.outputs.test_to_run }}
cicd-main-speech: needs: [pre-flight, cicd-test-container-build, cicd-main-unit-tests] uses: ./.github/workflows/cicd-main-speech.yml if: | ( needs.pre-flight.outputs.test_to_run != '[]' && ( contains(fromJson(needs.pre-flight.outputs.components_to_run), 'speech') ) ) && ( success() || ( needs.cicd-wait-in-queue.result == 'skipped' && needs.pre-flight.outputs.is_ci_workload == 'true' ) ) && !cancelled() with: test_to_run: ${{ needs.pre-flight.outputs.test_to_run }}
Nemo_CICD_Test: needs: - pre-flight - cicd-test-container-build - cicd-import-tests - L0_Setup_Test_Data_And_Models - cicd-main-unit-tests - cicd-main-speech if: always() runs-on: ubuntu-latest permissions: write-all steps: - name: Checkout uses: actions/checkout@v6
- name: Get workflow result id: result env: GH_TOKEN: ${{ github.token }} RUN_ID: ${{ github.run_id }} HAS_LABEL: ${{ github.event.label.name == 'Run CICD' }} IS_SCHEDULED: ${{ github.event_name == 'schedule' }} run: | # Get workflow run details and check job conclusions LATEST_ATTEMPT=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion != null) | .conclusion] | last') NUM_FAILED=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion == "failure") | .name] | length') NUM_CANCELLED=$(gh run view $RUN_ID --json jobs -q '[.jobs[] | select(.conclusion == "cancelled") | .name] | length')
if [[ $NUM_FAILED -eq 0 && $NUM_CANCELLED -eq 0 && ("$HAS_LABEL" == "true" || "$IS_SCHEDULED" == "true") ]]; then RESULT="success" elif [[ $NUM_CANCELLED -gt 0 ]]; then RESULT="cancelled" else RESULT="failure" fi
# Output the final status echo "code=$RESULT" | tee -a $GITHUB_OUTPUT
- name: Checkout for GH CLI uses: actions/checkout@v6
- name: Remove label if not cancelled if: | steps.result.outputs.code != 'cancelled' && github.event.label.name == 'Run CICD' && github.event.pull_request.head.repo.full_name == github.repository env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.number }} run: gh pr edit "$PR_NUMBER" --remove-label "Run CICD"
- name: Pipeline successful, add PR comment if: | steps.result.outputs.code == 'success' && github.event_name == 'pull_request' && env.SLACK_WEBHOOK != '' uses: peter-evans/create-or-update-comment@v4 env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} REPOSITORY: ${{ github.repository }} RUN_ID: ${{ github.run_id }} with: issue-number: ${{ github.event.number }} body: | [🤖]: Hi @${{ github.event.pull_request.user.login }} 👋,
We wanted to let you know that a [CICD pipeline](https://github.com/${{ env.REPOSITORY }}/actions/runs/${{ env.RUN_ID }}) for this PR just finished successfully.
So it might be time to merge this PR or get some approvals.
- name: Exit if: ${{ always() }} env: RESULT: ${{ steps.result.outputs.code }} run: | if [ $RESULT == "success" ]; then exit 0 else exit 1 fi
Coverage: runs-on: ubuntu-latest needs: [pre-flight, Nemo_CICD_Test] if: | needs.pre-flight.outputs.test_to_run != '[]' && needs.pre-flight.outputs.components_to_run != '[]' && ( success() || needs.Nemo_CICD_Test.result == 'success' ) && !cancelled() strategy: matrix: flag: [unit-test, e2e] steps: - name: Checkout uses: actions/checkout@v6
- name: Download coverage reports of current branch uses: actions/download-artifact@v7 with: pattern: coverage-${{ matrix.flag }}-*
- name: Get total coverage of current branch shell: bash -x -e -u -o pipefail {0} if: always() run: | pip install coverage
ls -al . ls -al coverage-*/ coverage combine --keep $(ls coverage-*/.coverage) coverage report -i rm -rf coverage-* ls -al
- name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} verbose: true flags: ${{ matrix.flag }}
- name: Upload artifacts uses: actions/upload-artifact@v6 with: name: coverage-${{ matrix.flag }}-aggregated path: | .coverage include-hidden-files: true123456789101112131415161718192021222324252627282930313233343536# If the PR get's updated by a new commit, it prevents auto-merges# since there's no CI event attached to the commit anymore.# This workflow re-attaches the label after a push, if the PR# was already labeled prior to the push.name: CICD Relabel bot
on: pull_request_target:
jobs: relabel: runs-on: ubuntu-latest env: PR_NUMBER: ${{ github.event.number }} GH_TOKEN: ${{ secrets.NEMO_RELABEL_TOKEN }} HOSTNAME: ${{ github.server_url }} permissions: write-all steps: - name: Checkout repo uses: actions/checkout@v6
- name: Check if PR was already labeled with `Run CICD` id: pre-flight run: | LABELS=$(gh pr view "$PR_NUMBER" --json labels) HAS_LABEL=$(echo $LABELS \ | jq '[.labels[].name] | any(. == "Run CICD")' )
echo "has-label=$HAS_LABEL" | tee -a "$GITHUB_OUTPUT"
- name: Relabel PR if: ${{ steps.pre-flight.outputs.has-label == 'true' }} run: | gh pr edit "$PR_NUMBER" --remove-label "Run CICD" gh pr edit "$PR_NUMBER" --add-label "Run CICD"1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465name: Claude Answer Issue
on: issue_comment: types: [created]
permissions: contents: read issues: write id-token: write
jobs: authorize: if: >- !github.event.issue.pull_request && contains(github.event.comment.body, '/claude answer') runs-on: ubuntu-latest steps: - name: Check team membership uses: actions/github-script@v8 with: github-token: ${{ secrets.ORG_TEAM_READ_TOKEN }} script: | const username = context.payload.comment.user.login; try { const res = await github.rest.teams.getMembershipForUserInOrg({ org: 'NVIDIA-NeMo', team_slug: 'speech_team', username, }); if (res.data.state !== 'active') { core.setFailed(`${username} is not an active member of NVIDIA Speech Team`); } } catch (e) { core.setFailed(`${username} is not a member of NVIDIA Speech Team`); }
acknowledge: needs: authorize runs-on: ubuntu-latest steps: - name: Add eyes reaction to comment uses: actions/github-script@v8 with: script: | await github.rest.reactions.createForIssueComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: context.payload.comment.id, content: 'eyes' });
claude-answer: needs: acknowledge runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: anthropics/claude-code-action@v1 with: prompt: | You are a helpful assistant for the NeMo repository. Answer the user's question based on the issue description, comments, and the codebase. Be concise and provide code references where relevant. Do NOT make any code changes or create PRs — only answer the question. anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114name: Claude Fix Issue
on: issue_comment: types: [created]
permissions: contents: write pull-requests: write issues: write id-token: write
jobs: authorize: if: >- !github.event.issue.pull_request && contains(github.event.comment.body, '/claude fix') runs-on: ubuntu-latest steps: - name: Check team membership uses: actions/github-script@v8 with: github-token: ${{ secrets.ORG_TEAM_READ_TOKEN }} script: | const username = context.payload.comment.user.login; try { const res = await github.rest.teams.getMembershipForUserInOrg({ org: 'NVIDIA-NeMo', team_slug: 'speech_team', username, }); if (res.data.state !== 'active') { core.setFailed(`${username} is not an active member of NVIDIA Speech Team`); } } catch (e) { core.setFailed(`${username} is not a member of NVIDIA Speech Team`); }
acknowledge: needs: authorize runs-on: ubuntu-latest steps: - name: Add eyes reaction to comment uses: actions/github-script@v8 with: script: | await github.rest.reactions.createForIssueComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: context.payload.comment.id, content: 'eyes' });
claude-fix: needs: acknowledge runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: anthropics/claude-code-action@v1 id: claude with: prompt: | You are a developer working on the NeMo repository. Implement a focused fix for the issue based on the issue description and comments.
Requirements: - Always use `git commit -s` to sign off all commits (DCO requirement). - Prioritize correctness and minimal scope; avoid unrelated refactors. - Reproduce or reason about the failure first, then implement the smallest robust fix. - If required, add or update tests for the changed behavior. If tests are not feasible, explain why. - If required, update related docs or comments when behavior or usage changes.
PR expectations: - Create a new branch and open a pull request with your changes. - Include a concise summary of root cause and fix based on the following PR template: ``` # What does this PR do ? Add a one line overview of what this PR aims to accomplish.
# Changelog Add specific line by line info of high level changes in this PR.
# Usage Add a usage example of the changed functionality. Related to #${{ github.event.issue.number }}
This PR is created by Claude. ```
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
- name: Label PR with agent-contribution if: steps.claude.outputs.branch_name uses: actions/github-script@v8 with: script: | const prs = await github.rest.pulls.list({ owner: context.repo.owner, repo: context.repo.repo, head: `${context.repo.owner}:${process.env.BRANCH_NAME}`, state: 'open' }); if (prs.data.length > 0) { await github.rest.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, issue_number: prs.data[0].number, labels: ['agent-contribution'] }); } env: BRANCH_NAME: ${{ steps.claude.outputs.branch_name }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758name: Claude Code Review
on: issue_comment: types: [created]
permissions: contents: read pull-requests: write issues: write id-token: write
jobs: acknowledge: if: >- github.event.issue.pull_request && contains(github.event.comment.body, '/claude review') runs-on: ubuntu-latest steps: - name: Add eyes reaction to comment uses: actions/github-script@v8 with: script: | await github.rest.reactions.createForIssueComment({ owner: context.repo.owner, repo: context.repo.repo, comment_id: context.payload.comment.id, content: 'eyes' });
claude-review: needs: acknowledge uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_claude_review.yml@v0.79.0 with: prompt: | You are doing a light code review. Keep it concise and actionable.
Focus ONLY on: - Critical bugs or logic errors - Typos in code, comments, or strings - Missing or insufficient test coverage for changed code - Outdated or inaccurate documentation affected by the changes
Do NOT comment on: - Style preferences or formatting - Minor naming suggestions - Architectural opinions or refactoring ideas - Performance unless there is a clear, measurable issue
Provide feedback using inline comments for specific code suggestions. Use top-level comments for general observations.
IMPORTANT: Do NOT approve the pull request. Only leave comments.
It's perfectly acceptable to not have anything to comment on. If you do not have anything to comment on, post "LGTM". secrets: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}12345678910111213141516171819202122232425name: Stale-Close-Inactive-Issues-PRson: schedule: - cron: "30 1 * * *"
jobs: close-issues: runs-on: ubuntu-latest permissions: issues: write pull-requests: write steps: - uses: actions/stale@v6 with: operations-per-run: 100 days-before-issue-stale: 30 days-before-issue-close: 7 stale-issue-label: "stale" stale-issue-message: "This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days." close-issue-message: "This issue was closed because it has been inactive for 7 days since being marked as stale." days-before-pr-stale: 14 days-before-pr-close: 7 stale-pr-message: "This PR is stale because it has been open for 14 days with no activity. Remove stale label or comment or update or this will be closed in 7 days." close-pr-message: "This PR was closed because it has been inactive for 7 days since being marked as stale." repo-token: ${{ secrets.GITHUB_TOKEN }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273name: Isort and Black Formatting# Incrementally reformat only changed files with black, all files with isort## Replaces pre-commit.ci, since it reformats all the files.# See issue https://github.com/pre-commit-ci/issues/issues/90## The action requires a custom token to trigger workflow after pushing reformatted files back to the branch.# `secrets.GITHUB_TOKEN` can be used instead, but this will result# in not running necessary checks after reformatting, which is undesirable.# For details see https://github.com/orgs/community/discussions/25702
on: pull_request_target: paths: - "**.py" types: [opened, synchronize, reopened, labeled, unlabeled]
defaults: run: shell: bash -x -e -u -o pipefail {0}
jobs: reformat_with_isort_and_black: runs-on: ubuntu-latest permissions: # write permissions required to commit changes contents: write steps: - name: Checkout branch uses: actions/checkout@v6 with: # setup repository and ref for PRs, see # https://github.com/EndBug/add-and-commit?tab=readme-ov-file#working-with-prs repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} # custom token is required to trigger actions after reformatting + pushing token: ${{ secrets.NEMO_REFORMAT_TOKEN }} fetch-depth: 0
- name: Get changed files id: changed-files uses: step-security/changed-files@v45.0.1 with: files: | **.py
- name: Setup Python env uses: actions/setup-python@v6 with: python-version: "3.10"
- name: black uses: psf/black@stable if: ${{ steps.changed-files.outputs.any_changed == 'true' }} with: options: "--verbose" # apply only to changed files (pass explicitly the files) src: "${{ steps.changed-files.outputs.all_changed_files }}" version: "~= 24.3"
- name: isort uses: isort/isort-action@v1 if: ${{ steps.changed-files.outputs.any_changed == 'true' }} with: isort-version: "5.13.2" # reformat all files with isort – safe since the whole repo is already reformatted configuration: ""
- uses: EndBug/add-and-commit@v9 # Commit changes. Nothing is committed if no changes. with: message: Apply isort and black reformatting commit: --signoff1234567891011121314151617181920212223name: Check __init__ files
on: pull_request: types: [opened, synchronize, reopened]
jobs: check-init-files: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6
- name: Set up Python uses: actions/setup-python@v6 with: python-version: "3.11"
- name: Install init-file-checker run: pip install init-file-checker
- name: Run init-file-checker run: init-file-checker nemo/123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160name: PyLint and flake8 linting
on: pull_request: types: [opened, synchronize, reopened, labeled, unlabeled] workflow_call:
jobs: linting: name: "Domain: ${{ matrix.domain }}" runs-on: ubuntu-latest strategy: fail-fast: false matrix: domain: [speech, other] env: DOMAIN: ${{ matrix.domain }} steps: - name: Checkout uses: actions/checkout@v6
- name: Select filter id: filter run: | if [[ "$DOMAIN" == "speech" ]]; then FILTER=$(jq -crn '[ "nemo/collections/common/data/lhotse/*.py", "nemo/collections/asr/**/*.py", "nemo/collections/tts/**/*.py", "nemo/collections/audio/**/*.py", "nemo/collections/multimodal/speech_llm/**/*.py", "nemo/collections/speechlm/**/*.py", "nemo/collections/speechlm2/**/*.py" ] | join(",")')
else FILTER=$(jq -crn '[ "nemo/**/*.py", "!nemo/collections/common/data/lhotse/*.py", "!nemo/collections/asr/**/*.py", "!nemo/collections/tts/**/*.py", "!nemo/collections/audio/**/*.py", "!nemo/collections/multimodal/speech_llm/**/*.py", "!nemo/collections/speechlm/**/*.py", "!nemo/collections/speechlm2/**/*.py", "!nemo/export/**/*.py" ] | join(",")') fi
echo "main=$FILTER" | tee -a "$GITHUB_OUTPUT"
- name: Get changed files id: changed-files uses: step-security/changed-files@v45.0.1 with: files: ${{ steps.filter.outputs.main }} files_separator: "," separator: " "
- name: Run PyLint id: pylint env: CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} SKIP_DOCS: ${{ contains(github.event.pull_request.labels.*.name, 'skip-docs') }} SKIP_LINTING: ${{ contains(github.event.pull_request.labels.*.name, 'skip-linting') }} run: | if [[ -z "$CHANGED_FILES" ]]; then echo Nothing to lint. echo "exit-code=0" | tee -a "$GITHUB_OUTPUT" exit 0 fi
if [[ $SKIP_DOCS == true ]]; then ADDITIONAL_PYLINT_ARGS="--disable=C0115,C0116" else ADDITIONAL_PYLINT_ARGS="" fi
if [[ $SKIP_LINTING == true ]]; then ADDITIONAL_PYLINT_ARGS="--exit-zero" fi
pip install pylint set +e pylint $ADDITIONAL_PYLINT_ARGS --output "pylintrc.$DOMAIN.txt" --rcfile ".pylintrc.$DOMAIN" ${CHANGED_FILES[@]} echo "exit-code=$?" | tee -a "$GITHUB_OUTPUT"
- name: Run flake8 id: flake8 env: CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} SKIP_LINTING: ${{ contains(github.event.pull_request.labels.*.name, 'skip-linting') }} run: | if [[ -z "$CHANGED_FILES" ]]; then echo Nothing to lint. echo "exit-code=0" | tee -a "$GITHUB_OUTPUT" exit 0 fi
if [[ $SKIP_LINTING == true ]]; then ADDITIONAL_FLAKE8_ARGS="--exit-zero" else ADDITIONAL_FLAKE8_ARGS="" fi
pip install flake8 set +e flake8 $ADDITIONAL_FLAKE8_ARGS --output "flake8.$DOMAIN.txt" --config ".flake8.$DOMAIN" ${CHANGED_FILES[@]} echo "exit-code=$?" | tee -a "$GITHUB_OUTPUT"
- name: Summary env: PYLINT: ${{ steps.pylint.outputs.exit-code == 0 }} FLAKE8: ${{ steps.flake8.outputs.exit-code == 0 }} run: |
if [[ "$PYLINT" != "true" ]]; then echo "Pylint output:" | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY cat pylintrc.$DOMAIN.txt | tee -a $GITHUB_STEP_SUMMARY echo '```' | tee -a $GITHUB_STEP_SUMMARY fi
if [[ "$FLAKE8" != "true" ]]; then echo "Flake8 output:" | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY cat flake8.$DOMAIN.txt | tee -a $GITHUB_STEP_SUMMARY echo '```' | tee -a $GITHUB_STEP_SUMMARY fi
if [[ "$PYLINT" != "true" || "$FLAKE8" != "true" ]]; then echo "The following directories got scanned:" | tee -a $GITHUB_STEP_SUMMARY
echo '```' | tee -a $GITHUB_STEP_SUMMARY echo ${{ steps.filter.outputs.main }} | tee -a $GITHUB_STEP_SUMMARY echo '```' | tee -a $GITHUB_STEP_SUMMARY
exit 1 fi
Nemo_Linting_Test: needs: linting runs-on: ubuntu-latest if: always() steps: - name: Main env: RESULTS: ${{ toJson(needs.linting) }} run: | RESULT=$(echo "$RESULTS" | jq -r '.result')
if [[ "$RESULT" == "success" ]]; then echo "All passed." exit 0 else echo "Some linting domains failed." exit 1 fi123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475# For most projects, this workflow file will not need changing; you simply need# to commit it to your repository.## You may wish to alter this file to override the set of languages analyzed,# or to provide custom queries or build logic.## ******** NOTE ********# We have attempted to detect the languages in your repository. Please check# the `language` matrix defined below to confirm you have the correct set of# supported CodeQL languages.#name: "CodeQL"
on: push: branches: [ "main", "[rv][0-9]*", "gh-pages-src" ] pull_request: # The branches below must be a subset of the branches above branches: [ "main" ] schedule: - cron: '19 1 * * 4'
jobs: analyze: name: Analyze runs-on: ubuntu-latest permissions: actions: read contents: read security-events: write
strategy: fail-fast: false matrix: language: [ 'python' ] # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps: - name: Checkout repository uses: actions/checkout@v6
# Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. # By default, queries listed here will override any specified in a config file. # Prefix the list here with "+" to use these queries and those in the config file.
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs queries: security-and-quality # security-extended, config-file: ./.github/workflows/config/codeql.yml
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell. # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# If the Autobuild fails above, remove it and uncomment the following three lines. # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# - run: | # echo "Run, Build Application using script" # ./location_of_script_within_repo/buildscript.sh
- name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: category: "/language:${{matrix.language}}"123456789101112131415name: Community Bot
on: issues: types: [opened, edited, reopened, closed, deleted] issue_comment: types: [created, edited, deleted]
jobs: community-bot: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_community_bot.yml@v0.62.0 with: community_project_id: ${{ vars.COMMUNITY_PROJECT_ID }} secrets: GH_TOKEN: ${{ secrets.PAT }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134{ "categories": [ { "title": "## ASR\n\n<details><summary>Changelog</summary>", "labels": ["asr"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## TTS\n\n<details><summary>Changelog</summary>", "labels": ["tts"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## NLP / NMT\n\n<details><summary>Changelog</summary>", "labels": ["nlp", "nmt", "megatron"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## Text Normalization / Inverse Text Normalization\n\n<details><summary>Changelog</summary>", "labels": ["tn", "itn"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## NeMo Tools\n\n<details><summary>Changelog</summary>", "labels": ["tools"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## Export\n\n<details><summary>Changelog</summary>", "labels": ["export"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## Documentation\n\n<details><summary>Changelog</summary>", "labels": ["docs"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## Bugfixes\n\n<details><summary>Changelog</summary>", "labels": ["bug"], "exclude_labels": ["cherry-pick"] }, { "title": "</details>\n\n## Cherrypick\n\n<details><summary>Changelog</summary>", "labels": ["cherry-pick"], "exclude_labels": ["cherry-pick"] } ], "ignore_labels": [ "ignore" ], "sort": "ASC", "template": "\n${{CHANGELOG}}</details>\n\n## Uncategorized:\n\n<details><summary>Changelog</summary>\n\n${{UNCATEGORIZED}}\n</details>\n", "pr_template": "- ${{TITLE}} by @${{AUTHOR}} :: PR: #${{NUMBER}}", "empty_template": "${{OWNER}}\n${{REPO}}\n${{FROM_TAG}}\n${{TO_TAG}}", "label_extractor": [ { "pattern": "(.*tts.*)|(.*g2p.*)", "target": "tts", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*asr.*)|(.*ctc.*)|(.*rnnt.*)|(.*transducer.*)|(.*dali.*)|(.*k2.*)", "target": "asr", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*nlp.*)|(.*punctuation.*)|(.*capitalization.*)|(.*entity.*)|(.*glue.*)|(.*entity.*)|(.*retrieval.*)|(.*entity.*)|(.*intent.*)|(.*slot.*)|(.*entity.*)|(.*language.*)|(.*qa.*)|(.*token class.*)|(.*text class.*)", "target": "nlp", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*nmt.*)|(.*bignlp.*)|(.*megatron.*)|(.*machine.*)|(.*translation.*)|(.*gpt.*)", "target": "nmt", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*tn.*)|(.*itn.*)|(.*text norm.*)", "target": "tn", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*sde.*)|(.*ctc segment.*)", "target": "tools", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*trt.*)|(.*onnx.*)|(.*export.*)", "target": "export", "flags": "gimu", "on_property": ["title", "body"] }, { "pattern": "(.*\\[x\\] Documentation.*)", "target": "docs", "flags": "gmu", "on_property": ["title", "body"] }, { "pattern": "(.*\\[x\\] Bugfix.*)|(.*patch.*)", "target": "bug", "flags": "gmu", "on_property": ["title", "body"] }, { "pattern": "(.*cherry-pick.*)|(.*cherrypick.*)", "target": "cherrypick", "flags": "gimu", "on_property": ["title", "body"] } ], "duplicate_filter": { "pattern": ".+", "on_property": "title", "method": "match" }, "transformers": [ ], "max_tags_to_fetch": 100, "max_pull_requests": 500, "max_back_track_time_days": 365, "exclude_merge_branches": [ ], "tag_resolver": { "method": "semver" }}
123456789name: "CodeQL config"
paths: - nemo/ - tests/ - tools/ - scripts/ - examples/ - .github/12345678910111213141516171819202122# Copyright (c) 2020-2021, NVIDIA CORPORATION.## 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: Copyright check
on: pull_request:
jobs: copyright-check: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_copyright_check.yml@v0.2.0123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283name: CI-Install-Check
on: pull_request: paths: - "**"
concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true
jobs: test-installs-macos: name: ${{ matrix.os }}-py${{ matrix.python }}-${{ matrix.installer }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macos-latest] python: ["3.10", "3.11", "3.12"] installer: ["pip-install", "nemo-install"] steps: - name: Checkout repo uses: actions/checkout@v6
- name: Check disk space before cleanup run: df -h
- name: Free up disk space run: | # Remove unnecessary files on macOS sudo rm -rf /usr/local/lib/android || true sudo rm -rf /usr/local/.ghcup || true sudo rm -rf /usr/local/lib/node_modules || true brew cleanup || true # Clear pip cache pip cache purge || true
- name: Check disk space after cleanup run: df -h
- uses: actions/setup-python@v6 with: python-version: "${{ matrix.python }}"
- name: Install NeMo env: INSTALLER: ${{ matrix.installer }} NEMO_TAG: ${{ github.sha }} NEMO_REPO: ${{ github.server_url }}/${{ github.repository }} run: | if [[ "$INSTALLER" == "pip-install" ]]; then pip install --no-cache-dir -U pip pip install --no-cache-dir ".[all]" else export NEMO_TAG export NEMO_REPO export INSTALL_DIR=$(pwd)
pip install --no-cache-dir ".[all]" fi
- name: Check disk space after installation run: df -h
- name: Run import checks run: | # Run import checks for collection in "asr" "tts" "lightning" "core"; do python tests/core_ptl/check_imports.py --domain "$collection" done
test-installs-linux-amd: name: ubuntu-22.04-amd-py${{ matrix.python }}-${{ matrix.installer }} runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: python: ["3.10", "3.11", "3.12"] installer: ["pip-install", "nemo-install"] steps: - name: Checkout repo uses: actions/checkout@v6
- name: Check disk space before cleanup run: df -h
- name: Free up disk space run: | # Remove unnecessary packages and files on Ubuntu sudo apt-get clean sudo rm -rf /usr/local/lib/android || true sudo rm -rf /opt/ghc || true sudo rm -rf /usr/local/.ghcup || true sudo rm -rf /usr/share/dotnet || true sudo rm -rf /opt/az || true # Clear pip and npm caches pip cache purge || true sudo npm cache clean --force || true
- name: Check disk space after cleanup run: df -h
- name: Install Python uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }}
- name: Install NeMo env: INSTALLER: ${{ matrix.installer }} run: | if [ "$INSTALLER" = "pip-install" ]; then pip install --no-cache-dir --upgrade pip pip install --no-cache-dir ".[all]" else export INSTALL_DIR=$(pwd) pip install --no-cache-dir ".[all]" fi
- name: Check disk space after installation run: df -h
- name: Run import checks run: | # Run import checks for collection in "asr" "tts" "lightning" "core"; do python tests/core_ptl/check_imports.py --domain "$collection" done
test-asr-install-linux-amd: name: ubuntu-22.04-amd-py${{ matrix.python }}-asr runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: python: ["3.10", "3.11", "3.12"] steps: - name: Checkout repo uses: actions/checkout@v6
- name: Check disk space before cleanup run: df -h
- name: Free up disk space run: | # Remove unnecessary packages and files on Ubuntu sudo apt-get clean sudo rm -rf /usr/local/lib/android || true sudo rm -rf /opt/ghc || true sudo rm -rf /usr/local/.ghcup || true sudo rm -rf /usr/share/dotnet || true sudo rm -rf /opt/az || true # Clear pip and npm caches pip cache purge || true sudo npm cache clean --force || true
- name: Check disk space after cleanup run: df -h
- name: Install Python uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }}
- name: Install NeMo run: | pip install --no-cache-dir --upgrade pip pip install --no-cache-dir ".[asr]"
- name: Check disk space after installation run: df -h
- name: Run import checks run: | # Run import checks python tests/core_ptl/check_imports.py --domain asr
test-installs-linux-arm: name: ubuntu-22.04-arm-py${{ matrix.python }}-${{ matrix.installer }} runs-on: ubuntu-22.04-arm strategy: fail-fast: false matrix: python: ["3.10", "3.11", "3.12"] installer: ["pip-install", "nemo-install"] steps: - name: Checkout repo uses: actions/checkout@v6
- name: Check disk space before cleanup run: df -h
- name: Free up disk space run: | # Remove unnecessary packages and files on Ubuntu ARM sudo apt-get clean sudo rm -rf /usr/local/lib/android || true sudo rm -rf /opt/ghc || true sudo rm -rf /usr/local/.ghcup || true sudo rm -rf /usr/share/dotnet || true sudo rm -rf /opt/az || true # Clear pip and npm caches pip cache purge || true sudo npm cache clean --force || true
- name: Check disk space after cleanup run: df -h
- name: Install Python uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }}
- name: Install NeMo env: INSTALLER: ${{ matrix.installer }} run: | if [ "$INSTALLER" = "pip-install" ]; then pip install --no-cache-dir --upgrade pip pip install --no-cache-dir ".[all]" else export INSTALL_DIR=$(pwd) pip install --no-cache-dir ".[all]" fi
- name: Check disk space after installation run: df -h
- name: Run import checks run: | # Run import checks for collection in "asr" "tts" "lightning" "core"; do python tests/core_ptl/check_imports.py --domain "$collection" done
test-asr-installs-linux-arm: name: ubuntu-22.04-arm-py${{ matrix.python }}-asr runs-on: ubuntu-22.04-arm strategy: fail-fast: false matrix: python: ["3.10", "3.11", "3.12"] steps: - name: Checkout repo uses: actions/checkout@v6
- name: Check disk space before cleanup run: df -h
- name: Free up disk space run: | # Remove unnecessary packages and files on Ubuntu ARM sudo apt-get clean sudo rm -rf /usr/local/lib/android || true sudo rm -rf /opt/ghc || true sudo rm -rf /usr/local/.ghcup || true sudo rm -rf /usr/share/dotnet || true sudo rm -rf /opt/az || true # Clear pip and npm caches pip cache purge || true sudo npm cache clean --force || true
- name: Check disk space after cleanup run: df -h
- name: Install Python uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }}
- name: Install NeMo run: | pip install --no-cache-dir --upgrade pip pip install --no-cache-dir ".[asr]"
- name: Check disk space after installation run: df -h
- name: Run import checks run: | # Run import checks python tests/core_ptl/check_imports.py --domain asr1234567891011121314name: "Pull Request Labeler"on:- pull_request_target
jobs: triage: permissions: contents: read pull-requests: write runs-on: ubuntu-latest steps: - uses: actions/labeler@v4 with: repo-token: "${{ secrets.GITHUB_TOKEN }}"1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162# Regularly updates the CI containername: Megatron Tag Bump Boton: workflow_dispatch: schedule: - cron: 0 0 * * *
jobs: get-release-branch-names: runs-on: ubuntu-latest outputs: mcore: ${{ steps.get-branch.outputs.mcore_release_branch }} nemo: ${{ steps.get-branch.outputs.nemo_release_branch }} steps: - name: Get release branch names id: get-branch run: | latest_branch=$(git ls-remote --heads https://github.com/NVIDIA/Megatron-LM.git 'refs/heads/core_r*' | grep -o 'core_r[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -V | tail -n1) echo "mcore_release_branch=$latest_branch" >> $GITHUB_OUTPUT
latest_branch=$(git ls-remote --heads https://github.com/NVIDIA/NeMo.git 'refs/heads/r*' | grep -o 'r[0-9]\+\.[0-9]\+\.[0-9]\+' | sort -V | tail -n1) echo "nemo_release_branch=$latest_branch" >> $GITHUB_OUTPUT
bump-tags: needs: [get-release-branch-names] strategy: fail-fast: false matrix: include: - nemo-target-branch: ${{ needs.get-release-branch-names.outputs.nemo }} mcore-target-branch: ${{ needs.get-release-branch-names.outputs.mcore }} - nemo-target-branch: main mcore-target-branch: main uses: ./.github/workflows/_bump_mcore_tag.yml with: nemo-target-branch: ${{ matrix.nemo-target-branch }} mcore-target-branch: ${{ matrix.mcore-target-branch }} secrets: PAT: ${{ secrets.PAT }}
notify: if: failure() runs-on: ubuntu-latest needs: [bump-tags] steps: - name: Notify env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} SLACK_WEBHOOK_ADMIN: <!subteam^${{ secrets.SLACK_WEBHOOK_ADMIN }}> GITHUB_RUN_ID: ${{ github.run_id }} GITHUB_REPOSITORY: ${{ github.repository }} run: | curl -X POST \ -H 'Content-type: application/json' \ --data "{\"text\":\":robot_joy: <https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}|Mcore-bump-bot workflow> failed. Please fix manually.\n\ncc ${SLACK_WEBHOOK_ADMIN}\"}" \ $SLACK_WEBHOOK123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354name: ~shut down a single VM
on: workflow_call: inputs: vm: type: string description: Name of VM required: true n_gpus: type: string description: Number of GPUs this VM has required: true
jobs: check-status-and-maybe-shutdown: environment: main runs-on: ${{ inputs.vm }} outputs: status: ${{ steps.status.outputs.main }} steps: - name: Check status id: status run: | docker run --rm --runtime=nvidia --gpus ${{ inputs.n_gpus }} ubuntu nvidia-smi
NUM_GPUS=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l)
if [[ $NUM_GPUS -ne ${{ inputs.n_gpus }} ]]; then echo "Issues with GPU detected, will take this runner offline." echo "main=degraded" >> "$GITHUB_OUTPUT" else echo "main=healthy" >> "$GITHUB_OUTPUT" fi
- name: Send Slack message & Disconnect runner from GitHub if: ${{ steps.status.outputs.main == 'degraded' || failure() }} run: | MESSAGE='{ "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": ":alert: VM bot 🤖: Hey <!subteam^${{ secrets.SLACK_WEBHOOK_ADMIN }}>: VM `${{ inputs.vm }}` is having not the best day of their life, maybe bring them an apple or so." } } ] }'
curl -X POST -H "Content-type: application/json" --data "$MESSAGE" ${{ secrets.SLACK_WEBHOOK }}
cd /home/azureuser/actions-runner echo ${{ secrets.VM_KEY }} | sudo -S ./svc.sh stop123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354# Regularly updates the CI containername: Reboots VMs in a controlled wayon: schedule: - cron: 0/15 * * * * workflow_dispatch:
jobs: pre-flight: runs-on: ubuntu-latest if: github.repository_owner == 'NVIDIA' outputs: list-of-vms: ${{ steps.main.outputs.main }} environment: main steps: - name: Get list of VMs id: main env: GITHUB_TOKEN: ${{ secrets.PAT }} run: | RUNNERS=$(curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $GITHUB_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/NVIDIA/NeMo/actions/runners)
MATRIX=$(echo $RUNNERS \ | jq -c '[ .runners[] | select(.status == "online") | select(.name | contains("cpu") | not) | { "vm": .name, "n_gpus": [ .labels[] | select(.name | endswith("gpu")) | .name ][0][:1] } ] ' ) echo main=$MATRIX | tee -a "$GITHUB_OUTPUT"
maintenance: needs: pre-flight strategy: fail-fast: false matrix: include: ${{ fromJSON(needs.pre-flight.outputs.list-of-vms )}} uses: ./.github/workflows/monitor-single-vm.yml with: vm: ${{ matrix.vm }} n_gpus: ${{ matrix.n_gpus }} secrets: inherit # pragma: allowlist secret123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123# Copyright (c) 2026, NVIDIA CORPORATION.## 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: Release docson: workflow_dispatch: inputs: dry-run: description: Whether to run the workflow in dry-run mode required: true type: boolean default: true publish-as-latest: description: Publish as Latest stable version. required: false type: boolean default: true docs-version-override: description: Docs version if commit is not tagged required: false type: string default: "" update-version-picker: description: Update version picker. required: false type: boolean default: true notify-emails: description: Email addresses to send the notification to. Format as "me@me.com,you@you.com". required: false type: string github-ref: description: Github ref to checkout required: false type: string default: "" workflow_call: inputs: dry-run: description: Whether to run the workflow in dry-run mode required: false type: boolean default: true publish-as-latest: description: Publish as Latest stable version. required: false type: boolean default: true docs-version-override: description: Docs version if commit is not tagged required: false type: string default: "" update-version-picker: description: Update version picker. required: false type: boolean default: true notify-emails: description: Email addresses to send the notification to. Format as "me@me.com,you@you.com". required: false type: string github-ref: description: Github ref to checkout required: false type: string default: ""
jobs: build-docs: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_docs.yml@v0.83.0 with: ref: ${{ inputs.github-ref }} docs-directory: docs/source sync-all: true no-extras: "--no-extra cu12"
publish-docs: runs-on: ubuntu-latest needs: [build-docs] steps: - uses: actions/checkout@v6 with: repository: NVIDIA-NeMo/FW-CI-templates ref: v0.74.0 path: FW-CI-templates
- uses: ./FW-CI-templates/.github/actions/publish-docs # This workflow runs either on main, or on a version tag. Any other git ref will lead # to an error. # If its on main, it will publish to "latest" directory in Akamai. # If its on a versioned tag, it will extract the version number from the tag (strip `v` prefix) # and publish to the versioned directory in Akamai. with: dry-run: ${{ inputs.dry-run }} artifacts-name: docs-html artifacts-path: _build/html emails-csv: ${{ inputs.notify-emails && format('{0},{1}', vars.docs_release_emails, inputs.notify-emails) || vars.docs_release_emails }} overwrite-latest-on-tag: ${{ inputs.publish-as-latest }} docs-version-override: ${{ inputs.docs-version-override }} update-version-picker: ${{ inputs.update-version-picker }} run-on-version-tag-only: ${{ github.ref_name != 'main' }} request-name: nemo-speech-publish-docs-${{ github.run_id }} aws-region: ${{ vars.DOCS_AWS_REGION }} aws-role-to-assume: ${{ secrets.AWS_ASSUME_ROLE_ARN }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} akamai-host: ${{ secrets.AKAMAI_HOST }} akamai-client-token: ${{ secrets.AKAMAI_CLIENT_TOKEN }} akamai-client-secret: ${{ secrets.AKAMAI_CLIENT_SECRET }} akamai-access-token: ${{ secrets.AKAMAI_ACCESS_TOKEN }} s3-target-root: ${{ secrets.S3_BUCKET_NAME }} s3-target-path: nemo/speech12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485name: "Code freeze"
on: workflow_dispatch: inputs: type_of_release: type: choice description: Type of release options: - major - minor freeze-commit: type: string description: Commit SHA to use for cut-off required: false default: main mcore_version: description: "Version of MCore to use (must be a valid git ref)" required: true type: string dry-run: type: boolean description: Dry-run of code-freeze required: false default: true
jobs: code-freeze: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_code_freeze.yml@v0.86.0 with: library-name: NeMo-Toolkit python-package: nemo release-type: ${{ inputs.type_of_release }} freeze-commit: ${{ inputs.freeze-commit }} dry-run: ${{ inputs.dry-run }} use-pat: true secrets: SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }} SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} PAT: ${{ secrets.PAT }}
freeze-tags: runs-on: ubuntu-latest needs: [code-freeze] environment: main steps: - name: Checkout repository uses: actions/checkout@v6 with: path: ${{ github.run_id }} token: ${{ secrets.PAT }} fetch-depth: 0 fetch-tags: true ref: ${{ inputs.dry-run == true && inputs.freeze-commit || needs.code-freeze.outputs.release-branch }}
- name: Pin branch name in Notebooks run: | cd ${{ github.run_id }} find tutorials -type f -name "*.ipynb" -exec sed -i "s/BRANCH = 'main'/BRANCH = '${{ needs.code-freeze.outputs.release-branch }}'/g" {} +
- name: Pin MCore in Dockerfile run: | cd ${{ github.run_id }} sed -i 's/^ARG MCORE_TAG=.*$/ARG MCORE_TAG=${{ inputs.mcore_version }}/' docker/Dockerfile.ci
- name: Show status run: | cd ${{ github.run_id }} git status
- name: Create PR uses: peter-evans/create-pull-request@v6 id: create-pull-request if: ${{ inputs.dry-run != true }} with: path: ${{ github.run_id }} base: ${{ needs.code-freeze.outputs.release-branch }} branch: ci/freeze-tags-${{ needs.code-freeze.outputs.release-branch }} title: "Freeze tags in in `${{ needs.code-freeze.outputs.release-branch }}`" body: | 🚀 PR to freeze tags in `${{ needs.code-freeze.outputs.release-branch }}`.
commit-message: "[🤠]: Howdy folks, let's release NeMo `${{ needs.code-freeze.outputs.release-branch }}` !" signoff: true assignees: okoenig1234567891011121314151617181920212223242526272829# Copyright (c) 2026, NVIDIA CORPORATION.## 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: Release Nightly Docs
on: schedule: - cron: "0 10 * * *"
jobs: call-release-docs: uses: ./.github/workflows/release-docs.yml with: dry-run: false publish-as-latest: false docs-version-override: "nightly" update-version-picker: false secrets: inherit1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283# Copyright (c) 2020-2021, NVIDIA CORPORATION.## 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: "Release Neural Modules"
on: workflow_dispatch: inputs: release-ref: description: Ref (SHA or branch name) to release required: true type: string version-bump-branch: description: Branch for version bump required: true type: string dry-run: description: Do not publish a wheel and GitHub release. required: true default: true type: boolean create-gh-release: description: Create a GitHub release required: true default: true type: boolean generate-changelog: description: Generate changelog required: false default: true type: boolean publish-docs: description: Publish docs required: false default: false type: boolean gh-release-from-tag: description: Tag of previous release for changelog builder required: false type: string default: ""jobs: release: uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_release_library.yml@v0.80.3 with: release-ref: ${{ inputs.release-ref }} python-package: nemo python-version: "3.10" library-name: Neural Modules dry-run: ${{ inputs.dry-run }} version-bump-branch: ${{ inputs.version-bump-branch }} create-gh-release: ${{ inputs.create-gh-release }} app-id: ${{ vars.BOT_ID }} gh-release-use-changelog-builder: ${{ inputs.generate-changelog }} publish-docs: ${{ inputs.publish-docs }} gh-release-from-tag: ${{ inputs.gh-release-from-tag }} secrets: TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }} PAT: ${{ secrets.PAT }} SSH_KEY: ${{ secrets.SSH_KEY }} SSH_PWD: ${{ secrets.SSH_PWD }} BOT_KEY: ${{ secrets.BOT_KEY }} AWS_ASSUME_ROLE_ARN: ${{ secrets.AWS_ASSUME_ROLE_ARN }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AKAMAI_HOST: ${{ secrets.AKAMAI_HOST }} AKAMAI_CLIENT_TOKEN: ${{ secrets.AKAMAI_CLIENT_TOKEN }} AKAMAI_CLIENT_SECRET: ${{ secrets.AKAMAI_CLIENT_SECRET }} AKAMAI_ACCESS_TOKEN: ${{ secrets.AKAMAI_ACCESS_TOKEN }} S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}12345678910111213141516171819202122232425262728293031323334353637383940414243# Copyright (c) 2020-2021, NVIDIA CORPORATION.## 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: Secrets detector
on: pull_request_target: branches: - 'main'
jobs: main: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v6 with: fetch-depth: 0 token: ${{ secrets.NEMO_REFORMAT_TOKEN }}
- name: Install secrets detector run: pip install detect-secrets
- name: Run on change-set run: | git diff --name-only --diff-filter=d --merge-base origin/main -z | xargs -0 detect-secrets-hook --disable-plugin HexHighEntropyString --baseline .secrets.baseline - uses: EndBug/add-and-commit@v9 # Commit changes. Nothing is committed if no changes. if: always() with: message: Update baseline commit: --signoff123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110# Copyright (c) 2020-2021, NVIDIA CORPORATION.## 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: Update build cacheon: schedule: - cron: 0 0 * * * push: branches: - main workflow_dispatch: inputs: runner: required: false default: self-hosted-azure-builder type: string description: VM to use for build
jobs: pre-flight: runs-on: ubuntu-latest outputs: build_args: ${{ steps.manifest.outputs.BUILD_ARGS }} cache-from: ${{ steps.cache_from.outputs.LAST_PRS }} steps: - name: Checkout branch uses: actions/checkout@v6
- name: Parse manifest.json id: manifest run: | BUILD_ARGS=$(cat << EOF BASE_IMAGE=$(cat requirements/manifest.json | jq -r '."ngc-pytorch"') TRTLLM_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."trt-llm".repo') TRTLLM_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."trt-llm".ref') MLM_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."megatron-lm".repo') MLM_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies"."megatron-lm".ref') TE_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".transformer_engine.repo') TE_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".transformer_engine.ref') APEX_REPO=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".apex.repo') APEX_TAG=$(cat requirements/manifest.json | jq -r '."vcs-dependencies".apex.ref') EOF )
echo "BUILD_ARGS<<EOF" >> $GITHUB_OUTPUT echo "$BUILD_ARGS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
- name: Get last merged PR id: cache_from env: GH_TOKEN: ${{ github.token }} run: | LAST_PRS=$(gh api graphql -f query=' query { repository(owner: "NVIDIA", name: "NeMo") { pullRequests(states: MERGED, first: 100, orderBy: {field: UPDATED_AT, direction: DESC}) { nodes { number } } } }' | jq -r '.data.repository.pullRequests.nodes[].number' | while read -r number; do echo "nemoci.azurecr.io/nemo_container-buildcache:$number" done)
echo "LAST_PRS<<EOF" >> $GITHUB_OUTPUT echo "$LAST_PRS" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
cicd-test-container-build: needs: [pre-flight] uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/_build_container.yml@v0.27.0 strategy: fail-fast: false matrix: include: - dockerfile: docker/Dockerfile.ci image-name: nemo_container_automodel - dockerfile: docker/Dockerfile.ci image-name: nemo_container_nemo2 - dockerfile: docker/Dockerfile.ci image-name: nemo_container_speech - dockerfile: docker/Dockerfile.ci image-name: nemo_container with: image-name: ${{ matrix.image-name }} dockerfile: ${{ matrix.dockerfile }} image-label: nemo-core build-args: | IMAGE_LABEL=nemo-core NEMO_TAG=${{ github.sha }} NEMO_REPO=https://github.com/NVIDIA/NeMo ${{ needs.pre-flight.outputs.BUILD_ARGS }} runner: ${{ inputs.runner || 'self-hosted-azure-builder' }} use-inline-cache: false prune-filter-timerange: 24h cache-from: | nemoci.azurecr.io/${{ matrix.image-name }}-buildcache:main ${{ needs.pre-flight.outputs.cache-from }}.coveragercAdded+36
.dockerignoreAdded+19
.flake8Added+9
.flake8.otherAdded+9
.flake8.speechAdded+9
.gitattributes+1
.github/CODEOWNERSAdded
.github/ISSUE_TEMPLATE/bug_report.mdAdded+42
.github/ISSUE_TEMPLATE/config.ymlAdded+2
.github/ISSUE_TEMPLATE/dev_container_bug_report.mdAdded+35
.github/ISSUE_TEMPLATE/feature_request.mdAdded+25
.github/PULL_REQUEST_TEMPLATE.mdAdded+57
.github/actions/cancel-workflow/action.ymlAdded+25
.github/actions/test-template/action.ymlAdded+231
.github/labeler.ymlAdded+41
.github/scripts/__init__.pyAdded
.github/scripts/notify.pyAdded+79
.github/workflows/_build_container.ymlAdded+89
.github/workflows/_bump_mcore_tag.ymlAdded+56
.github/workflows/build-docs.ymlAdded+76
.github/workflows/build-test-publish-wheel.ymlAdded+38
.github/workflows/cherry-pick-release-commit.ymlAdded+14
.github/workflows/cicd-approve-test-queue.ymlAdded+175
.github/workflows/cicd-main-speech.ymlAdded+483
.github/workflows/cicd-main-unit-tests.ymlAdded+105
.github/workflows/cicd-main.ymlAdded+395
.github/workflows/cicd-relabel-bot.ymlAdded+36
.github/workflows/claude-answer.ymlAdded+65
.github/workflows/claude-fix.ymlAdded+114
.github/workflows/claude-review.ymlAdded+58
.github/workflows/close-inactive-issue-pr.ymlAdded+25
.github/workflows/code-formatting.ymlAdded+73
.github/workflows/code-init-file-checker.ymlAdded+23
.github/workflows/code-linting.ymlAdded+160
.github/workflows/codeql.ymlAdded+75
.github/workflows/community-bot.ymlAdded+15
.github/workflows/config/changelog-config.jsonAdded+134
.github/workflows/config/codeql.ymlAdded+9
.github/workflows/copyright-check.ymlAdded+22
.github/workflows/install-test.ymlAdded+283
.github/workflows/labeler.ymlAdded+14
.github/workflows/mcore-tag-bump-bot.ymlAdded+62
.github/workflows/monitor-single-vm.ymlAdded+54
.github/workflows/monitor-vms.ymlAdded+54
.github/workflows/release-docs.ymlAdded+123
.github/workflows/release-freeze.ymlAdded+85
.github/workflows/release-nightly-docs.ymlAdded+29
.github/workflows/release.ymlAdded+83
.github/workflows/secrets-detector.ymlAdded+43
.github/workflows/update-buildcache.ymlAdded+110