Skip to content

Commit bada8f9

Browse files
authored
ci(fix): Run tests label (#1970) (#2006)
Signed-off-by: oliver könig <[email protected]>
1 parent c22c2aa commit bada8f9

26 files changed

+321
-88
lines changed

.github/workflows/auto-assign-milestone.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
assign-milestone:
1515
runs-on: ubuntu-latest
1616
environment: nemo-ci
17+
if: github.repository == 'NVIDIA/Megatron-LM'
1718
steps:
1819
- name: Get PR info
1920
id: get-pr-info
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
3+
name: Auto Reminder Bot
4+
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: "0 12 * * *"
9+
10+
jobs:
11+
run-script:
12+
environment: main
13+
name: Run Auto Reminder Bot
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'NVIDIA/Megatron-LM'
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.10"
24+
25+
- name: Install dependencies
26+
run: |
27+
pip install --no-cache-dir PyGithub slack-sdk
28+
29+
- name: Run Auto Reminder Bot
30+
run: |
31+
export SLACK_TOKEN=${{ secrets.SLACK_TOKEN }}
32+
export SLACK_WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK_URL }}
33+
export GH_TOKEN=${{ secrets.PAT }}
34+
python tests/test_utils/python_scripts/auto_reminder_github.py
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
3+
name: Auto Swap Labels
4+
on:
5+
pull_request_review:
6+
types: [submitted]
7+
8+
permissions:
9+
pull-requests: write
10+
contents: read
11+
12+
jobs:
13+
check-approval:
14+
runs-on: ubuntu-latest
15+
if: github.event.review.state == 'approved' && github.repository == 'NVIDIA/Megatron-LM'
16+
steps:
17+
- name: Check out repository code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.10"
24+
25+
- name: Install dependencies
26+
run: |
27+
pip install --no-cache-dir PyGithub slack-sdk
28+
29+
- name: Run Auto Reminder Bot
30+
run: |
31+
export GH_TOKEN=${{ github.token }}
32+
export PR_NUMBER=${{ github.event.pull_request.number }}
33+
python tests/test_utils/python_scripts/swap_pr_labels.py

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ permissions:
3535
jobs:
3636
pre-flight:
3737
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
38+
if: github.repository == 'NVIDIA/Megatron-LM'
3839

3940
build-test-publish-wheel:
4041
needs: [pre-flight]
4142
if: |
4243
!(needs.pre-flight.outputs.docs_only == 'true'
4344
|| needs.pre-flight.outputs.is_merge_group == 'true'
4445
|| needs.pre-flight.outputs.is_deployment_workflow == 'true')
46+
&& github.repository == 'NVIDIA/Megatron-LM'
4547
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
4648
with:
4749
dry-run: true
@@ -68,6 +70,7 @@ jobs:
6870
|| needs.pre-flight.outputs.is_deployment_workflow == 'true'
6971
|| always()
7072
)
73+
&& github.repository == 'NVIDIA/Megatron-LM'
7174
&& !cancelled()
7275
runs-on: ubuntu-latest
7376
steps:

.github/workflows/cherry-pick-release-commit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
jobs:
2323
cherry-pick:
2424
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
25+
if: github.repository == 'NVIDIA/Megatron-LM'
2526
with:
2627
target-branches-pattern: 'core_(*dev_)?r[0-9]+\.[0-9]+\.[0-9]+'
2728
secrets:

.github/workflows/cicd-approve-test-queue.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ jobs:
2323
approve-queue:
2424
runs-on: ubuntu-latest
2525
environment: main
26+
if: github.repository == 'NVIDIA/Megatron-LM'
2627
strategy:
2728
matrix:
2829
branch: [main, dev]

.github/workflows/cicd-main.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14+
1415
name: CICD Megatron-LM
1516
on:
1617
schedule:
@@ -150,6 +151,7 @@ jobs:
150151
151152
pre-flight:
152153
needs: [is-not-external-contributor]
154+
if: github.repository == 'NVIDIA/Megatron-LM'
153155
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
154156

155157
linting:
@@ -251,11 +253,6 @@ jobs:
251253
apt-get update
252254
apt-get install -y gh
253255
254-
- name: Pull cache
255-
run: |
256-
docker pull ${{ env.container-registry }}/megatron-lm:main || true
257-
docker pull ${{ env.container-registry }}/megatron-lm:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number }} || true
258-
259256
- name: Get last merged PR
260257
id: cache_from
261258
env:
@@ -271,13 +268,16 @@ jobs:
271268
}
272269
}
273270
}' | jq -r '.data.repository.pullRequests.nodes[].number' | while read -r number; do
274-
echo "${{ env.container-registry }}/megatron-lm:$number"
271+
echo "type=registry,ref=${{ env.container-registry }}/megatron-lm:$number-buildcache,mode=max"
275272
done)
276273
277274
echo "LAST_PRS<<EOF" | tee -a $GITHUB_OUTPUT
278275
echo "$LAST_PRS" | tee -a $GITHUB_OUTPUT
279276
echo "EOF" | tee -a $GITHUB_OUTPUT
280277
278+
- name: Set up Docker Buildx
279+
uses: docker/setup-buildx-action@v3
280+
281281
- name: Build and push
282282
uses: docker/build-push-action@v5
283283
with:
@@ -288,9 +288,11 @@ jobs:
288288
build-args: |
289289
FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:25.09-py3
290290
cache-from: |
291-
${{ env.container-registry }}/megatron-lm:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}
292-
${{ env.container-registry }}/megatron-lm:main
291+
type=registry,ref=${{ env.container-registry }}/megatron-lm:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}-buildcache,mode=max
292+
type=registry,ref=${{ env.container-registry }}/megatron-lm:main-buildcache,mode=max
293293
${{ steps.cache_from.outputs.LAST_PRS }}
294+
cache-to: |
295+
type=registry,ref=${{ env.container-registry }}/megatron-lm:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}-buildcache,mode=max
294296
no-cache: false
295297
tags: |
296298
${{ env.container-registry }}/megatron-lm:${{ fromJSON(steps.get-pr-info.outputs.pr-info || '{}').number || 0 }}
@@ -368,6 +370,7 @@ jobs:
368370
- cicd-wait-in-queue
369371
- cicd-container-build
370372
- cicd-unit-tests-latest
373+
environment: nemo-ci
371374
if: |
372375
(
373376
success()
@@ -399,21 +402,26 @@ jobs:
399402
- name: Parse functional tests
400403
id: main
401404
env:
402-
HAS_RUN_TESTS_LABEL: ${{ steps.has-run-tests-label.outputs.HAS_RUN_TESTS_LABEL }}
405+
HAS_RUN_TESTS_LABEL: ${{ steps.has-run-tests-label.outputs.main }}
403406
run: |
404407
export PYTHONPATH=$(pwd)
405408
406409
if [ "$HAS_RUN_TESTS_LABEL" == "true" ]; then
407410
ARGS=(
408-
--scope mr
411+
--scope mr-github
409412
--enable-lightweight-mode
410413
)
414+
echo ":warning: The Run tests label is not yet supported."
411415
else
412416
ARGS=(
413417
--scope mr-slim
414418
)
415419
fi
416420
421+
ARGS=(
422+
--scope mr-slim
423+
)
424+
417425
python tests/test_utils/python_scripts/generate_jet_trigger_job.py \
418426
--n-repeat 5 \
419427
--time-limit 2700 \

.github/workflows/close-inactive-issue-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ on:
1818

1919
jobs:
2020
close-issues:
21+
if: github.repository == 'NVIDIA/Megatron-LM'
2122
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]

.github/workflows/community-bot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ on:
2222
jobs:
2323
community-bot:
2424
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
25+
if: github.repository == 'NVIDIA/Megatron-LM'
2526
secrets:
2627
GH_TOKEN: ${{ secrets.PAT }}
2728
environment: main

.github/workflows/copyright-check.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,21 @@ on:
2121
- main
2222
- "pull-request/[0-9]+"
2323
- "deploy-release/*"
24+
merge_group:
25+
types: [checks_requested]
2426

2527
jobs:
2628
pre-flight:
27-
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
29+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
30+
if: github.repository == 'NVIDIA/Megatron-LM'
2831

2932
copyright-check:
3033
needs: [pre-flight]
3134
if: |
3235
!(needs.pre-flight.outputs.docs_only == 'true'
3336
|| needs.pre-flight.outputs.is_deployment_workflow == 'true')
34-
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
37+
&& github.repository == 'NVIDIA/Megatron-LM'
38+
uses: NVIDIA-NeMo/FW-CI-templates/.github/workflows/[email protected]
3539

3640
copyright-check-summary:
3741
needs: [pre-flight, copyright-check]
@@ -42,9 +46,12 @@ jobs:
4246
|| always()
4347
)
4448
&& !cancelled()
49+
&& github.repository == 'NVIDIA/Megatron-LM'
4550
runs-on: ubuntu-latest
4651
steps:
4752
- name: Result
53+
env:
54+
SKIPPING_IS_ALLOWED: ${{ needs.pre-flight.outputs.docs_only == 'true' || needs.pre-flight.outputs.is_deployment_workflow == 'true' || needs.pre-flight.outputs.is_merge_group == 'true' || needs.pre-flight.outputs.is_ci_workload == 'true' }}
4855
run: |
4956
FAILED_JOBS=$(gh run view $GITHUB_RUN_ID --json jobs --jq '[.jobs[] | select(.status == "completed" and .conclusion != "success")] | length') || echo 0
5057

0 commit comments

Comments
 (0)