[TRTLLMINF-237][infra] Adopt resourceLedger.withResource for BuildDockerImage - #17136
[TRTLLMINF-237][infra] Adopt resourceLedger.withResource for BuildDockerImage#17136dpitman-nvda wants to merge 2 commits into
Conversation
…ogin in BuildDockerImage
Phase 2 of the pipeline resource-reconciliation work (shared-lib resourceLedger
landed in TRTLLMINF-237): adopt the Tier-1 withResource guard for the clearest
same-context case as a proof of the API.
buildImage() logs into two Docker registries and must log out on both success
and failure. Replace the hand-rolled try/catch/finally + containerGenFailure +
manual rethrow with a single resourceLedger.withResource whose reclaim performs
the logout. Behavior is preserved -- logout still runs in a finally on either
path and the body's own error still propagates -- with two improvements:
- the login is registered in the build-scoped ledger, so if the build pod dies
before the finally runs, the entry is left live for a post-build sweep
(Phase 3) instead of being silently lost;
- a logout (reclaim) failure is now logged rather than masking the build's own
failure.
Validated: Groovy AST parse of the modified file succeeds.
Signed-off-by: Derek Pitman <dpitman@nvidia.com>
|
/bot run |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughChangesDocker login cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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/BuildDockerImage.groovy`:
- Around line 328-344: Move both Docker login operations from before
resourceLedger.withResource into its body for the
docker-login/${config.stageName} resource. Ensure registration occurs before the
first login, while preserving the existing reclaim callback and build behavior.
- Around line 340-341: Update the logout steps in the reclaim callback so the
two docker logout commands execute independently: wrap each command in its own
error-handling block, log that registry’s failure, and continue to the other
logout even when one returns a nonzero status. Preserve both existing registry
targets.
🪄 Autofix (Beta)
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: babffdd0-0728-45aa-8282-25d9b027245d
📒 Files selected for processing (1)
jenkins/BuildDockerImage.groovy
|
PR_Github #63104 [ run ] triggered by Bot. Commit: |
|
PR_Github #63104 [ run ] completed with state
|
…docker-login - Register the docker-login resource before the logins: move both `docker login`s into the withResource body (new "Docker Login" stage) so any registry we authenticate to is owed a logout even if a later login (or the pod) fails partway through. Previously the logins ran in "Install Package" before withResource, so a second-login failure left the first login with no reclaim. - Make the logout reclaim best-effort and independent: each `docker logout` runs in its own try/catch and is logged on failure, so failing to log out of one registry can no longer skip logging out of the other. Validated: Groovy AST parse of the modified file succeeds. Signed-off-by: Derek Pitman <dpitman@nvidia.com>
|
/bot run --disable-fail-fast |
|
PR_Github #63125 [ run ] triggered by Bot. Commit: |
|
PR_Github #63125 [ run ] completed with state
|
Dev Engineer Review
BuildDockerImage.buildImage()registers Docker logins withresourceLedger.withResource.QA Engineer Review
No test changes.
Description
buildImage() logs into two Docker registries and must log out on both success and failure. Replace the hand-rolled try/catch/finally + containerGenFailure + manual rethrow with a single resourceLedger.withResource whose reclaim performs the logout. Behavior is preserved -- logout still runs in a finally on either path and the body's own error still propagates -- with two improvements:
Validated: Groovy AST parse of the modified file succeeds.
Test Coverage
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-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin 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.