• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kubeflow / trainer / 31531954434
68%

Build:
DEFAULT BRANCH: master
Ran 11 Aug 2026 08:20PM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 Aug 2026 08:14PM UTC coverage: 68.626% (-0.09%) from 68.718%
31531954434

push

github

web-flow
fix(api): reject zero and negative numNodes and numProcPerNode (#3809)

TrainJob.Spec.Trainer.NumNodes and NumProcPerNode had no lower-bound
validation, so values like numNodes: -3 or numProcPerNode: -5 were
accepted at admission and propagated into the pod spec (the Torch plugin
rendered PET_NPROC_PER_NODE=-5 and set the trainer PodSet count to 0),
failing at pod runtime instead of at admission.

Add +kubebuilder:validation:Minimum=0 to numNodes and an XValidation
self >= 1 rule to numProcPerNode, and regenerate the CRDs so the API
server rejects invalid values at admission. numNodes allows 0 to keep the
API aligned with JobSet's replicas (kubernetes-sigs/jobset#1279), rejecting
only negatives. numProcPerNode stays >= 1 since zero processes-per-node is
meaningless; it uses the same XValidation form as the existing
FluxMLPolicySource.NumProcPerNode contract so the kube-api-linter keeps the
field a pointer (nil means "auto" for the Torch runtime, which a plain
Minimum=1 marker would let the linter strip).

Apply the same XValidation self >= 1 rule to
MPIMLPolicySource.NumProcPerNode so the MPI MLPolicy is validated
consistently with the Flux MLPolicy and the TrainJob trainer field. For
MPI the value is written straight into the OpenMPI hostfile as the slots
count and into OMPI_MCA_orte_set_default_slots, so a zero or negative
value produced an invalid hostfile at pod runtime.

Drop the numProcPerNode < 1 check from the Flux plugin webhook now that
the CRD schema rejects the value earlier at admission, and remove the two
plugin unit test cases that covered it. A pre-existing Flux
numProcPerNode < 1 integration case expected a Forbidden error from the
plugin webhook; the value is now rejected by the CRD schema, so its
matcher is updated to Invalid.

The OptimizationJob CRD embeds the same Trainer type, so its generated
schema picks up both markers as well.

Closes #3805

Signed-off-by: Sanskar Singh <sanskarsinghty1234@gmail.com>

1 of 1 new or added line in 1 file covered. (100.0%)

2568 of 3742 relevant lines covered (68.63%)

0.8 hits per line

Jobs
ID Job ID Ran Files Coverage
1 31531954434.1 11 Aug 2026 08:20PM UTC 42
68.63
GitHub Action Run
Source Files on build 31531954434
  • Tree
  • List 42
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8f6c5f06 on github
  • Prev Build on master (#31529637572)
  • Next Build on master (#31907625054)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc