Skip to content

bug(trainer): check_compatibility passes on Trainer releases outside the supported range #669

Todo

Description

@abhishekKokadwar

What happens

The server's instructions say Kubeflow Trainer >=2.3.0,<2.4.0 is required (KUBEFLOW_TRAINER_VERSION_SPEC), but nothing checks it. check_compatibility checks the Kubernetes version, that the TrainJob CRD exists and serves v1alpha1, the SDK version and the platform. Every Trainer 2.x release serves v1alpha1, so an unsupported release passes and the agent is told to go ahead. pre_flight repeats the same checks.

Reproduce

k3s v1.33.1 with the Trainer v2.2.0 controller (manifests/overlays/manager?ref=v2.2.0), check_compatibility from main (ce1dbcf) through an MCP client:

{
  "compatible": true,
  "checks": {
    "kubernetes_version": {"status": "pass", "version": "v1.33.1+k3s1", "minimum": "v1.27"},
    "trainer_crd": {"status": "pass", "served_versions": ["v1alpha1"]},
    "trainer_api_version": {"status": "pass", "required": "v1alpha1", "served": ["v1alpha1"]},
    "kubeflow_sdk": {"status": "pass", "version": "0.5.0", "required": ">=0.5.0,<0.6.0"},
    "platform": {"status": "info", "detected": "kubernetes"}
  },
  "blockers": [],
  "recommendations": ["Environment compatible — proceed with get_cluster_resources()"]
}

The same holds above the range: on Trainer v2.4.0, 0.2.0rc3 also reported compatible (#342).

Expected

check_compatibility reports the installed Trainer release and says when it is outside the supported range.

Where the release is

Trainer publishes it in the kubeflow-trainer-public ConfigMap in kubeflow-system. On the cluster above: {"kubeflow_trainer_version": "v2.2.0"}. The SDK already reads this ConfigMap in KubernetesBackend.verify_backend(), but only logs a warning when it is missing and, as its docstring says, "does not enforce version compatibility".

Proposal

  • Add a trainer_version check to check_compatibility: read kubeflow_trainer_version from that ConfigMap (namespace from KUBEFLOW_SYSTEM_NAMESPACE, default kubeflow-system, same as the SDK) and compare it with KUBEFLOW_TRAINER_VERSION_SPEC.
  • Outside the range: a warning with the installed and supported versions, not a blocker. A release outside the tested range often still works, and a hard block would stop users who knowingly run a newer Trainer.
  • ConfigMap missing, unreadable (403) or a non-release value (custom builds): status: "unknown" with a hint, never a failure, so clusters that work today keep working.
  • Unit tests for in range, below, above, missing, forbidden and a non-semver value.

Related: #513 / #514 (widening the range to 2.4), #428 (readiness diagnostics, CRD only), #551 (check_compatibility docstring). I'll keep the change to the new check so it does not conflict with those.

I'd like to work on this.

Assisted-by: AI agent

Activity

  1. abhishekKokadwar commented on Dec 1, 2026

    @abhishekKokadwar
    MemberAuthor

    /assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions