Skip to content

[TRTLLMINF-237][infra] Re-home L0_Test SLURM finalizer - #17263

Open
dpitman-nvda wants to merge 3 commits into
NVIDIA:mainfrom
dpitman-nvda:user/dpitman/resource-ledger-l0test-rehome
Open

[TRTLLMINF-237][infra] Re-home L0_Test SLURM finalizer#17263
dpitman-nvda wants to merge 3 commits into
NVIDIA:mainfrom
dpitman-nvda:user/dpitman/resource-ledger-l0test-rehome

Conversation

@dpitman-nvda

@dpitman-nvda dpitman-nvda commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Replaced the local slurmResourceRegistry flow with shared resourceLedger integration.
  • Added separate ledger entries for dispatcher pods and SLURM jobs or nodes.
  • Restricted SLURM sweeping and reconciliation to slurmJob and slurmNode entries.
  • Delegated dispatcher pod-death classification to trtllm.ContextDeath.
  • Preserved attemptPodSpec for failure reconciliation.
  • Preserved existing call sites.
  • Added comments for the ContextDeath.isContextDeath patterns and the shared ledger register, markReclaimed, get, and reconcile contract.
  • Groovy AST parsing passed for the modified file.
  • No configuration, test, or test-list files changed.
  • Review should verify resourceLedger API usage, CPS safety, reconciliation idempotency, and best-effort error handling.
  • No test coverage is listed.

QA Engineer Review

No test changes.

Description

Replace the inlined per-stage slurmResourceRegistry and its finalize/sweep helpers with the shared trtllm-jenkins-shared-lib resourceLedger, and delegate dispatcher- pod-death detection to trtllm.ContextDeath. Behavior-preserving refactor; all registerSlurmResource/deregisterSlurmResource/isDispatcherPodFailure/ finalizeOrphanedSlurmResource/sweepOrphanedSlurmResources call sites are unchanged (only the function bodies are re-homed).

Test Coverage

N/A, this is a CI change

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

…sourceLedger

Replace the inlined per-stage slurmResourceRegistry and its finalize/sweep helpers
with the shared trtllm-jenkins-shared-lib resourceLedger, and delegate dispatcher-
pod-death detection to trtllm.ContextDeath. Behavior-preserving refactor; all
registerSlurmResource/deregisterSlurmResource/isDispatcherPodFailure/
finalizeOrphanedSlurmResource/sweepOrphanedSlurmResources call sites are unchanged
(only the function bodies are re-homed).

- State now lives in resourceLedger. Each SLURM stage registers two sibling ids:
  "<stage>/dispatcher-pod" (pod spec) and "<stage>/slurm" (per-attempt job/node).
  Keying them separately replaces the old merged-entry + partial-deregister
  (keep-podSpec) special case: markReclaimed drops only the job/node entry and
  leaves the pod spec a later attempt's off-pod reconciliation needs.
- reconcileSlurmResource is the reclaim body for both the in-catch finalize
  (selective reconcile of "<stage>/slurm") and the post-build sweep (selective
  reconcile of entries with a live job/node), returning true to deregister and
  false/leave-live on failure. The pod spec + container come from the sibling
  dispatcher-pod entry; the in-catch caller may override the pod spec.
- isDispatcherPodFailure now delegates to ContextDeath.isContextDeath (same
  patterns, plus recursive suppressed-cause traversal from the shared class).
- The ledger enforces CPS-safety on stored fields; the pod spec is a plain
  map of strings, so registration is unaffected.

Validated: Groovy AST parse of the modified file succeeds.
Signed-off-by: Derek Pitman <dpitman@nvidia.com>
@dpitman-nvda
dpitman-nvda requested a review from a team as a code owner August 4, 2026 18:56
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 2ae0a509-f153-43a2-9f6c-06276418fe23

📥 Commits

Reviewing files that changed from the base of the PR and between c3da484 and ad0a968.

📒 Files selected for processing (1)
  • jenkins/L0_Test.groovy
🚧 Files skipped from review as they are similar to previous changes (1)
  • jenkins/L0_Test.groovy

Walkthrough

The Jenkins pipeline classifies dispatcher-pod failures with ContextDeath and manages dispatcher-pod and SLURM resources through resourceLedger. Cleanup reconciles orphaned jobs and nodes during exception handling and the post-build sweep.

Changes

SLURM resource ledger reconciliation

Layer / File(s) Summary
Ledger adapters and failure classification
jenkins/L0_Test.groovy
The pipeline replaces the local SLURM registry with separate resourceLedger entries for dispatcher pods and SLURM resources. Cleanup reconstructs orphaned resources from sibling pod entries, and the post-build sweep reconciles remaining live entries. Dispatcher-pod failures use ContextDeath.isContextDeath(e), with the failed attempt pod specification available to reconciliation.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: mlefeb01, mzweilz

Sequence Diagram(s)

sequenceDiagram
  participant Pipeline
  participant resourceLedger
  participant DispatcherPod
  participant SlurmCluster
  Pipeline->>resourceLedger: Register dispatcher-pod and SLURM entries
  DispatcherPod-->>Pipeline: Report ContextDeath failure
  Pipeline->>resourceLedger: Read sibling pod entry
  Pipeline->>SlurmCluster: Clean reconstructed orphaned resources
  Pipeline->>resourceLedger: Sweep remaining live SLURM entries
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the infrastructure change to re-home the L0_Test SLURM finalizer.
Description check ✅ Passed The description explains the refactor, documents test coverage as a CI change, and includes the completed checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@jenkins/L0_Test.groovy`:
- Around line 864-871: In the dispatcher-pod reconciliation method containing
the try/catch around attemptPodSpec, declare def attemptPodSpec = null before
the try block, then assign the computed pod specification inside try. Ensure the
catch block can access that variable when calling reconciliation, while
preserving the existing finalizeOrphanedSlurmResource flow.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: e0f84327-e144-4274-bfdb-ae433d97f3fe

📥 Commits

Reviewing files that changed from the base of the PR and between be93500 and c3da484.

📒 Files selected for processing (1)
  • jenkins/L0_Test.groovy

Comment thread jenkins/L0_Test.groovy
… catch can see it

CodeRabbit (critical): in the singleAttempt branch of
runKubernetesPodWithInfraRetry, attemptPodSpec was declared with `def` inside the
try block but referenced in the catch block when reconciling a dispatcher-pod
death (finalizeOrphanedSlurmResource(pipeline, stageName, attemptPodSpec)).
Groovy block-scopes a try-local `def`, so the catch reference resolved as an
undefined property and threw MissingPropertyException on exactly the SLURM
off-pod reconciliation path -- masking the real failure and skipping cleanup.

Declare `def attemptPodSpec = null` above the try and assign it inside, so the
catch sees the failing attempt's pod spec. Pre-existing since the SLURM finalizer
landed (PR NVIDIA#16446); surfaced on this re-home because it lives in the same
reconciliation path.

Validated: Groovy AST parse of the modified file succeeds.
Signed-off-by: Derek Pitman <dpitman@nvidia.com>
@dpitman-nvda

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63836 [ run ] triggered by Bot. Commit: 367197b Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63836 [ run ] completed with state SUCCESS. Commit: 367197b
/LLM/main/L0_MergeRequest_PR pipeline #51776 completed with status: 'FAILURE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Ask a member of NVIDIA/trt-llm-ci-approvers to add the label, then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@BowenFu

BowenFu commented Aug 5, 2026

Copy link
Copy Markdown

Could you address two points before merge?

  • Scope sweepOrphanedSlurmResources to entries whose type is slurmJob or slurmNode. Filtering the shared ledger only by jobUID/nodeName could pass a future non-SLURM entry to reconcileSlurmResource.
  • Document or link the shared-library contracts used here: the ContextDeath.isContextDeath pattern set and the register/markReclaimed/get/reconcile behavior. The cleanup correctness depends on those replacements being behavior-equivalent.

The split ledger entries otherwise make the cleanup state clearer.

…ger contract

Address review (BowenFu):

- Scope reconciliation to this subsystem's entries. The resourceLedger is shared
  build-wide, so filtering only by jobUID/nodeName could pass a future non-SLURM
  entry to reconcileSlurmResource. sweepOrphanedSlurmResources now selects on
  type in ('slurmJob','slurmNode') as well as a live job/node, and
  reconcileSlurmResource early-returns false (leave untouched) for any non-SLURM
  entry a selector might pass in.
- Document the shared-library contract used here for equivalence with the
  replaced inlined finalizer: the ContextDeath.isContextDeath pattern set and the
  register/markReclaimed/get/reconcile behavior, in the finalizer comment block,
  and note that isDispatcherPodFailure now delegates to ContextDeath.

Validated: Groovy AST parse of the modified file succeeds.
Signed-off-by: Derek Pitman <dpitman@nvidia.com>
@dpitman-nvda

dpitman-nvda commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author
  • Scope sweepOrphanedSlurmResources to entries whose type is slurmJob or slurmNode. Filtering the shared ledger only by jobUID/nodeName could pass a future non-SLURM entry to reconcileSlurmResource.

Done. Selector now requires those typed entries and a live jobUID/nodeName. Also added a guard to reconcileSlurmResource so non-SLURM entries return false.

  • Document or link the shared-library contracts used here: the ContextDeath.isContextDeath pattern set and the register/markReclaimed/get/reconcile behavior. The cleanup correctness depends on those replacements being behavior-equivalent.

Updated the comments to explain the pattern set and semantics.

@dpitman-nvda

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64106 [ run ] triggered by Bot. Commit: ad0a968 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #64106 [ run ] completed with state SUCCESS. Commit: ad0a968
/LLM/main/L0_MergeRequest_PR pipeline #52030 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

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