Repository navigation
fix(trainer): warn in check_compatibility when the Trainer release is unsupported - #670
abhishekKokadwar wants to merge 1 commit into
Conversation
… unsupported check_compatibility checked that the TrainJob CRD serves v1alpha1, which every Trainer 2.x release does, so a release outside the supported range (KUBEFLOW_TRAINER_VERSION_SPEC) passed and the agent was told to proceed. On a cluster with Trainer v2.2.0 it reported compatible with no warning. Read the release from the kubeflow-trainer-public ConfigMap (the same ConfigMap and KUBEFLOW_SYSTEM_NAMESPACE variable the SDK uses) and add a trainer_version check. Outside the range is a warning with a recommendation, not a blocker: a newer release often works, and users may run one on purpose. A release that cannot be read (missing ConfigMap, 403, custom build tag, no packaging library) is reported as unknown and never fails the tool. Fixes kubeflow#669 Assisted-by: AI coding agent Signed-off-by: Abhishek <abhikokadwar2@gmail.com>
|
[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 |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
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. |
Description
check_compatibilitychecked that the TrainJob CRD servesv1alpha1, which every Trainer 2.x release does, so a Trainer release outside the supported range (KUBEFLOW_TRAINER_VERSION_SPEC, today>=2.3.0,<2.4.0) passed and the agent was told to proceed (#669).This adds a
trainer_versioncheck:kubeflow-trainer-publicConfigMap (kubeflow_trainer_version), the same ConfigMap andKUBEFLOW_SYSTEM_NAMESPACEvariable (defaultkubeflow-system) the SDK reads inKubernetesBackend.verify_backend().status: "pass". Outside:status: "warn"plus a recommendation naming the installed and supported versions.kubeflow_trainer_versionkey, a custom-build value such aslatest, or nopackaginglibrary):status: "unknown"with a short reason, never a failure.Choices to review
compatibleandblockersdo not change. A release outside the tested range often works, and someone running a newer Trainer on purpose should not be stopped by the planning tool. Easy to make it a blocker below the minimum only, if preferred.prereleases=True), sov2.3.1-rc.1is in range andv2.4.0-rc.1is outside<2.4.0.get configmapsinkubeflow-system; without it the check isunknownand the tool works as before.unknowndetail uses the API error's reason (Not Found,Forbidden) rather thanstr(e), which carries the full HTTP headers and body.Related Issue
Fixes #669
Related: #514 widens the range to 2.4 (the check reads the constant, so it follows), #428 (readiness diagnostics, CRD only), #551 (
check_compatibilitydocstring; this touches the "Checks performed" list, a small conflict at most).Checklist
make test-python)make verify)git commit -s)Testing
Unit tests
Integration tests
E2E tests
Manually tested (describe below)
Live, k3s v1.33.1 with the Trainer v2.2.0 controller,
check_compatibilitythrough an MCP client:trainer_versioncompatiblev2.2.0(as installed)warn, recommendation names v2.2.0 and the rangev2.3.0passunknown, "... in namespace 'kubeflow-system': Not Found"On
mainthe same cluster reports compatible with no mention of the release (output in bug(trainer): check_compatibility passes on Trainer releases outside the supported range #669).Unit: 15 new tests in
planning_test.py(in range, below, above, a release candidate in and out of range, missing / forbidden / no key / no data / custom build, nopackaging, the namespace variable, short error detail, and throughcheck_compatibility: warns but stays compatible, not read without the CRD).Mutation checks: skipping the call, reporting out of range as
pass, and ignoringKUBEFLOW_SYSTEM_NAMESPACEeach fail the new tests.Full suite: 3227 passed; the only errors are the 2 Windows-only
log_stream_testerrors from test(trainer): test_byte_cap_does_not_advance_over_partial_lines errors on Windows because its test ID is 100,000 characters long #543, which also fail onmain.ruff check,ruff format --checkanduv lock --checkclean.Not tested: a live 403 (covered by a unit test), and Trainer installed outside
kubeflow-system.Assisted-by: AI coding agent