Skip to content

Conversation

yiqingy0
Copy link
Collaborator

@yiqingy0 yiqingy0 commented Aug 27, 2025

Summary by CodeRabbit

  • New Features
    • Merged waiver list is uploaded with a publicly accessible URL logged for quick access.
    • Waiver files are now uniquely named per commit for clearer traceability.
  • Bug Fixes
    • Improved error handling prevents non-critical failures from breaking the pipeline.
    • Diff generation is more reliable by avoiding shell escaping issues.
  • Chores
    • Enhanced logging around waiver merging for better visibility.
    • Stability tweaks to the waiver merge process without changing overall workflow.

Description

Test Coverage

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

📝 Walkthrough

Walkthrough

The mergeWaiveList stage in jenkins/L0_MergeRequest.groovy now wraps TOT waiver retrieval/merge in try/catch, computes and uses the TOT commit SHA in filenames, writes MR diff to a temp file, merges waivers via file-based inputs, uploads the merged waives.txt, and logs errors without failing except on InterruptedException.

Changes

Cohort / File(s) Summary
Jenkins MR waiver merge flow
jenkins/L0_MergeRequest.groovy
- Wrap TOT waiver retrieval/merge in try/catch; rethrow InterruptedException, log and continue on other Exceptions
- Get TOT commit via git rev-parse HEAD on llm-tot checkout; use in waives_TOT_<commit>.txt naming
- Compute MR diff and write to temp diff_content.txt to avoid shell escaping issues
- Merge using --diff-file, waives_TOT_<commit>.txt, and waives_CUR_<commit>.txt to produce waives.txt
- Upload merged waives.txt and log public URL
- No signature changes

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Jenkins as Jenkins Pipeline
  participant MRStage as mergeWaiveList
  participant Git as Git (repos)
  participant FS as Workspace FS
  participant Merge as Waive Merge Script
  participant Uploader as Artifact Upload

  Jenkins->>MRStage: Start stage
  rect rgba(200,230,255,0.3)
    note right of MRStage: Protected by try/catch (non-interrupted)
    MRStage->>Git: Checkout llm-tot
    MRStage->>Git: rev-parse HEAD
    Git-->>MRStage: targetBranchTOTCommit
    MRStage->>FS: Copy TOT waive -> waives_TOT_<commit>.txt
    MRStage->>Git: Compute MR diff
    MRStage->>FS: Write diff_content.txt
    MRStage->>Merge: Run merge with --diff-file, TOT, CUR -> waives.txt
    Merge-->>MRStage: waives.txt
    MRStage->>Uploader: Upload waives.txt
    Uploader-->>MRStage: Public URL
  end

  alt InterruptedException
    MRStage-->>Jenkins: Rethrow (fail stage)
  else Other Exception
    MRStage-->>Jenkins: Log "Merge waive list failed..." and continue
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • niukuo
  • chzblych
  • ZhanruiSunCh

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
jenkins/L0_MergeRequest.groovy (5)

340-345: Default target branch and scope locals.

If neither env.gitlabTargetBranch nor globalVars[TARGET_BRANCH] is set, checkoutSource may fail. Also, prefer scoping these to the function.

-        LLM_TOT_ROOT = "llm-tot"
-        targetBranch = env.gitlabTargetBranch ? env.gitlabTargetBranch : globalVars[TARGET_BRANCH]
+        def LLM_TOT_ROOT = "llm-tot"
+        def targetBranch = (env.gitlabTargetBranch ?: globalVars[TARGET_BRANCH] ?: "main")
         echo "Target branch: ${targetBranch}"
         withCredentials([string(credentialsId: 'default-sync-llm-repo', variable: 'DEFAULT_SYNC_LLM_REPO')]) {
             trtllm_utils.checkoutSource(DEFAULT_SYNC_LLM_REPO, targetBranch, LLM_TOT_ROOT, false, false)
         }

346-349: Gracefully handle missing TOT waive list.

If waives.txt doesn’t exist on the target branch, the cp will fail and skip the rest of the try. Make this explicit and keep going.

-        targetBranchTOTCommit = sh (script: "cd ${LLM_TOT_ROOT} && git rev-parse HEAD", returnStdout: true).trim()
+        def targetBranchTOTCommit = sh (script: "cd ${LLM_TOT_ROOT} && git rev-parse HEAD", returnStdout: true).trim()
         echo "Target branch TOT commit: ${targetBranchTOTCommit}"
-        sh "cp ${LLM_TOT_ROOT}/tests/integration/test_lists/waives.txt ./waives_TOT_${targetBranchTOTCommit}.txt"
+        if (fileExists("${LLM_TOT_ROOT}/tests/integration/test_lists/waives.txt")) {
+            sh "cp ${LLM_TOT_ROOT}/tests/integration/test_lists/waives.txt ./waives_TOT_${targetBranchTOTCommit}.txt"
+        } else {
+            echo "TOT waive list not found: ${LLM_TOT_ROOT}/tests/integration/test_lists/waives.txt"
+        }

351-363: Short-circuit when there’s no diff; provide a safe fallback.

Avoid invoking the merge script on an empty diff; emit waives.txt deterministically from TOT (or CUR if TOT missing).

-        def diff = getMergeRequestOneFileChanges(pipeline, globalVars, "tests/integration/test_lists/waives.txt")
-
-        // Write diff to a temporary file to avoid shell escaping issues
-        writeFile file: 'diff_content.txt', text: diff
-
-        // Merge waive lists
-        sh """
-            python3 mergeWaiveList.py \
-            --cur-waive-list=waives_CUR_${env.gitlabCommit}.txt \
-            --latest-waive-list=waives_TOT_${targetBranchTOTCommit}.txt \
-            --diff-file=diff_content.txt \
-            --output-file=waives.txt
-        """
+        def diff = getMergeRequestOneFileChanges(pipeline, globalVars, "tests/integration/test_lists/waives.txt")
+        if (diff?.trim()) {
+            // Write diff to a temporary file to avoid shell escaping issues
+            writeFile file: 'diff_content.txt', text: diff
+            // Merge waive lists
+            sh """
+                python3 mergeWaiveList.py \
+                --cur-waive-list=waives_CUR_${env.gitlabCommit}.txt \
+                --latest-waive-list=waives_TOT_${targetBranchTOTCommit}.txt \
+                --diff-file=diff_content.txt \
+                --output-file=waives.txt
+            """
+        } else {
+            echo "No changes detected in waives.txt; using TOT (or CUR if TOT absent)."
+            sh "cp -f waives_TOT_${targetBranchTOTCommit}.txt waives.txt || cp -f waives_CUR_${env.gitlabCommit}.txt waives.txt"
+        }

357-363: Ensure python3 is available in the Preparation container.

This stage runs in a golang:1.22 image. Unless python3 is preinstalled, the merge step will always fall into the catch block. Please verify the base image content, or install python3 on-the-fly before invoking the script.

         // Merge waive lists
-        sh """
+        sh """
+            command -v python3 >/dev/null 2>&1 || \
+            (apt-get update && apt-get install -y python3 python3-pip) || \
+            (apk add --no-cache python3 py3-pip) || true
             python3 mergeWaiveList.py \
             --cur-waive-list=waives_CUR_${env.gitlabCommit}.txt \
             --latest-waive-list=waives_TOT_${targetBranchTOTCommit}.txt \
             --diff-file=diff_content.txt \
             --output-file=waives.txt
         """

364-370: Avoid misleading success message; upload artifacts even on failure.

Only advertise the merged URL when waives.txt exists, and still upload whatever artifacts exist if the merge fails.

-        trtllm_utils.uploadArtifacts("waives*.txt", "${UPLOAD_PATH}/waive_list/")
-        echo "New merged test waive list: https://urm.nvidia.com/artifactory/${UPLOAD_PATH}/waive_list/waives.txt"
+        trtllm_utils.uploadArtifacts("waives*.txt", "${UPLOAD_PATH}/waive_list/")
+        if (fileExists('waives.txt')) {
+            echo "New merged test waive list: https://urm.nvidia.com/artifactory/${UPLOAD_PATH}/waive_list/waives.txt"
+        } else {
+            echo "Merged waive list not generated; uploaded available waives_* artifacts for debugging."
+        }
     } catch (InterruptedException e) {
         throw e
     } catch (Exception e) {
-        echo "Merge waive list failed. Error: ${e.toString()}"
+        echo "Merge waive list failed. Error: ${e.toString()}"
+        // Upload what we have (e.g., waives_CUR_*.txt) to aid debugging.
+        trtllm_utils.uploadArtifacts("waives*.txt", "${UPLOAD_PATH}/waive_list/")
     }
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f167b1f and 8c0b8ed.

📒 Files selected for processing (1)
  • jenkins/L0_MergeRequest.groovy (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: yiqingy0
PR: NVIDIA/TensorRT-LLM#5198
File: jenkins/mergeWaiveList.py:0-0
Timestamp: 2025-07-22T08:33:49.109Z
Learning: In the TensorRT-LLM waive list merging system, removed lines are always located at the end of the merge waive lists, which is why the mergeWaiveList.py script uses reverse traversal - it's an optimization for this specific domain constraint.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (1)
jenkins/L0_MergeRequest.groovy (1)

338-366: Good hardening and traceability in mergeWaiveList.

Wrapping the TOT retrieval/merge in try/catch, stamping filenames with the TOT commit, and writing the MR diff to a temp file are solid improvements. This aligns well with the waive-merge script’s reverse-traversal optimization noted in prior learnings.

@yiqingy0 yiqingy0 marked this pull request as ready for review August 27, 2025 09:08
@yiqingy0 yiqingy0 requested review from a team as code owners August 27, 2025 09:08
LLM_TOT_ROOT = "llm-tot"
targetBranch = env.gitlabTargetBranch ? env.gitlabTargetBranch : globalVars[TARGET_BRANCH]
echo "Target branch: ${targetBranch}"
withCredentials([string(credentialsId: 'default-sync-llm-repo', variable: 'DEFAULT_SYNC_LLM_REPO')]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the blocker for moving to the default internal tekit repo?

@yiqingy0 yiqingy0 changed the title [None][infra] Catch error in merge waive list stage [TRTLLM-8000][infra] Catch error in merge waive list stage Sep 10, 2025
@yiqingy0 yiqingy0 force-pushed the fix_merge_waive_list branch from 8c0b8ed to 5105b77 Compare September 10, 2025 06:06
Co-authored-by: Yanchao Lu <[email protected]>
Signed-off-by: Yiqing Yan <[email protected]>
@yiqingy0
Copy link
Collaborator Author

/bot run --skip-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18320 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18320 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #13739 (Partly Tested) completed with status: 'FAILURE'

@yiqingy0
Copy link
Collaborator Author

/bot run --skip-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18351 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #18351 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #13765 (Partly Tested) completed with status: 'ABORTED'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants