-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[TRTLLM-8000][infra] Catch error in merge waive list stage #7289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThe 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
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
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this 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.
📒 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.
jenkins/L0_MergeRequest.groovy
Outdated
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')]) { |
There was a problem hiding this comment.
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?
Signed-off-by: Yiqing Yan <[email protected]>
Signed-off-by: Yiqing Yan <[email protected]>
8c0b8ed
to
5105b77
Compare
Co-authored-by: Yanchao Lu <[email protected]> Signed-off-by: Yiqing Yan <[email protected]>
/bot run --skip-test |
PR_Github #18320 [ run ] triggered by Bot |
PR_Github #18320 [ run ] completed with state |
/bot run --skip-test |
PR_Github #18351 [ run ] triggered by Bot |
PR_Github #18351 [ run ] completed with state |
Summary by CodeRabbit
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 thestage-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.