agentleFS
Aidas-devAidas-dev/k8s-agent-skills/skills/kubeflow-training-operator/SKILL.md

kubeflow-training-operator

Skill4 starsChanged 5 months agoMITView on GitHub

Legacy Kubeflow Training Operator v1 — PyTorchJob, TFJob, MPIJob, XGBoostJob, ModelMesh CRDs for distributed training on Kubernetes (deprecated in favor of Trainer v2).

The file

Files
SKILL.md

Kubeflow Training Operator v1 (Legacy)

Repository: github.com/kubeflow/training-operator
API version: kubeflow.org/v1
Status: Deprecated — maintained on release-1.9 branch. New deployments should use kubeflow-trainer skill (Trainer v2).

Migration Status

v1 CRDv2 EquivalentMigration Status
PyTorchJobTrainJob + Runtime (mlPolicy.torch)✅ Fully migrated
TFJobTrainJob + Runtime (mlPolicy.mpi)✅ Fully migrated
MPIJobTrainJob + Runtime (mlPolicy.mpi)✅ Fully migrated
XGBoostJobTrainJob + Runtime (mlPolicy.xgboost)✅ Supported in v2.2
PaddleJobTrainJob + Runtime⚠️ Pending
ModelMesh—Separate project

Migration guide: kubeflow.org/docs/components/trainer/operator-guides/migration/

CRDs

PyTorchJob

apiVersion: kubeflow.org/v1
kind: PyTorchJob
metadata:
  name: pytorch-mnist
spec:
  pytorchReplicaSpecs:
    Master:
      replicas: 1
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: pytorch
              image: pytorch/pytorch:2.5.0-cuda12.4-cudnn9-runtime
              command:
                - python
                - /workspace/train.py
              resources:
                limits:
                  nvidia.com/gpu: 1
    Worker:
      replicas: 3
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: pytorch
              image: pytorch/pytorch:2.5.0-cuda12.4-cudnn9-runtime
              command:
                - python
                - /workspace/train.py
              resources:
                limits:
                  nvidia.com/gpu: 1

TFJob

apiVersion: kubeflow.org/v1
kind: TFJob
metadata:
  name: tf-mnist
spec:
  tfReplicaSpecs:
    Chief:
      replicas: 1
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: tensorflow
              image: tensorflow/tensorflow:2.17.0-gpu
              command: ["python", "/workspace/train.py"]
    Worker:
      replicas: 2
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: tensorflow
              image: tensorflow/tensorflow:2.17.0-gpu
              command: ["python", "/workspace/train.py"]
    PS:
      replicas: 1
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: tensorflow
              image: tensorflow/tensorflow:2.17.0-gpu
              command: ["python", "/workspace/train.py"]

MPIJob

apiVersion: kubeflow.org/v1
kind: MPIJob
metadata:
  name: mpi-job
spec:
  slotsPerWorker: 4
  mpiReplicaSpecs:
    Launcher:
      replicas: 1
      template:
        spec:
          containers:
            - image: mpi-image:latest
              command: ["mpirun", "-np", "4", "/workspace/train"]
    Worker:
      replicas: 2
      template:
        spec:
          containers:
            - image: mpi-image:latest
              resources:
                limits:
                  nvidia.com/gpu: 2

XGBoostJob

apiVersion: kubeflow.org/v1
kind: XGBoostJob
metadata:
  name: xgboost-job
spec:
  xgbReplicaSpecs:
    Master:
      replicas: 1
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: xgboost
              image: xgboost/xgboost:latest
              command: ["python", "/workspace/train.py"]
    Worker:
      replicas: 3
      restartPolicy: OnFailure
      template:
        spec:
          containers:
            - name: xgboost
              image: xgboost/xgboost:latest
              command: ["python", "/workspace/train.py"]

Common Fields (all v1 CRDs)

FieldDescription
spec.<framework>ReplicaSpecsMap of replica types (Master/Worker/Chief/PS/Launcher)
replicasNumber of pods for this replica type
restartPolicyNever, OnFailure, ExitCode
templateStandard PodTemplateSpec
runPolicyCleanPodPolicy, scheduling, backoff, ttlSecondsAfterFinished
spec.slotsPerWorker(MPIJob) GPUs/accelerators per worker

Common Mistakes

  • Not migrating — v1 Training Operator is on maintenance-only. New features, performance improvements, and JAX/XGBoost/Flux support are only in v2 Trainer.
  • Other frameworks — PaddleJob is not yet migrated. Pin to specific training-operator versions if using PaddlePaddle.
  • Missing scheduling — v1 jobs don't have native Kueue integration. Use runPolicy.scheduling.podGroupPolicy for basic gang-scheduling.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.