Skip to content

Commit

Permalink
Remove replica bounds check, and allow reconciliation take care it
Browse files Browse the repository at this point in the history
  • Loading branch information
nstogner committed Oct 18, 2024
1 parent 8a828b1 commit b2ad9c5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 18 deletions.
1 change: 0 additions & 1 deletion api/v1/model_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

// ModelSpec defines the desired state of Model.
// +kubebuilder:validation:XValidation:rule="!has(self.cacheProfile) || self.url.startsWith(\"hf://\")", message="cacheProfile is only supported with a huggingface url (\"hf://...\") at the moment."
// +kubebuilder:validation:XValidation:rule="!has(self.replicas) || (self.minReplicas <= self.replicas) && (!has(self.maxReplicas) || self.replicas <= self.maxReplicas)", message="replicas should be in the range minReplicas..maxReplicas."
// +kubebuilder:validation:XValidation:rule="!has(self.maxReplicas) || self.minReplicas <= self.maxReplicas", message="minReplicas should be less than or equal to maxReplicas."
type ModelSpec struct {
// URL of the model to be served.
Expand Down
3 changes: 0 additions & 3 deletions charts/kubeai/templates/crds/kubeai.org_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ spec:
- message: cacheProfile is only supported with a huggingface url ("hf://...")
at the moment.
rule: '!has(self.cacheProfile) || self.url.startsWith("hf://")'
- message: replicas should be in the range minReplicas..maxReplicas.
rule: '!has(self.replicas) || (self.minReplicas <= self.replicas) &&
(!has(self.maxReplicas) || self.replicas <= self.maxReplicas)'
- message: minReplicas should be less than or equal to maxReplicas.
rule: '!has(self.maxReplicas) || self.minReplicas <= self.maxReplicas'
status:
Expand Down
14 changes: 0 additions & 14 deletions test/integration/model_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,6 @@ func TestModelValidation(t *testing.T) {
},
expValid: true,
},
{
model: v1.Model{
ObjectMeta: metadata("replicas-1-3-2-invalid"),
Spec: v1.ModelSpec{
URL: "hf://test-repo/test-model",
Engine: "VLLM",
Features: []v1.ModelFeature{},
MinReplicas: 1,
Replicas: ptr.To[int32](3),
MaxReplicas: ptr.To[int32](2),
},
},
expErrContain: "replicas should be in the range minReplicas..maxReplicas",
},
{
model: v1.Model{
ObjectMeta: metadata("replicas-3-nil-2-invalid"),
Expand Down

0 comments on commit b2ad9c5

Please sign in to comment.