fix(framework): clean up Volcano PodGroup when TrainJob transitions to Failed - #4034
fix(framework): clean up Volcano PodGroup when TrainJob transitions to Failed#4034Ayush-AM wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
🎉 Welcome to the Kubeflow Trainer! 🎉 Thanks for opening your first PR! We're happy to have you as part of our community 🚀 Here's what happens next:
Join the community:
Feel free to ask questions in the comments if you need any help or clarification! |
…o Failed When a Volcano-scheduled TrainJob transitions to a terminal state (such as Failed), its associated Volcano PodGroup was never cleaned up. This caused PodGroups to persist indefinitely in the cluster, reserving minResources in the Volcano queue and starving pending jobs. To resolve this cleanly without tight coupling: 1. Introduced TerminalCleanupPlugin interface in runtime framework. 2. Implemented TerminalCleanup in the Volcano plugin to idempotently delete controlled PodGroups. 3. Updated RBAC definitions with delete verb on scheduling.volcano.sh/podgroups. 4. Invoked TerminalCleanup in TrainJobReconciler upon job completion/failure. 5. Added comprehensive unit tests across plugin, framework, and reconciler. Closes kubeflow#4033 Signed-off-by: Ayush Mahajan <140263932+Ayush-AM@users.noreply.github.com>
b1e5cc5 to
a9836a9
Compare
|
Hi @kuizhiqing @robert-bell! 👋 Submitted PR #4034 to fix issue #4033 ("Volcano PodGroup is not cleaned up when TrainJob transitions to Failed"): All CI checks (PR title, DCO, and tests) are passing. Looking forward to your reviews! Thank you! |
What this PR does / why we need it:
When a Volcano-scheduled TrainJob transitions to the
Failedcondition (or reaches a terminal state), its associatedscheduling.volcano.sh/v1beta1 PodGroupobject was never deleted or cleaned up. Consequently, orphaned PodGroups remained in the cluster indefinitely, reservingminResourcesin Volcano scheduler queues and starving pending jobs.This PR addresses the issue cleanly and modularly:
TerminalCleanupPlugininterface (TerminalCleanup(ctx, trainJob) error) inpkg/runtime/frameworkso schedulers can clean up gang-scheduling resources on job completion without polluting the reconciler with vendor-specific logic.TerminalCleanupin the Volcano plugin (pkg/runtime/framework/plugins/volcano). It looks up the PodGroup corresponding to the TrainJob, validates ownership viametav1.IsControlledBy(podGroup, trainJob), and deletes it idempotently (client.IgnoreNotFound).r.Runtime.TerminalCleanup(ctx, &trainJob)inTrainJobReconciler.Reconcile()oncetrainjob.IsTrainJobFinished(&trainJob)is true.deleteverb forscheduling.volcano.sh/podgroupsin RBAC role definitions (manifests/base/rbac/role.yamlandcharts/kubeflow-trainer/templates/rbac/clusterrole.yaml).TestVolcano_TerminalCleanupcovering 6 test cases), Framework core (TestRunTerminalCleanupPlugins), and TrainJob reconciler (TestReconcile_TerminalCleanupverifying terminal cleanup on Failed and Complete jobs).Which issue(s) this PR fixes:
Fixes #4033
Checklist:
/assign @kuizhiqing @robert-bell
/cc @kuizhiqing @robert-bell