Skip to content

Commit 411c258

Browse files
authored
Merge branch 'main' into mpece-2
2 parents 49a3158 + 5debae8 commit 411c258

File tree

182 files changed

+11283
-1292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+11283
-1292
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CRD Validation
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, synchronize, reopened]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
crd-validation:
12+
name: CRD Validation Check
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v6
23+
with:
24+
go-version: "1.25"
25+
cache: true
26+
27+
- name: Install crdify
28+
run: |
29+
go install sigs.k8s.io/crdify@latest
30+
31+
- name: Run CRD Validation Check
32+
run: |
33+
git fetch origin ${{ github.base_ref }}:upstream_base
34+
BASE_SHA=$(git rev-parse upstream_base)
35+
36+
FAILED=0
37+
for crd in config/crd/bases/*.yaml; do
38+
if ! crdify "git://${BASE_SHA}?path=$crd" "git://HEAD?path=$crd"; then
39+
echo "❌ Incompatible change detected in $crd"
40+
((FAILED++))
41+
else
42+
echo "✅ $crd is valid"
43+
fi
44+
done
45+
46+
if [ "$FAILED" -gt 0 ]; then
47+
echo "::error::Validation failed! Found $FAILED incompatible CRD change(s)."
48+
exit 1
49+
fi
50+
51+
echo "All CRDs are compatible."

OWNERS_ALIASES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ aliases:
1212
- elevran
1313
- liu-cong
1414
- robscott
15+
- shmuelk

apix/config/v1alpha1/endpointpickerconfig_types.go

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,25 @@ type EndpointPickerConfig struct {
3939
// SchedulingProfiles is the list of named SchedulingProfiles
4040
// that will be created.
4141
SchedulingProfiles []SchedulingProfile `json:"schedulingProfiles"`
42+
43+
// +optional
44+
// FeatureGates is a set of flags that enable various experimental features with the EPP.
45+
// If omitted non of these experimental features will be enabled.
46+
FeatureGates FeatureGates `json:"featureGates,omitempty"`
47+
48+
// +optional
49+
// SaturationDetector when present specifies the configuration of the
50+
// Saturation detector. If not present, default values are used.
51+
SaturationDetector *SaturationDetector `json:"saturationDetector,omitempty"`
4252
}
4353

4454
func (cfg EndpointPickerConfig) String() string {
4555
return fmt.Sprintf(
46-
"{Plugins: %v, SchedulingProfiles: %v}",
56+
"{Plugins: %v, SchedulingProfiles: %v, FeatureGates: %v, SaturationDetector: %v}",
4757
cfg.Plugins,
4858
cfg.SchedulingProfiles,
59+
cfg.FeatureGates,
60+
cfg.SaturationDetector,
4961
)
5062
}
5163

@@ -118,3 +130,64 @@ func (sp SchedulingPlugin) String() string {
118130
}
119131
return fmt.Sprintf("{PluginRef: %s%s}", sp.PluginRef, weight)
120132
}
133+
134+
// FeatureGates is a set of flags that enable various experimental features with the EPP
135+
type FeatureGates []string
136+
137+
func (fg FeatureGates) String() string {
138+
if fg == nil {
139+
return "{}"
140+
}
141+
142+
result := ""
143+
for _, gate := range fg {
144+
result += gate + ","
145+
}
146+
147+
if len(result) > 0 {
148+
result = result[:len(result)-1]
149+
}
150+
return "{" + result + "}"
151+
}
152+
153+
// SaturationDetector
154+
type SaturationDetector struct {
155+
// +optional
156+
// QueueDepthThreshold defines the backend waiting queue size above which a
157+
// pod is considered to have insufficient capacity for new requests.
158+
QueueDepthThreshold int `json:"queueDepthThreshold,omitempty"`
159+
160+
// +optional
161+
// KVCacheUtilThreshold defines the KV cache utilization (0.0 to 1.0) above
162+
// which a pod is considered to have insufficient capacity.
163+
KVCacheUtilThreshold float64 `json:"kvCacheUtilThreshold,omitempty"`
164+
165+
// +optional
166+
// MetricsStalenessThreshold defines how old a pod's metrics can be.
167+
// If a pod's metrics are older than this, it might be excluded from
168+
// "good capacity" considerations or treated as having no capacity for
169+
// safety.
170+
MetricsStalenessThreshold metav1.Duration `json:"metricsStalenessThreshold,omitempty"`
171+
}
172+
173+
func (sd *SaturationDetector) String() string {
174+
result := ""
175+
if sd != nil {
176+
if sd.QueueDepthThreshold != 0 {
177+
result += fmt.Sprintf("QueueDepthThreshold: %d", sd.QueueDepthThreshold)
178+
}
179+
if sd.KVCacheUtilThreshold != 0.0 {
180+
if len(result) != 0 {
181+
result += ", "
182+
}
183+
result += fmt.Sprintf("KVCacheUtilThreshold: %g", sd.KVCacheUtilThreshold)
184+
}
185+
if sd.MetricsStalenessThreshold.Duration != 0.0 {
186+
if len(result) != 0 {
187+
result += ", "
188+
}
189+
result += fmt.Sprintf("MetricsStalenessThreshold: %s", sd.MetricsStalenessThreshold)
190+
}
191+
}
192+
return "{" + result + "}"
193+
}

apix/config/v1alpha1/zz_generated.deepcopy.go

Lines changed: 45 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)